theme reorganisation/tidy up

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23586 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-09-22 11:53:40 +00:00
parent f5a8f2e9aa
commit 8bf3cdc94e
24 changed files with 116 additions and 182 deletions

View file

@ -1,3 +1,36 @@
2006-09-22 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Additions/GNUstepGUI/GSDrawFunctions.h:
* Headers/Additions/GNUstepGUI/GSTheme.h:
* Source/GSDrawFunctions.m:
* Source/GSTheme.m:
Renamed file.
* Source/NSBrowser.m:
* Source/NSTableHeaderCell.m:
* Source/GSWindowDecorationView.m:
* Source/NSImageCell.m:
* Source/NSBox.m:
* Source/GNUmakefile:
* Source/NSFormCell.m:
* Source/NSButtonCell.m:
* Source/NSColorWell.m:
* Source/NSColor.m:
* Source/NSMenuItemCell.m:
* Source/GSTitleView.m:
* Source/NSProgressIndicator.m:
* Source/DocMakefile:
* Source/NSComboBoxCell.m:
* Source/NSStepperCell.m:
* Source/NSScrollView.m:
* Source/NSTabView.m:
* Source/NSCell.m:
* Source/NSTableView.m:
* Documentation/GuiAdditions.gsdoc:
Update for rename of 'GSDrawFunctions to GSTheme.
Change all class based access to drawing methods to go via current
instance.
Remove all class based versions of drawing methods.
2006-09-22 Richard Frith-Macdonald <rfm@gnu.org> 2006-09-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSWindowDecorationView.m: Merge in theme branch changes. * Source/GSWindowDecorationView.m: Merge in theme branch changes.

View file

@ -25,7 +25,7 @@
</p> </p>
<list> <list>
<item><uref url="GSDisplayServer.html">GSDisplayServer</uref></item> <item><uref url="GSDisplayServer.html">GSDisplayServer</uref></item>
<item><uref url="GSDrawFunctions.html">GSDrawFunctions</uref></item> <item><uref url="GSTheme.html">GSTheme</uref></item>
<item><uref url="GSHbox.html">GSHbox</uref></item> <item><uref url="GSHbox.html">GSHbox</uref></item>
<item><uref url="GSTable.html">GSTable</uref></item> <item><uref url="GSTable.html">GSTable</uref></item>
<item><uref url="GSVbox.html">GSVbox</uref></item> <item><uref url="GSVbox.html">GSVbox</uref></item>

View file

@ -1,4 +1,4 @@
/** <title>GSDrawFunctions</title> /** <title>GSTheme</title>
<abstract>Useful/configurable drawing functions</abstract> <abstract>Useful/configurable drawing functions</abstract>
@ -26,8 +26,8 @@
Boston, MA 02111 USA. Boston, MA 02111 USA.
*/ */
#ifndef _GNUstep_H_GSDrawFunctions #ifndef _GNUstep_H_GSTheme
#define _GNUstep_H_GSDrawFunctions #define _GNUstep_H_GSTheme
#include <Foundation/NSGeometry.h> #include <Foundation/NSGeometry.h>
// For gradient types // For gradient types
@ -46,7 +46,7 @@ typedef enum {
FillStyleScale, /** The image is scaled to fit */ FillStyleScale, /** The image is scaled to fit */
FillStyleRepeat, /** The image is tiled from bottom left */ FillStyleRepeat, /** The image is tiled from bottom left */
FillStyleCenter /** The image is tiled from the center */ FillStyleCenter /** The image is tiled from the center */
} GSDrawFunctionsFillStyle; } GSThemeFillStyle;
/** Notification sent when a theme has just become active. /** Notification sent when a theme has just become active.
@ -95,7 +95,7 @@ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification;
use the appropriate behavior. use the appropriate behavior.
</p> </p>
*/ */
@interface GSDrawFunctions : NSObject @interface GSTheme : NSObject
{ {
@private @private
NSBundle *_bundle; NSBundle *_bundle;
@ -109,14 +109,14 @@ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification;
* automatically when the user default which specifies the current * automatically when the user default which specifies the current
* theme (GSTheme) is updated. * theme (GSTheme) is updated.
*/ */
+ (void) setTheme: (GSDrawFunctions*)theme; + (void) setTheme: (GSTheme*)theme;
/** /**
* Returns the currently active theme instance. This is the value most * Returns the currently active theme instance. This is the value most
* recently set using +setTheme: or (if none has been set) is a default * recently set using +setTheme: or (if none has been set) is a default
* instance of the base class. * instance of the base class.
*/ */
+ (GSDrawFunctions*) theme; + (GSTheme*) theme;
/** /**
* <p>This method is called automatically when the receiver is made into * <p>This method is called automatically when the receiver is made into
@ -173,7 +173,7 @@ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification;
/** /**
* Theme drawing methods * Theme drawing methods
*/ */
@interface GSDrawFunctions (Drawing) @interface GSTheme (Drawing)
/** /**
* Draws a button frame and background (not its content) for the specified * Draws a button frame and background (not its content) for the specified
@ -202,7 +202,7 @@ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification;
/** /**
* Helper functions for drawing standard items. * Helper functions for drawing standard items.
*/ */
@interface GSDrawFunctions (MidLevelDrawing) @interface GSTheme (MidLevelDrawing)
/** Draw a standard button */ /** Draw a standard button */
- (NSRect) drawButton: (NSRect)border withClip: (NSRect)clip; - (NSRect) drawButton: (NSRect)border withClip: (NSRect)clip;
@ -238,7 +238,7 @@ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification;
* Low level drawiong methods ... themes may use these for drawing, * Low level drawiong methods ... themes may use these for drawing,
* but should not normally override them. * but should not normally override them.
*/ */
@interface GSDrawFunctions (LowLevelDrawing) @interface GSTheme (LowLevelDrawing)
/** /**
* Method to tile the supplied image to fill the horizontal rectangle. * Method to tile the supplied image to fill the horizontal rectangle.
*/ */
@ -269,7 +269,7 @@ withRepeatedImage: (NSImage*)image
- (void) fillRect: (NSRect)rect - (void) fillRect: (NSRect)rect
withTiles: (GSDrawTiles*)tiles withTiles: (GSDrawTiles*)tiles
background: (NSColor*)color background: (NSColor*)color
fillStyle: (GSDrawFunctionsFillStyle)style; fillStyle: (GSThemeFillStyle)style;
/** /**
* Method to tile the supplied image to fill the vertical rectangle. * Method to tile the supplied image to fill the vertical rectangle.
@ -280,30 +280,4 @@ withRepeatedImage: (NSImage*)image
flipped: (BOOL)flipped; flipped: (BOOL)flipped;
@end @end
#endif /* _GNUstep_H_GSTheme */
/**
* Deprecated methods ... do not use
*/
@interface GSDrawFunctions (deprecated)
+ (NSRect) drawButton: (NSRect)border : (NSRect)clip;
+ (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip;
+ (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip;
+ (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip;
+ (NSRect) drawGradientBorder: (NSGradientType)gradientType
inRect: (NSRect)border
withClip: (NSRect)clip;
+ (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip;
+ (NSRect) drawGroove: (NSRect)border : (NSRect)clip;
+ (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip;
+ (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip;
- (NSRect) drawButton: (NSRect)border : (NSRect)clip;
- (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip;
- (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip;
- (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip;
- (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip;
- (NSRect) drawGroove: (NSRect)border : (NSRect)clip;
- (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip;
- (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip;
@end
#endif /* _GNUstep_H_GSDrawFunctions */

View file

@ -148,7 +148,7 @@ NSWorkspace.h
AUTOGSDOC_HEADERS_GUIADD = \ AUTOGSDOC_HEADERS_GUIADD = \
GSDisplayServer.h \ GSDisplayServer.h \
GSDrawFunctions.h \ GSTheme.h \
GSFusedSilica.h \ GSFusedSilica.h \
GSTable.h \ GSTable.h \
GSHbox.h \ GSHbox.h \

View file

@ -177,7 +177,7 @@ GSServicesManager.m \
tiff.m \ tiff.m \
externs.m \ externs.m \
linking.m \ linking.m \
GSDrawFunctions.m \ GSTheme.m \
GSDragView.m \ GSDragView.m \
GSFontInfo.m \ GSFontInfo.m \
GSTable.m \ GSTable.m \
@ -354,7 +354,7 @@ GUI_HEADERS = \
GSVersion.h \ GSVersion.h \
GMAppKit.h \ GMAppKit.h \
GMArchiver.h \ GMArchiver.h \
GSDrawFunctions.h \ GSTheme.h \
GSFontInfo.h \ GSFontInfo.h \
GSMemoryPanel.h \ GSMemoryPanel.h \
GSInfoPanel.h \ GSInfoPanel.h \

View file

@ -1,4 +1,4 @@
/** <title>GSDrawFunctions</title> /** <title>GSTheme</title>
<abstract>Useful/configurable drawing functions</abstract> <abstract>Useful/configurable drawing functions</abstract>
@ -32,7 +32,7 @@
#include "Foundation/NSNull.h" #include "Foundation/NSNull.h"
#include "Foundation/NSPathUtilities.h" #include "Foundation/NSPathUtilities.h"
#include "Foundation/NSUserDefaults.h" #include "Foundation/NSUserDefaults.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
#include "AppKit/NSColor.h" #include "AppKit/NSColor.h"
#include "AppKit/NSColorList.h" #include "AppKit/NSColorList.h"
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
@ -58,7 +58,7 @@ typedef enum {
TileBL = 6, /** Bottom left corner */ TileBL = 6, /** Bottom left corner */
TileBM = 7, /** Bottom middle section */ TileBM = 7, /** Bottom middle section */
TileBR = 8 /** Bottom right corner */ TileBR = 8 /** Bottom right corner */
} GSDrawFunctionsTileOffset; } GSThemeTileOffset;
/** This is a trivial class to hold the nine tiles needed to draw a rectangle /** This is a trivial class to hold the nine tiles needed to draw a rectangle
*/ */
@ -113,7 +113,7 @@ typedef enum {
} }
@end @end
@interface GSDrawFunctions (internal) @interface GSTheme (internal)
/** /**
* Called whenever user defaults are changed ... this checks for the * Called whenever user defaults are changed ... this checks for the
* GSTheme user default and ensures that the specified theme is the * GSTheme user default and ensures that the specified theme is the
@ -131,10 +131,10 @@ typedef enum {
@end @end
@implementation GSDrawFunctions @implementation GSTheme
static GSDrawFunctions *defaultTheme = nil; static GSTheme *defaultTheme = nil;
static GSDrawFunctions *theTheme = nil; static GSTheme *theTheme = nil;
static NSString *theThemeName = nil; static NSString *theThemeName = nil;
static NSMutableDictionary *themes = nil; static NSMutableDictionary *themes = nil;
static NSNull *null = nil; static NSNull *null = nil;
@ -181,7 +181,7 @@ static NSNull *null = nil;
{ {
NSBundle *bundle; NSBundle *bundle;
Class cls; Class cls;
GSDrawFunctions *instance; GSTheme *instance;
NSString *theme; NSString *theme;
if ([aName length] == 0) if ([aName length] == 0)
@ -249,7 +249,7 @@ static NSNull *null = nil;
return YES; return YES;
} }
+ (void) setTheme: (GSDrawFunctions*)theme + (void) setTheme: (GSTheme*)theme
{ {
if (theme == nil) if (theme == nil)
{ {
@ -263,7 +263,7 @@ static NSNull *null = nil;
} }
} }
+ (GSDrawFunctions*) theme + (GSTheme*) theme
{ {
return theTheme; return theTheme;
} }
@ -395,7 +395,7 @@ static NSNull *null = nil;
@end @end
@implementation GSDrawFunctions (Drawing) @implementation GSTheme (Drawing)
- (NSRect) drawButton: (NSRect) frame - (NSRect) drawButton: (NSRect) frame
in: (NSButtonCell*) cell in: (NSButtonCell*) cell
@ -413,19 +413,19 @@ static NSNull *null = nil;
{ {
[[NSColor controlBackgroundColor] set]; [[NSColor controlBackgroundColor] set];
NSRectFill(frame); NSRectFill(frame);
[GSDrawFunctions drawButton: frame : NSZeroRect]; [self drawButton: frame withClip: NSZeroRect];
} }
else if (state == 1) /* highlighted state */ else if (state == 1) /* highlighted state */
{ {
[[NSColor selectedControlColor] set]; [[NSColor selectedControlColor] set];
NSRectFill(frame); NSRectFill(frame);
[GSDrawFunctions drawGrayBezel: frame : NSZeroRect]; [self drawGrayBezel: frame withClip: NSZeroRect];
} }
else if (state == 2) /* pushed state */ else if (state == 2) /* pushed state */
{ {
[[NSColor selectedControlColor] set]; [[NSColor selectedControlColor] set];
NSRectFill(frame); NSRectFill(frame);
[GSDrawFunctions drawGrayBezel: frame : NSZeroRect]; [self drawGrayBezel: frame withClip: NSZeroRect];
interiorFrame interiorFrame
= NSOffsetRect(interiorFrame, 1.0, [view isFlipped] ? 1.0 : -1.0); = NSOffsetRect(interiorFrame, 1.0, [view isFlipped] ? 1.0 : -1.0);
} }
@ -453,7 +453,7 @@ static NSNull *null = nil;
@implementation GSDrawFunctions (MidLevelDrawing) @implementation GSTheme (MidLevelDrawing)
- (NSRect) drawButton: (NSRect)border withClip: (NSRect)clip - (NSRect) drawButton: (NSRect)border withClip: (NSRect)clip
{ {
@ -711,7 +711,7 @@ static NSNull *null = nil;
@implementation GSDrawFunctions (LowLevelDrawing) @implementation GSTheme (LowLevelDrawing)
- (void) fillHorizontalRect: (NSRect)rect - (void) fillHorizontalRect: (NSRect)rect
withImage: (NSImage*)image withImage: (NSImage*)image
@ -782,7 +782,7 @@ withRepeatedImage: (NSImage*)image
- (void) fillRect: (NSRect)rect - (void) fillRect: (NSRect)rect
withTiles: (GSDrawTiles*)tiles withTiles: (GSDrawTiles*)tiles
background: (NSColor*)color background: (NSColor*)color
fillStyle: (GSDrawFunctionsFillStyle)style fillStyle: (GSThemeFillStyle)style
{ {
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
NSSize tls = tiles->rects[TileTL].size; NSSize tls = tiles->rects[TileTL].size;
@ -1026,80 +1026,3 @@ withRepeatedImage: (NSImage*)image
@end @end
@implementation GSDrawFunctions (deprecated)
+ (NSRect) drawButton: (NSRect)border : (NSRect)clip
{
return [[self theme] drawButton: border : clip];
}
+ (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip
{
return [[self theme] drawDarkButton: border : clip];
}
+ (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip
{
return [[self theme] drawDarkBezel: border : clip];
}
+ (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip
{
return [[self theme] drawLightBezel: border : clip];
}
+ (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip
{
return [[self theme] drawWhiteBezel: border : clip];
}
+ (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip
{
return [[self theme] drawGrayBezel: border : clip];
}
+ (NSRect) drawGroove: (NSRect)border : (NSRect)clip
{
return [[self theme] drawGroove: border : clip];
}
+ (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip
{
return [[self theme] drawFramePhoto: border : clip];
}
+ (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
{
return [self drawButton: border withClip: clip];
}
- (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip
{
return [self drawDarkButton: border withClip: clip];
}
- (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip
{
return [self drawDarkBezel: border withClip: clip];
}
- (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip
{
return [self drawLightBezel: border withClip: clip];
}
- (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip
{
return [self drawWhiteBezel: border withClip: clip];
}
- (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip
{
return [self drawGrayBezel: border withClip: clip];
}
- (NSRect) drawGroove: (NSRect)border : (NSRect)clip
{
return [self drawGroove: border withClip: clip];
}
- (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip
{
return [self drawFramePhoto: border withClip: clip];
}
@end

View file

@ -37,7 +37,7 @@
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#include <Foundation/NSRunLoop.h> #include <Foundation/NSRunLoop.h>
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
@implementation GSTitleView @implementation GSTitleView
@ -195,7 +195,7 @@
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
GSDrawFunctions *theme = [GSDrawFunctions theme]; GSTheme *theme = [GSTheme theme];
NSRect workRect = [self bounds]; NSRect workRect = [self bounds];
NSSize titleSize; NSSize titleSize;
NSRectEdge top_left[] = {NSMinXEdge, NSMaxYEdge}; NSRectEdge top_left[] = {NSMinXEdge, NSMaxYEdge};

View file

@ -30,7 +30,7 @@
#include "AppKit/NSColor.h" #include "AppKit/NSColor.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDisplayServer.h" #include "GNUstepGUI/GSDisplayServer.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
struct NSWindow_struct struct NSWindow_struct
@ -218,7 +218,7 @@ struct NSWindow_struct
{ {
if (NSIntersectsRect(rect, contentRect)) if (NSIntersectsRect(rect, contentRect))
{ {
[[GSDrawFunctions theme] drawWindowBackground: contentRect view: self]; [[GSTheme theme] drawWindowBackground: contentRect view: self];
} }
} }

View file

@ -38,7 +38,7 @@
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSTextFieldCell.h" #include "AppKit/NSTextFieldCell.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
#include <math.h> #include <math.h>
@ -445,10 +445,10 @@
NSFrameRect(_border_rect); NSFrameRect(_border_rect);
break; break;
case NSBezelBorder: case NSBezelBorder:
[GSDrawFunctions drawDarkBezel: _border_rect : rect]; [[GSTheme theme] drawDarkBezel: _border_rect withClip: rect];
break; break;
case NSGrooveBorder: case NSGrooveBorder:
[GSDrawFunctions drawGroove: _border_rect : rect]; [[GSTheme theme] drawGroove: _border_rect withClip: rect];
break; break;
} }

View file

@ -52,7 +52,7 @@
#include "AppKit/NSEvent.h" #include "AppKit/NSEvent.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "AppKit/NSBezierPath.h" #include "AppKit/NSBezierPath.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
DEFINE_RINT_IF_MISSING DEFINE_RINT_IF_MISSING
@ -206,7 +206,7 @@ static NSTextFieldCell *titleCell;
return; return;
} }
[GSDrawFunctions drawGrayBezel: cellFrame : NSZeroRect]; [[GSTheme theme] drawGrayBezel: cellFrame withClip: NSZeroRect];
[self drawInteriorWithFrame: cellFrame inView: controlView]; [self drawInteriorWithFrame: cellFrame inView: controlView];
} }
@end @end
@ -2219,7 +2219,7 @@ static NSTextFieldCell *titleCell;
if ((NSIntersectsRect (scrollerBorderRect, rect) == YES) && _window) if ((NSIntersectsRect (scrollerBorderRect, rect) == YES) && _window)
{ {
[GSDrawFunctions drawGrayBezel: scrollerBorderRect : rect]; [[GSTheme theme] drawGrayBezel: scrollerBorderRect withClip: rect];
} }
} }
@ -2230,7 +2230,7 @@ static NSTextFieldCell *titleCell;
float hScrollerWidth = _hasHorizontalScroller ? scrollerWidth : 0; float hScrollerWidth = _hasHorizontalScroller ? scrollerWidth : 0;
// Columns borders // Columns borders
[GSDrawFunctions drawGrayBezel: _bounds : rect]; [[GSTheme theme] drawGrayBezel: _bounds withClip: rect];
[[NSColor blackColor] set]; [[NSColor blackColor] set];
visibleColumns = [self numberOfVisibleColumns]; visibleColumns = [self numberOfVisibleColumns];

View file

@ -51,7 +51,7 @@
#include "AppKit/NSImage.h" #include "AppKit/NSImage.h"
#include "AppKit/NSSound.h" #include "AppKit/NSSound.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
#include "GNUstepGUI/GSNibCompatibility.h" #include "GNUstepGUI/GSNibCompatibility.h"
#include <math.h> #include <math.h>
@ -890,7 +890,7 @@ typedef struct _GSButtonCellFlags
if ((_cell.is_bordered) if ((_cell.is_bordered)
&& (!_shows_border_only_while_mouse_inside || _mouse_inside)) && (!_shows_border_only_while_mouse_inside || _mouse_inside))
{ {
cellFrame = [[GSDrawFunctions theme] cellFrame = [[GSTheme theme]
drawButton: cellFrame in: self view: controlView drawButton: cellFrame in: self view: controlView
style: _bezel_style style: _bezel_style
state: buttonState]; state: buttonState];
@ -902,7 +902,7 @@ typedef struct _GSButtonCellFlags
if (_cell.shows_first_responder if (_cell.shows_first_responder
&& [[controlView window] firstResponder] == controlView) && [[controlView window] firstResponder] == controlView)
{ {
[[GSDrawFunctions theme] drawFocusFrame: cellFrame view: controlView]; [[GSTheme theme] drawFocusFrame: cellFrame view: controlView];
} }
} }

View file

@ -60,7 +60,7 @@
#include "AppKit/NSTextContainer.h" #include "AppKit/NSTextContainer.h"
#include "AppKit/NSView.h" #include "AppKit/NSView.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
static Class colorClass; static Class colorClass;
static Class cellClass; static Class cellClass;
@ -1937,7 +1937,7 @@ static NSColor *shadowCol;
} }
else if (_cell.is_bezeled) else if (_cell.is_bezeled)
{ {
[GSDrawFunctions drawWhiteBezel: cellFrame : NSZeroRect]; [[GSTheme theme] drawWhiteBezel: cellFrame withClip: NSZeroRect];
} }
[self drawInteriorWithFrame: cellFrame inView: controlView]; [self drawInteriorWithFrame: cellFrame inView: controlView];

View file

@ -45,7 +45,7 @@
#include "AppKit/NSImage.h" #include "AppKit/NSImage.h"
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/PSOperators.h" #include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
static Class NSColorClass; static Class NSColorClass;

View file

@ -37,7 +37,7 @@
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSPasteboard.h" #include "AppKit/NSPasteboard.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#include <Foundation/NSNotification.h> #include <Foundation/NSNotification.h>
@ -176,7 +176,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
/* /*
* Draw border. * Draw border.
*/ */
[GSDrawFunctions drawButton: aRect : clipRect]; [[GSTheme theme] drawButton: aRect withClip: clipRect];
/* /*
* Fill in control color. * Fill in control color.
@ -213,7 +213,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
/* /*
* Draw inner frame. * Draw inner frame.
*/ */
[GSDrawFunctions drawGrayBezel: aRect : clipRect]; [[GSTheme theme] drawGrayBezel: aRect withClip: clipRect];
aRect = NSInsetRect(aRect, 2.0, 2.0); aRect = NSInsetRect(aRect, 2.0, 2.0);
} }

View file

@ -50,7 +50,7 @@
#include "AppKit/NSTableColumn.h" #include "AppKit/NSTableColumn.h"
#include "AppKit/NSTableView.h" #include "AppKit/NSTableView.h"
#include "AppKit/NSTextView.h" #include "AppKit/NSTextView.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
static NSNotificationCenter *nc; static NSNotificationCenter *nc;
static const BOOL ForceBrowser = NO; static const BOOL ForceBrowser = NO;

View file

@ -34,7 +34,7 @@
#include "AppKit/NSFont.h" #include "AppKit/NSFont.h"
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSTextFieldCell.h" #include "AppKit/NSTextFieldCell.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
static NSColor *shadowCol; static NSColor *shadowCol;
@ -361,7 +361,10 @@ static NSColor *shadowCol;
} }
else if (_cell.is_bezeled) else if (_cell.is_bezeled)
{ {
NSRect frame = [GSDrawFunctions drawWhiteBezel: borderedFrame : NSZeroRect]; NSRect frame;
frame = [[GSTheme theme] drawWhiteBezel: borderedFrame
withClip: NSZeroRect];
[[NSColor textBackgroundColor] set]; [[NSColor textBackgroundColor] set];
NSRectFill (frame); NSRectFill (frame);
} }

View file

@ -31,7 +31,7 @@
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSImageCell.h" #include "AppKit/NSImageCell.h"
#include "AppKit/NSImage.h" #include "AppKit/NSImage.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
@implementation NSImageCell @implementation NSImageCell
@ -134,16 +134,16 @@
// nada // nada
break; break;
case NSImageFramePhoto: case NSImageFramePhoto:
[GSDrawFunctions drawFramePhoto: cellFrame : NSZeroRect]; [[GSTheme theme] drawFramePhoto: cellFrame withClip: NSZeroRect];
break; break;
case NSImageFrameGrayBezel: case NSImageFrameGrayBezel:
[GSDrawFunctions drawGrayBezel: cellFrame : NSZeroRect]; [[GSTheme theme] drawGrayBezel: cellFrame withClip: NSZeroRect];
break; break;
case NSImageFrameGroove: case NSImageFrameGroove:
[GSDrawFunctions drawGroove: cellFrame : NSZeroRect]; [[GSTheme theme] drawGroove: cellFrame withClip: NSZeroRect];
break; break;
case NSImageFrameButton: case NSImageFrameButton:
[GSDrawFunctions drawButton: cellFrame : NSZeroRect]; [[GSTheme theme] drawButton: cellFrame withClip: NSZeroRect];
break; break;
} }

View file

@ -42,7 +42,7 @@
#include "AppKit/NSMenuItemCell.h" #include "AppKit/NSMenuItemCell.h"
#include "AppKit/NSMenuView.h" #include "AppKit/NSMenuView.h"
#include "AppKit/NSParagraphStyle.h" #include "AppKit/NSParagraphStyle.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
@implementation NSMenuItemCell @implementation NSMenuItemCell
@ -446,11 +446,11 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask)) if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask))
{ {
[GSDrawFunctions drawGrayBezel: cellFrame : NSZeroRect]; [[GSTheme theme] drawGrayBezel: cellFrame withClip: NSZeroRect];
} }
else else
{ {
[GSDrawFunctions drawButton: cellFrame : NSZeroRect]; [[GSTheme theme] drawButton: cellFrame withClip: NSZeroRect];
} }
} }
@ -710,7 +710,8 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
// pushed in buttons contents are displaced to the bottom right 1px // pushed in buttons contents are displaced to the bottom right 1px
if (_cell.is_bordered && (mask & NSPushInCellMask)) if (_cell.is_bordered && (mask & NSPushInCellMask))
{ {
cellFrame = NSOffsetRect(cellFrame, 1., [controlView isFlipped] ? 1. : -1.); cellFrame
= NSOffsetRect(cellFrame, 1., [controlView isFlipped] ? 1. : -1.);
} }
/* /*

View file

@ -27,7 +27,7 @@
#include "AppKit/NSProgressIndicator.h" #include "AppKit/NSProgressIndicator.h"
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
#include "GNUstepGUI/GSNibCompatibility.h" #include "GNUstepGUI/GSNibCompatibility.h"
@implementation NSProgressIndicator @implementation NSProgressIndicator
@ -231,7 +231,7 @@ static NSColor *fillColour = nil;
if (_isBezeled) if (_isBezeled)
{ {
// Calc the inside rect to be drawn // Calc the inside rect to be drawn
r = [GSDrawFunctions drawGrayBezel: _bounds :rect]; r = [[GSTheme theme] drawGrayBezel: _bounds withClip: rect];
} }
else else
r = _bounds; r = _bounds;

View file

@ -40,7 +40,7 @@
#include "AppKit/NSTableView.h" #include "AppKit/NSTableView.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "AppKit/PSOperators.h" #include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
// //
// For nib compatibility, this is used to properly // For nib compatibility, this is used to properly
@ -951,11 +951,11 @@ static float scrollerWidth;
break; break;
case NSBezelBorder: case NSBezelBorder:
[GSDrawFunctions drawGrayBezel: _bounds : rect]; [[GSTheme theme] drawGrayBezel: _bounds : rect];
break; break;
case NSGrooveBorder: case NSGrooveBorder:
[GSDrawFunctions drawGroove: _bounds : rect]; [[GSTheme theme] drawGroove: _bounds : rect];
break; break;
} }

View file

@ -36,7 +36,7 @@
#include "AppKit/NSStepperCell.h" #include "AppKit/NSStepperCell.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
#include "AppKit/PSOperators.h" #include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
// Hard coded values for button sizes // Hard coded values for button sizes
#define STEPPER_WIDTH 15 #define STEPPER_WIDTH 15
@ -144,7 +144,7 @@ static inline NSRect DrawLightButton(NSRect border, NSRect clip)
{ {
/* /*
NSRect highlightRect = NSInsetRect(border, 1., 1.); NSRect highlightRect = NSInsetRect(border, 1., 1.);
[GSDrawFunctions drawButton: border : clip]; [[GSTheme theme] drawButton: border : clip];
return highlightRect; return highlightRect;
*/ */
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,

View file

@ -35,7 +35,7 @@
#include "AppKit/NSTabView.h" #include "AppKit/NSTabView.h"
#include "AppKit/NSTabViewItem.h" #include "AppKit/NSTabViewItem.h"
#include "AppKit/PSOperators.h" #include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
@implementation NSTabView @implementation NSTabView
@ -365,7 +365,7 @@
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
GSDrawFunctions *theme = [GSDrawFunctions theme]; GSTheme *theme = [GSTheme theme];
int howMany = [_items count]; int howMany = [_items count];
int i; int i;
NSRect previousRect = NSMakeRect(0, 0, 0, 0); NSRect previousRect = NSMakeRect(0, 0, 0, 0);

View file

@ -26,7 +26,7 @@
#include "AppKit/NSTableHeaderCell.h" #include "AppKit/NSTableHeaderCell.h"
#include "AppKit/NSColor.h" #include "AppKit/NSColor.h"
#include "AppKit/NSFont.h" #include "AppKit/NSFont.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
@implementation NSTableHeaderCell @implementation NSTableHeaderCell
{ {
@ -66,11 +66,11 @@
if (_cell.is_highlighted == YES) if (_cell.is_highlighted == YES)
{ {
[GSDrawFunctions drawButton: cellFrame : cellFrame]; [[GSTheme theme] drawButton: cellFrame withClip: cellFrame];
} }
else else
{ {
[GSDrawFunctions drawDarkButton: cellFrame : cellFrame]; [[GSTheme theme] drawDarkButton: cellFrame withClip: cellFrame];
} }
[self drawInteriorWithFrame: cellFrame inView: controlView]; [self drawInteriorWithFrame: cellFrame inView: controlView];

View file

@ -59,7 +59,7 @@
#include "AppKit/NSPasteboard.h" #include "AppKit/NSPasteboard.h"
#include "AppKit/NSDragging.h" #include "AppKit/NSDragging.h"
#include "AppKit/NSCustomImageRep.h" #include "AppKit/NSCustomImageRep.h"
#include "GNUstepGUI/GSDrawFunctions.h" #include "GNUstepGUI/GSTheme.h"
#include <math.h> #include <math.h>
static NSNotificationCenter *nc = nil; static NSNotificationCenter *nc = nil;
@ -1928,7 +1928,7 @@ static void computeNewSelection
[[NSColor blackColor] set]; [[NSColor blackColor] set];
NSRectFill (divide); NSRectFill (divide);
rect = [GSDrawFunctions drawDarkButton: rect :aRect]; rect = [[GSTheme theme] drawDarkButton: rect withClip: aRect];
[[NSColor controlShadowColor] set]; [[NSColor controlShadowColor] set];
NSRectFill (rect); NSRectFill (rect);
} }