mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Make drawing methods go via theme engine.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22080 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
296fd73286
commit
4389009b89
3 changed files with 89 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-11-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSDrawFunctions.h:
|
||||
* Source/GSDrawFunctions.h:
|
||||
Make drawing methods go via theme engine.
|
||||
|
||||
2005-11-22 fabien <fabien@sonappart.net>
|
||||
|
||||
* Source/NSCell.m : Improved documentation
|
||||
|
|
|
@ -51,6 +51,19 @@
|
|||
inRect: (NSRect)border
|
||||
withClip: (NSRect)clip;
|
||||
|
||||
- (NSRect) drawButton: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawGroove: (NSRect)border : (NSRect)clip;
|
||||
- (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip;
|
||||
|
||||
- (NSRect) drawGradientBorder: (NSGradientType)gradientType
|
||||
inRect: (NSRect)border
|
||||
withClip: (NSRect)clip;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* _GNUstep_H_GSDrawFunctions */
|
||||
|
|
|
@ -50,13 +50,14 @@
|
|||
*/
|
||||
@implementation GSDrawFunctions
|
||||
|
||||
static id theTheme;
|
||||
static id theTheme = nil;
|
||||
|
||||
|
||||
+ (id) theme
|
||||
{
|
||||
if (theTheme == nil)
|
||||
{
|
||||
theTheme = [GSDrawFunctions new];
|
||||
theTheme = [self new];
|
||||
}
|
||||
return theTheme;
|
||||
}
|
||||
|
@ -66,8 +67,66 @@ static id theTheme;
|
|||
ASSIGN (theTheme, aTheme);
|
||||
}
|
||||
|
||||
/** Draw a button border */
|
||||
/** Tell current theme to draw a button border */
|
||||
+ (NSRect) drawButton: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawButton: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a "dark" button border (used in tableviews) */
|
||||
+ (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawDarkButton: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a dark bezel border */
|
||||
+ (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawDarkBezel: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a light bezel border */
|
||||
+ (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawLightBezel: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a white bezel border */
|
||||
+ (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawWhiteBezel: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a grey bezel border */
|
||||
+ (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawGrayBezel: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a groove border */
|
||||
+ (NSRect) drawGroove: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawGroove: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a frame photo border. Used in NSImageView. */
|
||||
+ (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawFramePhoto: border : clip];
|
||||
}
|
||||
|
||||
/** Tell current theme to draw a gradient border. */
|
||||
+ (NSRect) drawGradientBorder: (NSGradientType)gradientType
|
||||
inRect: (NSRect)border
|
||||
withClip: (NSRect)clip
|
||||
{
|
||||
return [[self theme] drawGradientBorder: gradientType
|
||||
inRect: border
|
||||
withClip: clip];
|
||||
}
|
||||
|
||||
|
||||
- (NSRect) drawButton: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
||||
NSMinXEdge, NSMaxYEdge,
|
||||
|
@ -93,7 +152,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a "dark" button border (used in tableviews) */
|
||||
+ (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
||||
NSMinXEdge, NSMaxYEdge};
|
||||
|
@ -115,7 +174,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a dark bezel border */
|
||||
+ (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge};
|
||||
|
@ -150,7 +209,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a light bezel border */
|
||||
+ (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||
|
@ -174,7 +233,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a white bezel border */
|
||||
+ (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge,
|
||||
NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge};
|
||||
|
@ -198,7 +257,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a grey bezel border */
|
||||
+ (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||
|
@ -231,7 +290,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a groove border */
|
||||
+ (NSRect) drawGroove: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawGroove: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
// go clockwise from the top twice -- makes the groove come out right
|
||||
NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge,
|
||||
|
@ -255,7 +314,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a frame photo border. Used in NSImageView. */
|
||||
+ (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip
|
||||
- (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
||||
NSMinXEdge, NSMaxYEdge,
|
||||
|
@ -280,7 +339,7 @@ static id theTheme;
|
|||
}
|
||||
|
||||
/** Draw a gradient border. */
|
||||
+ (NSRect) drawGradientBorder: (NSGradientType)gradientType
|
||||
- (NSRect) drawGradientBorder: (NSGradientType)gradientType
|
||||
inRect: (NSRect)border
|
||||
withClip: (NSRect)clip
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue