Corrected affine transform struct element names and added some drawing functions.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18288 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2003-12-30 12:42:37 +00:00
parent 5e42f0a8d7
commit 00a5154834
6 changed files with 26 additions and 25 deletions

View file

@ -37,8 +37,8 @@ typedef struct {
float m12; float m12;
float m21; float m21;
float m22; float m22;
float tx; float tX;
float ty; float tY;
} NSAffineTransformStruct; } NSAffineTransformStruct;
@interface NSAffineTransform : NSObject <NSCopying, NSCoding> @interface NSAffineTransform : NSObject <NSCopying, NSCoding>

View file

@ -333,7 +333,7 @@ void NSEraseRect(NSRect aRect)
{ {
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
DPSgsave(ctxt); DPSgsave(ctxt);
DPSsetgray(ctxt, 1.0); DPSsetgray(ctxt, NSWhite);
NSRectFill(aRect); NSRectFill(aRect);
DPSgrestore(ctxt); DPSgrestore(ctxt);
} }
@ -456,7 +456,7 @@ void NSDottedFrameRect(const NSRect aRect)
float dot_dash[] = {1.0, 1.0}; float dot_dash[] = {1.0, 1.0};
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
DPSsetgray(ctxt, 0.0); DPSsetgray(ctxt, NSBlack);
DPSsetlinewidth(ctxt, 1.0); DPSsetlinewidth(ctxt, 1.0);
// FIXME // FIXME
DPSsetdash(ctxt, dot_dash, 2, 0.0); DPSsetdash(ctxt, dot_dash, 2, 0.0);
@ -673,11 +673,15 @@ NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect)
void void
NSDrawDarkBezel(NSRect aRect, NSRect clipRect) NSDrawDarkBezel(NSRect aRect, NSRect clipRect)
{ {
// FIXME
NSDrawGrayBezel(aRect, clipRect);
} }
void void
NSDrawLightBezel(NSRect aRect, NSRect clipRect) NSDrawLightBezel(NSRect aRect, NSRect clipRect)
{ {
// FIXME
NSDrawWhiteBezel(aRect, clipRect);
} }
void void
@ -715,7 +719,8 @@ NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect)
void void
NSDrawWindowBackground(NSRect aRect) NSDrawWindowBackground(NSRect aRect)
{ {
// TODO [[NSColor windowBackgroundColor] set];
NSRectFill(aRect);
} }
void void

View file

@ -40,8 +40,8 @@
#define B matrix.m12 #define B matrix.m12
#define C matrix.m21 #define C matrix.m21
#define D matrix.m22 #define D matrix.m22
#define TX matrix.tx #define TX matrix.tX
#define TY matrix.ty #define TY matrix.tY
/* A Postscript matrix look like this: /* A Postscript matrix look like this:
@ -100,8 +100,8 @@ static NSAffineTransformStruct identityTransform = {
m[1] = matrix.m12; m[1] = matrix.m12;
m[2] = matrix.m21; m[2] = matrix.m21;
m[3] = matrix.m22; m[3] = matrix.m22;
m[4] = matrix.tx; m[4] = matrix.tX;
m[5] = matrix.ty; m[5] = matrix.tY;
PSconcat(m); PSconcat(m);
} }
@ -515,8 +515,8 @@ static NSAffineTransformStruct identityTransform = {
matrix.m12 = replace[1]; matrix.m12 = replace[1];
matrix.m21 = replace[2]; matrix.m21 = replace[2];
matrix.m22 = replace[3]; matrix.m22 = replace[3];
matrix.tx = replace[4]; matrix.tX = replace[4];
matrix.ty = replace[5]; matrix.tY = replace[5];
} }
- (void) getMatrix: (float[6])replace - (void) getMatrix: (float[6])replace
@ -525,8 +525,8 @@ static NSAffineTransformStruct identityTransform = {
replace[1] = matrix.m12; replace[1] = matrix.m12;
replace[2] = matrix.m21; replace[2] = matrix.m21;
replace[3] = matrix.m22; replace[3] = matrix.m22;
replace[4] = matrix.tx; replace[4] = matrix.tX;
replace[5] = matrix.ty; replace[5] = matrix.tY;
} }
- (void) takeMatrixFromTransform: (NSAffineTransform *)aTransform - (void) takeMatrixFromTransform: (NSAffineTransform *)aTransform
@ -535,8 +535,8 @@ static NSAffineTransformStruct identityTransform = {
matrix.m12 = aTransform->matrix.m12; matrix.m12 = aTransform->matrix.m12;
matrix.m21 = aTransform->matrix.m21; matrix.m21 = aTransform->matrix.m21;
matrix.m22 = aTransform->matrix.m22; matrix.m22 = aTransform->matrix.m22;
matrix.tx = aTransform->matrix.tx; matrix.tX = aTransform->matrix.tX;
matrix.ty = aTransform->matrix.ty; matrix.tY = aTransform->matrix.tY;
} }

View file

@ -1057,7 +1057,7 @@ scaleRect(NSRect rect, double scale)
DPSscale(ctxt, scale, scale); DPSscale(ctxt, scale, scale);
if ([self isFlipped]) if ([self isFlipped])
{ {
NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, 1 }; NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, NSHeight(_bounds) };
NSAffineTransform *matrix, *flip; NSAffineTransform *matrix, *flip;
flip = [NSAffineTransform new]; flip = [NSAffineTransform new];
matrix = [NSAffineTransform new]; matrix = [NSAffineTransform new];
@ -1069,7 +1069,6 @@ scaleRect(NSRect rect, double scale)
* the origin by the height of the view. * the origin by the height of the view.
*/ */
[flip setTransformStruct: ats]; [flip setTransformStruct: ats];
flip->matrix.ty = NSHeight(_bounds);
[matrix appendTransform: flip]; [matrix appendTransform: flip];
[matrix concat]; [matrix concat];
yoffset = NSHeight(_frame) - NSMaxY(pageRect); yoffset = NSHeight(_frame) - NSMaxY(pageRect);

View file

@ -40,7 +40,6 @@
#include "AppKit/NSApplication.h" #include "AppKit/NSApplication.h"
#include "AppKit/NSColor.h" #include "AppKit/NSColor.h"
#include "AppKit/NSScrollView.h" #include "AppKit/NSScrollView.h"
#include "AppKit/DPSOperators.h"
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
@interface NSTableView (GNUstepPrivate) @interface NSTableView (GNUstepPrivate)
@ -238,12 +237,10 @@
{ {
NSGraphicsContext *ctxt = GSCurrentContext(); NSRectEdge up_sides[] = {NSMinYEdge, NSMaxXEdge};
DPSsetgray(ctxt, NSBlack); float grays[] = {NSBlack, NSBlack};
DPSrectfill(ctxt,_bounds.origin.x, _bounds.origin.y,
_bounds.size.width, 1.); NSDrawTiledRects(_bounds, aRect, up_sides, grays, 2);
DPSrectfill(ctxt, NSMaxX(_bounds)-1., NSMinY(_bounds),
1., _bounds.size.height);
} }
} }

View file

@ -3996,7 +3996,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
* exactly overlays the original. To do that, we must translate * exactly overlays the original. To do that, we must translate
* the origin by the height of the view. * the origin by the height of the view.
*/ */
flip->matrix.ty = _frame.size.height; flip->matrix.tY = _frame.size.height;
(*appImp)(_matrixToWindow, appSel, flip); (*appImp)(_matrixToWindow, appSel, flip);
} }
(*appImp)(_matrixToWindow, appSel, _boundsMatrix); (*appImp)(_matrixToWindow, appSel, _boundsMatrix);