diff --git a/ChangeLog b/ChangeLog index fcf511c0d..c8f01366d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-11-08 Laurent Julliard + * 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 * Source/NSTableView.m [- sizeToFit]: replaced floorf with floor suggestion from Stephen Brandon diff --git a/Headers/gnustep/gui/NSGraphics.h b/Headers/gnustep/gui/NSGraphics.h index 16c129a8d..c14958e41 100644 --- a/Headers/gnustep/gui/NSGraphics.h +++ b/Headers/gnustep/gui/NSGraphics.h @@ -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 diff --git a/Source/Functions.m b/Source/Functions.m index 5ad4cfe02..5851ab398 100644 --- a/Source/Functions.m +++ b/Source/Functions.m @@ -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) { diff --git a/Source/NSImageCell.m b/Source/NSImageCell.m index ea20e7670..6e3ea312c 100644 --- a/Source/NSImageCell.m +++ b/Source/NSImageCell.m @@ -119,7 +119,9 @@ // nada break; case NSImageFramePhoto: - // FIXME + [controlView lockFocus]; + NSDrawFramePhoto(cellFrame, NSZeroRect); + [controlView unlockFocus]; break; case NSImageFrameGrayBezel: [controlView lockFocus];