mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
wraster library support and alpha/compositing improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6272 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
865001dd03
commit
327673731a
5 changed files with 22 additions and 44 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2000-03-11 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* 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 <richard@brainstorm.co.uk>
|
Sat Mar 11 06:32:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSStringDrawing.m: Fix error in handling extent of
|
* Source/NSStringDrawing.m: Fix error in handling extent of
|
||||||
|
|
|
@ -304,6 +304,8 @@ typedef enum _NSSelectionAffinity {
|
||||||
-(void) replaceRange:(NSRange)range
|
-(void) replaceRange:(NSRange)range
|
||||||
withAttributedString:(NSAttributedString*)attrString;
|
withAttributedString:(NSAttributedString*)attrString;
|
||||||
-(unsigned) textLength;
|
-(unsigned) textLength;
|
||||||
|
- (NSRange) lineRangeForRect: (NSRect) rect;
|
||||||
|
- (NSRect) rectForCharacterIndex: (unsigned) index;
|
||||||
|
|
||||||
//
|
//
|
||||||
// these NSTextView methods are here only informally (GNU extensions)
|
// these NSTextView methods are here only informally (GNU extensions)
|
||||||
|
|
|
@ -41,8 +41,6 @@
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
#include <AppKit/PSOperators.h>
|
#include <AppKit/PSOperators.h>
|
||||||
|
|
||||||
static BOOL NSImageCompositing = YES;
|
|
||||||
|
|
||||||
@interface GSCacheW : NSWindow
|
@interface GSCacheW : NSWindow
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -73,14 +71,6 @@ static BOOL NSImageCompositing = YES;
|
||||||
|
|
||||||
@implementation NSCachedImageRep
|
@implementation NSCachedImageRep
|
||||||
|
|
||||||
- (void) initialize
|
|
||||||
{
|
|
||||||
id obj = [[NSUserDefaults standardUserDefaults]
|
|
||||||
stringForKey: @"ImageCompositing"];
|
|
||||||
if (obj)
|
|
||||||
NSImageCompositing = [obj boolValue];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initializing an NSCachedImageRep
|
// Initializing an NSCachedImageRep
|
||||||
- (id) initWithSize: (NSSize)aSize
|
- (id) initWithSize: (NSSize)aSize
|
||||||
depth: (NSWindowDepth)aDepth
|
depth: (NSWindowDepth)aDepth
|
||||||
|
@ -154,12 +144,9 @@ static BOOL NSImageCompositing = YES;
|
||||||
|
|
||||||
- (BOOL)draw
|
- (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),
|
[_window gState], NSMinX(_rect), NSMinY(_rect),
|
||||||
NSCompositeSourceOver);
|
NSCompositeSourceOver);
|
||||||
else
|
|
||||||
NSCopyBits([_window gState], _rect, _rect.origin);
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,12 +164,9 @@ static BOOL NSImageCompositing = YES;
|
||||||
if ([[ctxt focusView] isFlipped])
|
if ([[ctxt focusView] isFlipped])
|
||||||
aPoint.y -= size.height;
|
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,
|
[_window gState], aPoint.x, aPoint.y,
|
||||||
NSCompositeSourceOver);
|
NSCompositeSourceOver);
|
||||||
else
|
|
||||||
NSCopyBits([_window gState], _rect, aPoint);
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,12 +182,9 @@ static BOOL NSImageCompositing = YES;
|
||||||
ctxt = GSCurrentContext();
|
ctxt = GSCurrentContext();
|
||||||
if ([[ctxt focusView] isFlipped])
|
if ([[ctxt focusView] isFlipped])
|
||||||
aRect.origin.y -= NSHeight(aRect);
|
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),
|
[_window gState], NSMinX(aRect), NSMinY(aRect),
|
||||||
NSCompositeSourceOver);
|
NSCompositeSourceOver);
|
||||||
else
|
|
||||||
NSCopyBits([_window gState], _rect, aRect.origin);
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ static Class cellClass;
|
||||||
// set our cell
|
// set our cell
|
||||||
[self setCell: theCell];
|
[self setCell: theCell];
|
||||||
[theCell setState: 1];
|
[theCell setState: 1];
|
||||||
|
[theCell setContinuous: YES];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,17 +64,6 @@
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/GSWraps.h>
|
#include <AppKit/GSWraps.h>
|
||||||
|
|
||||||
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<NSDraggingInfo> dragInfo);
|
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -613,7 +602,7 @@ static NSMapTable* windowmaps = NULL;
|
||||||
|
|
||||||
backing_type = bufferingType;
|
backing_type = bufferingType;
|
||||||
style_mask = aStyle;
|
style_mask = aStyle;
|
||||||
|
|
||||||
frame = [NSWindow frameRectForContentRect: contentRect styleMask: aStyle];
|
frame = [NSWindow frameRectForContentRect: contentRect styleMask: aStyle];
|
||||||
minimum_size = NSMakeSize(frame.size.width - contentRect.size.width + 1,
|
minimum_size = NSMakeSize(frame.size.width - contentRect.size.width + 1,
|
||||||
frame.size.height - contentRect.size.height + 1);
|
frame.size.height - contentRect.size.height + 1);
|
||||||
|
@ -1186,18 +1175,9 @@ static NSMapTable* windowmaps = NULL;
|
||||||
{
|
{
|
||||||
NSSize screenSize = [[NSScreen mainScreen] frame].size;
|
NSSize screenSize = [[NSScreen mainScreen] frame].size;
|
||||||
NSPoint origin = frame.origin;
|
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 <PJB>.
|
|
||||||
if((style_mask&NSTitledWindowMask)!=0){
|
|
||||||
offset+=GSTitleBarHeight;
|
|
||||||
}
|
|
||||||
if((style_mask&NSResizableWindowMask)!=0){
|
|
||||||
offset+=GSResizeBarHeight;
|
|
||||||
}
|
|
||||||
origin.x = (screenSize.width - frame.size.width) / 2;
|
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];
|
[self setFrameOrigin: origin];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue