diff --git a/ChangeLog b/ChangeLog index aca6c9578..997da1837 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +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 diff --git a/Headers/gnustep/gui/NSText.h b/Headers/gnustep/gui/NSText.h index a266a13ff..8685e1b8d 100644 --- a/Headers/gnustep/gui/NSText.h +++ b/Headers/gnustep/gui/NSText.h @@ -304,6 +304,8 @@ typedef enum _NSSelectionAffinity { -(void) replaceRange:(NSRange)range withAttributedString:(NSAttributedString*)attrString; -(unsigned) textLength; +- (NSRange) lineRangeForRect: (NSRect) rect; +- (NSRect) rectForCharacterIndex: (unsigned) index; // // these NSTextView methods are here only informally (GNU extensions) diff --git a/Source/NSCachedImageRep.m b/Source/NSCachedImageRep.m index e48999e7f..984103aac 100644 --- a/Source/NSCachedImageRep.m +++ b/Source/NSCachedImageRep.m @@ -41,8 +41,6 @@ #include #include -static BOOL NSImageCompositing = YES; - @interface GSCacheW : NSWindow @end @@ -73,14 +71,6 @@ static BOOL NSImageCompositing = YES; @implementation NSCachedImageRep -- (void) initialize -{ - id obj = [[NSUserDefaults standardUserDefaults] - stringForKey: @"ImageCompositing"]; - if (obj) - NSImageCompositing = [obj boolValue]; -} - // Initializing an NSCachedImageRep - (id) initWithSize: (NSSize)aSize depth: (NSWindowDepth)aDepth @@ -154,12 +144,9 @@ static BOOL NSImageCompositing = YES; - (BOOL)draw { - if (NSImageCompositing) - PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), + PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), [_window gState], NSMinX(_rect), NSMinY(_rect), NSCompositeSourceOver); - else - NSCopyBits([_window gState], _rect, _rect.origin); return YES; } @@ -177,12 +164,9 @@ static BOOL NSImageCompositing = YES; if ([[ctxt focusView] isFlipped]) aPoint.y -= size.height; } - if (NSImageCompositing) - PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), + PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), [_window gState], aPoint.x, aPoint.y, NSCompositeSourceOver); - else - NSCopyBits([_window gState], _rect, aPoint); return NO; } @@ -198,12 +182,9 @@ static BOOL NSImageCompositing = YES; ctxt = GSCurrentContext(); if ([[ctxt focusView] isFlipped]) aRect.origin.y -= NSHeight(aRect); - if (NSImageCompositing) - PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), + PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), [_window gState], NSMinX(aRect), NSMinY(aRect), NSCompositeSourceOver); - else - NSCopyBits([_window gState], _rect, aRect.origin); return YES; } diff --git a/Source/NSSlider.m b/Source/NSSlider.m index 0c207ab9c..9d5e7b3c6 100644 --- a/Source/NSSlider.m +++ b/Source/NSSlider.m @@ -68,6 +68,7 @@ static Class cellClass; // set our cell [self setCell: theCell]; [theCell setState: 1]; + [theCell setContinuous: YES]; return self; } diff --git a/Source/NSWindow.m b/Source/NSWindow.m index fd1746c3b..12e9432d3 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -64,17 +64,6 @@ #include #include -static float GSTitleBarHeight = 24.0; -static float GSResizeBarHeight = 11.0; -/* - PJB: This should be the same as in GSMenuBarHeight in NSMenuView - and the actual title bar height currently drawn by WindowMaker. - (We should do this ourselves). - I don't know how it's been computed for NSMenu, but I find the - title bar heigh to be 24 pixels. -*/ - - BOOL GSViewAcceptsDrag(NSView *v, id dragInfo); /* @@ -613,7 +602,7 @@ static NSMapTable* windowmaps = NULL; backing_type = bufferingType; style_mask = aStyle; - + frame = [NSWindow frameRectForContentRect: contentRect styleMask: aStyle]; minimum_size = NSMakeSize(frame.size.width - contentRect.size.width + 1, frame.size.height - contentRect.size.height + 1); @@ -1186,18 +1175,9 @@ static NSMapTable* windowmaps = NULL; { NSSize screenSize = [[NSScreen mainScreen] frame].size; NSPoint origin = frame.origin; - float offset=0.0; - // center the window within it's screen, - // taking into account the title bar and the resize bar heights . - if((style_mask&NSTitledWindowMask)!=0){ - offset+=GSTitleBarHeight; - } - if((style_mask&NSResizableWindowMask)!=0){ - offset+=GSResizeBarHeight; - } origin.x = (screenSize.width - frame.size.width) / 2; - origin.y = (screenSize.height - offset - frame.size.height) / 2; + origin.y = (screenSize.height - frame.size.height) / 2; [self setFrameOrigin: origin]; }