2005-01-18 14:09 Alexander Malmberg <alexander@malmberg.org>

* Source/Functions.m (NSDottedFrameRect, NSFrameRectWithWidth): Draw
	the frame inside the given rectangle.
	(NSDrawTiledRects): Remove documentation.
	* Headers/AppKit/NSGraphics.h (NSDottedFrameRect, NSFrameRect)
	(NSFrameRectWithWidth, NSDrawTiledRects): Add new documentation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20574 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2005-01-18 13:08:37 +00:00
parent 8a515dba0c
commit 0a62f93891
3 changed files with 37 additions and 23 deletions

View file

@ -1,3 +1,11 @@
2005-01-18 14:09 Alexander Malmberg <alexander@malmberg.org>
* Source/Functions.m (NSDottedFrameRect, NSFrameRectWithWidth): Draw
the frame inside the given rectangle.
(NSDrawTiledRects): Remove documentation.
* Headers/AppKit/NSGraphics.h (NSDottedFrameRect, NSFrameRect)
(NSFrameRectWithWidth, NSDrawTiledRects): Add new documentation.
2005-01-17 Adrian Robert <arobert@cogsci.ucsd.edu>
* Source/NSWindow.m (-sendEvent:becomesKeyOnlyIfNeeded:): Give

View file

@ -1,7 +1,7 @@
/*
NSGraphics.h
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996, 2005 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: February 1997
@ -117,8 +117,12 @@ APPKIT_EXPORT void NSRectFillList(const NSRect *rects, int count);
APPKIT_EXPORT void NSRectFillListWithGrays(const NSRect *rects,
const float *grays,int count);
APPKIT_EXPORT NSRect NSDrawTiledRects(NSRect aRect,const NSRect clipRect,
const NSRectEdge * sides,
/** Draws a set of edges of aRect. The sides array should contain
count edges, and grays the corresponding color. Edges are drawn
in the order given in the array, and subsequent edges are drawn
inside previous edges (thus, they will never overlap). */
APPKIT_EXPORT NSRect NSDrawTiledRects(NSRect aRect, const NSRect clipRect,
const NSRectEdge *sides,
const float *grays, int count);
APPKIT_EXPORT void NSDrawButton(const NSRect aRect, const NSRect clipRect);
@ -134,7 +138,19 @@ NSDrawBezel(const NSRect aRect, const NSRect clipRect)
NSDrawGrayBezel(aRect, clipRect);
}
/** Draws a rectangle along the inside of aRect. The rectangle will be
black, dotted (using 1 point dashes), and will have a line width
of 1 point. */
APPKIT_EXPORT void NSDottedFrameRect(NSRect aRect);
/** <p>Draws a rectangle using the current color along the inside of aRect.
NSFrameRectWithWidth uses the frameWidth as the line width, while
NSFrameRect always uses 1 point wide lines. The functions do not
change the line width of the current graphics context.
</p><p>
'Inside' here means that no part of the stroked rectangle will extend
outside the given rectangle.
</p> */
APPKIT_EXPORT void NSFrameRect(const NSRect aRect);
APPKIT_EXPORT void NSFrameRectWithWidth(const NSRect aRect, float frameWidth);

View file

@ -451,9 +451,9 @@ NSRectFillListWithColorsUsingOperation(const NSRect *rects,
}
}
/*
* Draw a Bordered Rectangle
*/
/* Various functions for drawing bordered rectangles. */
void NSDottedFrameRect(const NSRect aRect)
{
float dot_dash[] = {1.0, 1.0};
@ -463,8 +463,8 @@ void NSDottedFrameRect(const NSRect aRect)
DPSsetlinewidth(ctxt, 1.0);
// FIXME
DPSsetdash(ctxt, dot_dash, 2, 0.0);
DPSrectstroke(ctxt, NSMinX(aRect), NSMinY(aRect),
NSWidth(aRect), NSHeight(aRect));
DPSrectstroke(ctxt, NSMinX(aRect) + 0.5, NSMinY(aRect) + 0.5,
NSWidth(aRect) - 1.0, NSHeight(aRect) - 1.0);
}
void NSFrameRect(const NSRect aRect)
@ -478,25 +478,15 @@ void NSFrameRectWithWidth(const NSRect aRect, float frameWidth)
NSGraphicsContext *ctxt = GSCurrentContext();
DPScurrentlinewidth(ctxt, &width);
DPSsetlinewidth(ctxt, frameWidth);
DPSrectstroke(ctxt, NSMinX(aRect), NSMinY(aRect),
NSWidth(aRect), NSHeight(aRect));
DPSrectstroke(ctxt, NSMinX(aRect) + frameWidth / 2.0,
NSMinY(aRect) + frameWidth / 2.0,
NSWidth(aRect) - frameWidth, NSHeight(aRect) - frameWidth);
DPSsetlinewidth(ctxt, width);
}
//*****************************************************************************
//
// Draws an unfilled rectangle, clipped by clipRect, whose border
// is defined by the parallel arrays sides and grays, both of length
// count. Each element of sides specifies an edge of the rectangle,
// which is drawn with a width of 1.0 using the corresponding gray level
// from grays. If the edges array contains recurrences of the same edge,
// each is inset within the previous edge.
//
//*****************************************************************************
NSRect
NSDrawTiledRects(NSRect aRect,const NSRect clipRect,
const NSRectEdge * sides,
NSDrawTiledRects(NSRect aRect, const NSRect clipRect,
const NSRectEdge *sides,
const float *grays, int count)
{
int i;