Merge from 0.8.0

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14232 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-08-03 03:32:19 +00:00
parent ecd458c9cd
commit f51c1bbf10
14 changed files with 267 additions and 91 deletions

View file

@ -1,7 +1,7 @@
ANNOUNCE
********
This is version 0.7.8 of the GNUstep GUI library (`gnustep-gui').
This is version 0.8.0 of the GNUstep GUI library (`gnustep-gui').
What is the GNUstep GUI Library?
================================
@ -28,17 +28,39 @@ systems.
GNUstep Base Library, the TIFF Graphics library, and a back-end
component like the GNUstep 'Back' Backend.
Noteworthy changes in version `0.7.8'
Noteworthy changes in version `0.8.0'
=====================================
Since the last stable version, 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.
* Wheel color picker, standard color picker (bundles) added.
* System colors now use named colors. Easier configuration
* Better autolayout with GSTable and subclasses.
* NSOutlineView.
* Scroll wheel support.
* Fully-functional keybindings, including multi-stroke keybindings.
* Memory panel available from Info Panel.
Where can you get it? How can you compile it?
==============================================
The gstep-gui-0.7.8.tar.gz distribution file has been placed on
The gstep-gui-0.8.0.tar.gz distribution file has been placed on
`ftp.gnustep.org' in `pub/gnustep/core'.
the TIFF Graphics library version 3.4 is required.

View file

@ -1,3 +1,7 @@
2002-08-02 Adam Fedor <fedor@gnu.org>
* Merge changes from 0.8.0 into main branch.
2002-08-02 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
* Source/NSTabView.m ([NSTabView -initWithCoder:]):
@ -40,6 +44,56 @@
"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 <fedor@gnu.org>
* Version:0.8.0
Tue Jul 30 11:07:45 2002 Nicola Pero <n.pero@mi.flashnet.it>
Patch by David Ayers (<d.ayers@inode.at>), 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 <fedor@gnu.org>
* 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 <n.pero@mi.flashnet.it>
* 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 <fedor@gnu.org>
* Source/NSImageCell.m (-setImage:): Check if non-nil.
Make sure size is not 0.
Mon Jul 22 12:50:34 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSApplication.m (initialize_gnustep_backend): Remove
useless instruction in loop looking for the backend. (Patch by
David David Relson <relson@osagesoftware.com>).
2002-07-20 Adam Fedor <fedor@gnu.org>
* Source/NSWindow.m (-_initDefaults): Set background
to windowBackgroundColor.
2002-07-19 Adam Fedor <fedor@gnu.org>
* Source/NSImage.m (-lockFocusOnRepresentation:): Make sure
newly created cache image is valid.
* Source/NSCursor.m (backgroundColorHint:): Remove extra NSLog.
2002-07-17 Adam Fedor <fedor@gnu.org>
* Version: 0.7.9

View file

@ -9,6 +9,12 @@
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
@end ifclear
@section Noteworthy changes in version @samp{0.8.0}
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.7.9}
@itemize @bullet
@ -17,10 +23,6 @@ The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSIO
@item Skeleton implementation of NSToolBar
@end itemize
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.7.8}
@itemize @bullet

14
NEWS
View file

@ -1,7 +1,19 @@
NEWS
****
The currently released version of the library is `0.7.8'.
The currently released version of the library is `0.8.0'.
Noteworthy changes in version `0.8.0'
=====================================
Noteworthy changes in version `0.7.9'
=====================================
* NSTableView, NSOutlineView improvements.
* Menus no longer work in modal loop.
* Skeleton implementation of NSToolBar
Noteworthy changes in version `0.7.8'
=====================================

2
README
View file

@ -1,7 +1,7 @@
README
******
This is version 0.7.8 of the GNUstep GUI library (`gnustep-gui').
This is version 0.8.0 of the GNUstep GUI library (`gnustep-gui').
Here is some introductory info to get you started:

View file

@ -188,8 +188,9 @@ initialize_gnustep_backend(void)
path = [path stringByAppendingPathComponent: @"Bundles"];
path = [path stringByAppendingPathComponent: bundleName];
if ([[NSFileManager defaultManager] fileExistsAtPath: path])
break;
path = nil;
{
break;
}
}
NSCAssert1(path != nil,
GSGuiLocalizedString (@"Unable to load backend %@",
@ -474,23 +475,54 @@ static NSCell* tileCell = nil;
}
}
+ (void)detachDrawingThread:(SEL)selector toTarget:(id)target withObject:(id)argument
+ (void) detachDrawingThread: (SEL)selector
toTarget: (id)target
withObject: (id)argument
{
// TODO: This is not fully defined by Apple
/* TODO: This is not fully defined by Apple. */
}
/*
* 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)
/* If the global application does not yet exist then create it. */
if (NSApp == nil)
{
/*
* Don't combine the following two statements into one to avoid
* problems with some classes' initialization code that tries
* to get the shared application.
*/
NSApp = [self alloc];
[NSApp init];
/* -init sets NSApp. */
[[self alloc] init];
}
return NSApp;
}
@ -498,67 +530,103 @@ static NSCell* tileCell = nil;
/*
* Instance methods
*/
/*
* 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
{
GSDisplayServer *srv;
if (NSApp != nil && NSApp != self)
{
RELEASE(self);
return [NSApplication sharedApplication];
}
// Initialization must be enclosed in an autorelease pool
/*
* 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,
GSGuiLocalizedString
(@"[NSApplication -init] called more than once", nil));
{
GSDisplayServer *srv;
/* Initialization must be enclosed in an autorelease pool. */
CREATE_AUTORELEASE_POOL (_app_init_pool);
self = [super init];
/*
* 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;
if (NSApp == nil)
{
NSLog(GSGuiLocalizedString
(@"Cannot allocate the application instance!\n", nil));
RELEASE (_app_init_pool);
return nil;
}
NSDebugLog(@"Begin of NSApplication -init\n");
/* Initialize the backend here. */
/* Initialize the backend here. */
initialize_gnustep_backend();
/* Connect to our window server */
/* Connect to our window server. */
srv = [GSDisplayServer serverWithAttributes: nil];
RETAIN(srv);
[GSDisplayServer setCurrentServer: srv];
/* Create a default context. */
/* Create a default context. */
_default_context = [NSGraphicsContext graphicsContextWithAttributes: nil];
RETAIN(_default_context);
[NSGraphicsContext setCurrentContext: _default_context];
/* Initialize font manager */
/* Initialize font manager. */
[NSFontManager sharedFontManager];
_hidden = [[NSMutableArray alloc] init];
_inactive = [[NSMutableArray alloc] init];
_unhide_on_activation = YES;
_app_is_hidden = YES;
/* Ivar already automatically initialized to NO when the app is created */
/* Ivar already automatically initialized to NO when the app is
created. */
//_app_is_active = NO;
//_main_menu = nil;
_windows_need_update = YES;
/* Set a new exception handler for the gui library */
/* 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 */
/* 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 */
/* We are the end of responder chain. */
[self setNextResponder: nil];
RELEASE (_app_init_pool);

View file

@ -242,7 +242,6 @@ backgroundColorHint:(NSColor *)bg
fg = [NSColor blackColor];
bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
NSLog(@"fg color is %@", fg);
[GSCurrentServer() setcursorcolor: fg : bg : _cid];
}
return cursor;

View file

@ -879,17 +879,28 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
if (NSImageDoesCaching == YES)
{
NSWindow *window;
GSRepData *repd;
if (imageRep == nil)
imageRep = [self bestRepresentationForDevice: nil];
imageRep = [self _cacheForRep: imageRep];
repd = repd_for_rep(_reps, imageRep);
window = [(NSCachedImageRep *)imageRep window];
_lockedView = [window contentView];
if (_lockedView == nil)
[NSException raise: NSImageCacheException
format: @"Cannot lock focus on nil rep"];
[_lockedView lockFocus];
/* Validate cached image */
if (repd->bg == nil)
{
repd->bg = [_color copy];
[_color set];
NSRectFill(NSMakeRect(0, 0, _size.width, _size.height));
}
}
}

View file

@ -58,7 +58,10 @@
- (void) setImage:(NSImage *)anImage
{
[super setImage:anImage];
_original_image_size = [anImage size];
if (anImage)
_original_image_size = [anImage size];
else
_original_image_size = NSMakeSize(1,1);
}
//

View file

@ -384,7 +384,7 @@ NSDictionary *paperSizes = nil;
#else
NSBundle *adminBundle;
adminBundle = [NSBundle bundleWithPath: @GNUSTEP_INSTALL_LIBDIR]
adminBundle = [NSBundle bundleWithPath: @GNUSTEP_INSTALL_LIBDIR];
path = [adminBundle pathForResource: @"PrintDefaults"
ofType: nil
inDirectory: @"PrinterAdmin"];

View file

@ -286,6 +286,7 @@ setupSpecialRun(GSTextRun *run, unsigned length, unichar *chars, unsigned pos,
run->baseline = [run->cell cellBaselineOffset].y;
run->height = run->glyphs[0].adv.height;
run->width = run->glyphs[0].adv.width;
// Unset the normale fields
run->font = nil;
run->bg = nil;

View file

@ -1185,7 +1185,6 @@ static NSNotificationCenter *nc;
{
NSArray *array;
int i, count;
void (*msg)(id, SEL, BOOL);
if (IS_SYNCHRONIZING_FLAGS == YES)
{
@ -1197,31 +1196,32 @@ static NSNotificationCenter *nc;
array = [_layoutManager textContainers];
count = [array count];
msg = (void (*)(id, SEL, BOOL))[self methodForSelector: action];
if (!msg)
{
[NSException raise: NSGenericException
format: @"invalid selector in "
@"_syncTextViewsCalling:withFlag:"];
}
IS_SYNCHRONIZING_FLAGS = YES;
for (i = 0; i < count; i++)
{
NSTextView *tv;
void (*msg)(id, SEL, BOOL);
tv = [(NSTextContainer *)[array objectAtIndex: i] textView];
(*msg) (tv, action, flag);
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;
}
#define NSTEXTVIEW_SYNC(X) \
#define NSTEXTVIEW_SYNC \
if (_tvf.multiple_textviews && (IS_SYNCHRONIZING_FLAGS == NO)) \
{ [self _syncTextViewsByCalling: X withFlag: flag]; \
{ [self _syncTextViewsByCalling: _cmd withFlag: flag]; \
return; }
/*
@ -1240,7 +1240,7 @@ static NSNotificationCenter *nc;
- (void) setEditable: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setEditable:));
NSTEXTVIEW_SYNC;
[super setEditable: flag];
if ([self shouldDrawInsertionPoint])
@ -1260,7 +1260,7 @@ static NSNotificationCenter *nc;
- (void) setFieldEditor: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setFieldEditor:));
NSTEXTVIEW_SYNC;
[self setHorizontallyResizable: NO];
[self setVerticallyResizable: NO];
[super setFieldEditor: flag];
@ -1268,13 +1268,13 @@ static NSNotificationCenter *nc;
- (void) setSelectable: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setSelectable:));
NSTEXTVIEW_SYNC;
[super setSelectable: flag];
}
- (void) setRichText: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setRichText:));
NSTEXTVIEW_SYNC;
[super setRichText: flag];
[self updateDragTypeRegistration];
@ -1283,7 +1283,7 @@ static NSNotificationCenter *nc;
- (void) setImportsGraphics: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setImportsGraphics:));
NSTEXTVIEW_SYNC;
[super setImportsGraphics: flag];
[self updateDragTypeRegistration];
@ -1291,7 +1291,7 @@ static NSNotificationCenter *nc;
- (void) setUsesRuler: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setUsesRuler:));
NSTEXTVIEW_SYNC;
_tf.uses_ruler = flag;
}
@ -1302,7 +1302,7 @@ static NSNotificationCenter *nc;
- (void) setUsesFontPanel: (BOOL)flag
{
NSTEXTVIEW_SYNC (@selector(setUsesFontPanel:));
NSTEXTVIEW_SYNC;
[super setUsesFontPanel: flag];
}
@ -1310,7 +1310,7 @@ static NSNotificationCenter *nc;
{
NSScrollView *sv;
NSTEXTVIEW_SYNC (@selector(setRulerVisible:));
NSTEXTVIEW_SYNC;
sv = [self enclosingScrollView];
_tf.is_ruler_visible = flag;
@ -3185,8 +3185,8 @@ afterString in order over charRange. */
RELEASE (mstyle);
}
- (void)rulerView:(NSRulerView *)ruler
didAddMarker:(NSRulerMarker *)marker
- (void) rulerView: (NSRulerView *)ruler
didAddMarker: (NSRulerMarker *)marker
{
NSTextTab *tab = [marker representedObject];
NSRange range = [self rangeForUserParagraphAttributeChange];
@ -4077,14 +4077,15 @@ other than copy/paste or dragging. */
- (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.
/* 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:)])
@ -4103,6 +4104,9 @@ other than copy/paste or dragging. */
forKey: @"NSTextMovement"];
[nc 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;
}

View file

@ -3960,7 +3960,7 @@ resetCursorRectsForView(NSView *theView)
_delegate = nil;
_windowNum = 0;
_gstate = 0;
_backgroundColor = RETAIN([NSColor controlColor]);
_backgroundColor = RETAIN([NSColor windowBackgroundColor]);
_representedFilename = @"Window";
_miniaturizedTitle = @"Window";
_miniaturizedImage = RETAIN([NSApp applicationIconImage]);

View file

@ -10,8 +10,8 @@ GNUSTEP_GUI_LIBTIFF=3.4
# The version number of this release.
GNUSTEP_GUI_MAJOR_VERSION=0
GNUSTEP_GUI_MINOR_VERSION=7
GNUSTEP_GUI_SUBMINOR_VERSION=9
GNUSTEP_GUI_MINOR_VERSION=8
GNUSTEP_GUI_SUBMINOR_VERSION=0
GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION}
VERSION=${GNUSTEP_GUI_VERSION}