NSDrawFramePhoto added

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11340 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Laurent Julliard 2001-11-08 13:34:23 +00:00
parent 636dabc0ec
commit 81915f4a3c
4 changed files with 47 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2001-11-08 Laurent Julliard <laurent@julliard-online.org>
* Headers/gnustep/gui/NSGraphics.h
* Source/Functions.m
* Source/NSImageCell.m:
NSDrawFramePhoto added. Needed by the ImageView inspector in Gorm
2001-11-06 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
* Source/NSTableView.m [- sizeToFit]: replaced floorf with floor
suggestion from Stephen Brandon <stephen@brandonitconsulting.co.uk>

View file

@ -164,10 +164,12 @@ NSRectFillListWithGrays(const NSRect *rects,const float *grays,int count)
APPKIT_DECLARE NSRect NSDrawTiledRects(NSRect aRect,const NSRect clipRect,
const NSRectEdge * sides,
const float *grays, int count);
APPKIT_DECLARE void NSDrawButton(const NSRect aRect, const NSRect clipRect);
APPKIT_DECLARE void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect);
APPKIT_DECLARE void NSDrawGroove(const NSRect aRect, const NSRect clipRect);
APPKIT_DECLARE void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect);
APPKIT_EXPORT void NSDrawButton(const NSRect aRect, const NSRect clipRect);
APPKIT_EXPORT void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect);
APPKIT_EXPORT void NSDrawGroove(const NSRect aRect, const NSRect clipRect);
APPKIT_EXPORT void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect);
APPKIT_EXPORT void NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect);
// This is from an old version of the specification
static inline void

View file

@ -547,6 +547,38 @@ NSDrawLightBezel(NSRect aRect, NSRect clipRect)
{
}
void
NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect)
{
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
NSMinXEdge, NSMaxYEdge,
NSMaxXEdge, NSMinYEdge};
NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge,
NSMinXEdge, NSMinYEdge,
NSMaxXEdge, NSMaxYEdge};
float grays[] = {NSDarkGray, NSDarkGray,
NSDarkGray, NSDarkGray,
NSBlack, NSBlack};
NSRect rect;
NSGraphicsContext *ctxt = GSCurrentContext();
if (GSWViewIsFlipped(ctxt) == YES)
{
rect = NSDrawTiledRects(aRect, clipRect,
down_sides, grays, 6);
}
else
{
rect = NSDrawTiledRects(aRect, clipRect,
up_sides, grays, 6);
}
DPSsetgray(ctxt, NSLightGray);
DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect),
NSWidth(rect), NSHeight(rect));
}
void
NSDrawWindowBackground(NSRect aRect)
{

View file

@ -119,7 +119,9 @@
// nada
break;
case NSImageFramePhoto:
// FIXME
[controlView lockFocus];
NSDrawFramePhoto(cellFrame, NSZeroRect);
[controlView unlockFocus];
break;
case NSImageFrameGrayBezel:
[controlView lockFocus];