* 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.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33398 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2011-06-28 20:59:24 +00:00
parent a22d96f145
commit 1a31d7e65a
8 changed files with 166 additions and 69 deletions

View file

@ -151,6 +151,7 @@ static GSDragView *sharedDragView = nil;
[dragCell setBordered: NO];
[sharedDragWindow setContentView: self];
[sharedDragWindow setBackgroundColor: [NSColor clearColor]];
// Kept alive by the window
RELEASE(self);
}

View file

@ -58,7 +58,7 @@
*/
static const float pi = 3.1415926535897932384626434;
static const CGFloat pi = 3.1415926535897932384626434;
@implementation NSAffineTransform (GUIAdditions)
@ -108,15 +108,15 @@ static const float pi = 3.1415926535897932384626434;
@implementation NSAffineTransform (GNUstep)
- (void) scaleTo: (float)sx : (float)sy
- (void) scaleTo: (CGFloat)sx : (CGFloat)sy
{
NSAffineTransformStruct matrix = [self transformStruct];
NSAffineTransformStruct matrix = [self transformStruct];
/* If it's rotated. */
if (B != 0 || C != 0)
{
// FIXME: This case does not handle shear.
float angle = [self rotationAngle];
CGFloat angle = [self rotationAngle];
// Keep the translation and add scaling
A = sx; B = 0;
@ -146,22 +146,22 @@ static const float pi = 3.1415926535897932384626434;
- (void) setFrameOrigin: (NSPoint)point
{
NSAffineTransformStruct matrix = [self transformStruct];
float dx = point.x - TX;
float dy = point.y - TY;
NSAffineTransformStruct matrix = [self transformStruct];
CGFloat dx = point.x - TX;
CGFloat dy = point.y - TY;
[self translateXBy: dx yBy: dy];
}
- (void) setFrameRotation: (float)angle
- (void) setFrameRotation: (CGFloat)angle
{
[self rotateByDegrees: angle - [self rotationAngle]];
}
- (float) rotationAngle
- (CGFloat) rotationAngle
{
NSAffineTransformStruct matrix = [self transformStruct];
float rotationAngle = atan2(-C, A);
NSAffineTransformStruct matrix = [self transformStruct];
CGFloat rotationAngle = atan2(-C, A);
rotationAngle *= 180.0 / pi;
if (rotationAngle < 0.0)
@ -218,16 +218,16 @@ static const float pi = 3.1415926535897932384626434;
{
NSAffineTransformStruct matrix = [self transformStruct];
/* Shortcuts of the usual rect values */
float x = rect.origin.x;
float y = rect.origin.y;
float width = rect.size.width;
float height = rect.size.height;
float xc[3];
float yc[3];
float min_x;
float max_x;
float min_y;
float max_y;
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;

View file

@ -913,7 +913,7 @@ scaleRect(NSRect rect, double scale)
wlimit = [_view widthAdjustLimit];
for (i = first; i <= last; i++)
{
float newVal, limitVal;
CGFloat newVal, limitVal;
pageRect = [self _rectForPage: i info: info xpage: &xpage ypage: &ypage];
limitVal = NSMaxY(pageRect) - hlimit * NSHeight(pageRect);
[_view adjustPageHeightNew: &newVal

View file

@ -1265,8 +1265,8 @@ static NSSize _computeScale(NSSize fs, NSSize bs)
{
if (_boundsMatrix == nil)
{
float sx = _bounds.size.width / _frame.size.width;
float sy = _bounds.size.height / _frame.size.height;
CGFloat sx = _bounds.size.width / _frame.size.width;
CGFloat sy = _bounds.size.height / _frame.size.height;
_frame.size = newSize;
_bounds.size.width = _frame.size.width * sx;
@ -1305,9 +1305,9 @@ static NSSize _computeScale(NSSize fs, NSSize bs)
}
}
- (void) setFrameRotation: (float)angle
- (void) setFrameRotation: (CGFloat)angle
{
float oldAngle = [self frameRotation];
CGFloat oldAngle = [self frameRotation];
if (oldAngle != angle)
{
@ -1525,7 +1525,7 @@ static NSSize _computeScale(NSSize fs, NSSize bs)
[self setNeedsDisplay: YES];
}
- (void) setBoundsRotation: (float)angle
- (void) setBoundsRotation: (CGFloat)angle
{
[self rotateByAngle: angle - [self boundsRotation]];
}
@ -1600,7 +1600,7 @@ static NSSize _computeScale(NSSize fs, NSSize bs)
}
}
- (void) rotateByAngle: (float)angle
- (void) rotateByAngle: (CGFloat)angle
{
if (angle != 0.0)
{
@ -1962,8 +1962,8 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
*/
if (options > 0)
{
float change = superViewFrameSize.width - oldSize.width;
float changePerOption = change / options;
CGFloat change = superViewFrameSize.width - oldSize.width;
CGFloat changePerOption = change / options;
if (_autoresizingMask & NSViewWidthSizable)
{
@ -1993,8 +1993,8 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
*/
if (options > 0)
{
float change = superViewFrameSize.height - oldSize.height;
float changePerOption = change / options;
CGFloat change = superViewFrameSize.height - oldSize.height;
CGFloat changePerOption = change / options;
if (_autoresizingMask & NSViewHeightSizable)
{
@ -3067,7 +3067,7 @@ Returns YES iff any scrolling was done.
// 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
float ldiff, rdiff, tdiff, bdiff;
CGFloat ldiff, rdiff, tdiff, bdiff;
if (vRect.size.width == 0 && vRect.size.height == 0)
return NO;
@ -3988,12 +3988,12 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
/*
* Pagination
*/
- (void) adjustPageHeightNew: (float*)newBottom
top: (float)oldTop
bottom: (float)oldBottom
limit: (float)bottomLimit
- (void) adjustPageHeightNew: (CGFloat*)newBottom
top: (CGFloat)oldTop
bottom: (CGFloat)oldBottom
limit: (CGFloat)bottomLimit
{
float bottom = oldBottom;
CGFloat bottom = oldBottom;
if (_rFlags.has_subviews)
{
@ -4004,7 +4004,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
{
// FIXME: We have to convert this values for the subclass
float oTop, oBottom, oLimit;
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
@ -4040,12 +4040,12 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
*newBottom = bottom;
}
- (void) adjustPageWidthNew: (float*)newRight
left: (float)oldLeft
right: (float)oldRight
limit: (float)rightLimit
- (void) adjustPageWidthNew: (CGFloat*)newRight
left: (CGFloat)oldLeft
right: (CGFloat)oldRight
limit: (CGFloat)rightLimit
{
float right = oldRight;
CGFloat right = oldRight;
if (_rFlags.has_subviews)
{
@ -4058,7 +4058,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
/* See comments in adjustPageHeightNew:top:bottom:limit:
about why code is structured in this funny way. */
float oLeft, oRight, oLimit;
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
@ -4094,9 +4094,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
*newRight = right;
}
- (float) heightAdjustLimit
- (CGFloat) heightAdjustLimit
{
return 0;
return 0.0;
}
- (BOOL) knowsPagesFirst: (int*)firstPageNum last: (int*)lastPageNum
@ -4143,9 +4143,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
return NSZeroRect;
}
- (float) widthAdjustLimit
- (CGFloat) widthAdjustLimit
{
return 0;
return 0.0;
}
/*
@ -4796,7 +4796,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
return _frame;
}
- (float) boundsRotation
- (CGFloat) boundsRotation
{
if (_boundsMatrix != nil)
{
@ -4806,7 +4806,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
return 0.0;
}
- (float) frameRotation
- (CGFloat) frameRotation
{
if (_frameMatrix != nil)
{