mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
Small theme update, plus documentation fixes and tweaks to avoid warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28538 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d82dad9351
commit
452ffee567
22 changed files with 235 additions and 158 deletions
32
ChangeLog
32
ChangeLog
|
@ -1,3 +1,35 @@
|
|||
2009-08-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSTheme.m:
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||
Add methods for changing the classes used for loading images and
|
||||
color lists so that themes may dynamically update both in response
|
||||
to external events (eg. integration with a native theming mechanism
|
||||
of the system the application is running on).
|
||||
* Source/NSBrowser.m:
|
||||
* Source/NSSound.m:
|
||||
* Source/GSDisplayServer.m:
|
||||
* Source/NSParagraphStyle.m:
|
||||
* Source/NSAttributedString.m:
|
||||
* Source/NSFontManager.m:
|
||||
* Source/NSButtonCell.m:
|
||||
* Source/NSColor.m:
|
||||
* Source/NSToolbar.m:
|
||||
* Source/NSFont.m:
|
||||
* Source/NSTabViewItem.m:
|
||||
* Source/NSDocumentController.m:
|
||||
* Source/NSTableView.m:
|
||||
* Source/NSView.m:
|
||||
* Source/NSDocument.m:
|
||||
* Documentation/GuiUser/DefaultsSummary.gsdoc:
|
||||
* Headers/AppKit/NSAttributedString.h:
|
||||
* Headers/AppKit/NSButtonCell.h:
|
||||
* Headers/AppKit/NSBitmapImageRep.h:
|
||||
Fix argument name/type info for documentation, plus a markup error,
|
||||
plus minor syntax errors reported by autogsdoc (semicolon within a
|
||||
method implementation ... gcc is sloppy and ignores it, but clang may
|
||||
be stricter ... best to fix).
|
||||
|
||||
2009-08-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSAttributedString.m (-fixFontAttributeInRange:): Fix
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
begin with a dot ('.') are not shown in the NSSavePanel or
|
||||
NSOpenPanel.
|
||||
</p>
|
||||
</desc>
|
||||
<term>GSUseGhostResize</term>
|
||||
<desc>
|
||||
<p>
|
||||
|
@ -107,6 +108,7 @@
|
|||
uses a 'ghost' bar to show resizing instead of doing a live
|
||||
resizing of the views.
|
||||
</p>
|
||||
</desc>
|
||||
<term>GSHelpViewer</term>
|
||||
<desc>
|
||||
<p>
|
||||
|
|
|
@ -318,6 +318,18 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
|||
*/
|
||||
- (NSBundle*) bundle;
|
||||
|
||||
/**
|
||||
* Returns the class used by the theme for loading color lists. The default
|
||||
* implementation returns the NSColorList class, but a subclass may override
|
||||
* this to return a color list class whose values change dynamically in
|
||||
* response to changes of a native theming API for instance.<br />
|
||||
* The class returned by this method should be NSColorList or one of its
|
||||
* subclasses. Subclasses should note that GSTheme will initialise the
|
||||
* instances of the class using the [NSColerList-initWithName:fromFile:]
|
||||
* method.
|
||||
*/
|
||||
- (Class) colorClass;
|
||||
|
||||
/**
|
||||
* This returns the color for drawing the item whose name is aName in
|
||||
* the specified state. If aName is nil or if there is no color defined
|
||||
|
@ -356,6 +368,19 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
|||
*/
|
||||
- (NSImage*) icon;
|
||||
|
||||
/**
|
||||
* Returns the class used by the theme for loading images. The default
|
||||
* implementation returns the NSImage class, but a subclass may override
|
||||
* this to return an image class whose instances dynamically alter what
|
||||
* they draw in response to changes of a native theming API for instance.<br />
|
||||
* This method must return the NSImage class or one of its subclasses.
|
||||
* Subclass implementations should note that instances will be initialised
|
||||
* using the [NSImage-initWithContentsOfFile:] method and will use the
|
||||
* [NSImage-imageFileTypes] method to determine which image files can be
|
||||
* loaded.
|
||||
*/
|
||||
- (Class) imageClass;
|
||||
|
||||
/** <init />
|
||||
* Initialise an instance of a theme with the specified resource bundle.<br />
|
||||
* You don't need to call this method directly, but if you are subclassing
|
||||
|
|
|
@ -190,7 +190,7 @@ enum
|
|||
- (BOOL) containsAttachments;
|
||||
- (NSDictionary*) fontAttributesInRange: (NSRange)range;
|
||||
- (NSDictionary*) rulerAttributesInRange: (NSRange)range;
|
||||
- (unsigned) lineBreakBeforeIndex: (unsigned)location
|
||||
- (unsigned) lineBreakBeforeIndex: (NSUInteger)location
|
||||
withinRange: (NSRange)aRange;
|
||||
- (NSRange) doubleClickAtIndex: (unsigned)location;
|
||||
- (unsigned) nextWordFromIndex: (unsigned)location forward: (BOOL)isForward;
|
||||
|
@ -232,7 +232,7 @@ enum
|
|||
options: (NSDictionary *)options
|
||||
documentAttributes: (NSDictionary **)dict;
|
||||
|
||||
- (unsigned) lineBreakByHyphenatingBeforeIndex: (unsigned)location
|
||||
- (unsigned) lineBreakByHyphenatingBeforeIndex: (NSUInteger)location
|
||||
withinRange: (NSRange)aRange;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
|
|
|
@ -150,8 +150,8 @@ APPKIT_EXPORT NSString *NSImageEXIFData; // No GNUstep support yet; for reading
|
|||
- (id) initWithBitmapDataPlanes: (unsigned char**)planes
|
||||
pixelsWide: (int)width
|
||||
pixelsHigh: (int)height
|
||||
bitsPerSample: (int)bps
|
||||
samplesPerPixel: (int)spp
|
||||
bitsPerSample: (int)bitsPerSample
|
||||
samplesPerPixel: (int)samplesPerPixel
|
||||
hasAlpha: (BOOL)alpha
|
||||
isPlanar: (BOOL)isPlanar
|
||||
colorSpaceName: (NSString*)colorSpaceName
|
||||
|
|
|
@ -142,20 +142,20 @@ typedef enum _NSGradientType {
|
|||
// Setting the Titles
|
||||
//
|
||||
- (NSString *)alternateTitle;
|
||||
- (void)setAlternateTitle:(NSString *)aString;
|
||||
- (void)setFont:(NSFont *)fontObject;
|
||||
- (void)setTitle:(NSString *)aString;
|
||||
- (void)setAlternateTitle: (NSString *)aString;
|
||||
- (void)setFont: (NSFont *)fontObject;
|
||||
- (void)setTitle: (NSString *)aString;
|
||||
- (NSString *)title;
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (NSAttributedString *)attributedAlternateTitle;
|
||||
- (NSAttributedString *)attributedTitle;
|
||||
- (void)setAttributedAlternateTitle:(NSAttributedString *)aString;
|
||||
- (void)setAttributedTitle:(NSAttributedString *)aString;
|
||||
- (void)setTitleWithMnemonic:(NSString *)aString;
|
||||
- (void)setAttributedAlternateTitle: (NSAttributedString *)aString;
|
||||
- (void)setAttributedTitle: (NSAttributedString *)aString;
|
||||
- (void)setTitleWithMnemonic: (NSString *)aString;
|
||||
- (NSString *)alternateMnemonic;
|
||||
- (unsigned)alternateMnemonicLocation;
|
||||
- (void)setAlternateMnemonicLocation:(unsigned)location;
|
||||
- (void)setAlternateTitleWithMnemonic:(NSString *)aString;
|
||||
- (void)setAlternateMnemonicLocation: (unsigned)location;
|
||||
- (void)setAlternateTitleWithMnemonic: (NSString *)aString;
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -163,16 +163,16 @@ typedef enum _NSGradientType {
|
|||
//
|
||||
- (NSImage *)alternateImage;
|
||||
- (NSCellImagePosition)imagePosition;
|
||||
- (void)setAlternateImage:(NSImage *)anImage;
|
||||
- (void)setImagePosition:(NSCellImagePosition)aPosition;
|
||||
- (void)setAlternateImage: (NSImage *)anImage;
|
||||
- (void)setImagePosition: (NSCellImagePosition)aPosition;
|
||||
|
||||
//
|
||||
// Setting the Repeat Interval
|
||||
//
|
||||
- (void)getPeriodicDelay:(float *)delay
|
||||
interval:(float *)interval;
|
||||
- (void)setPeriodicDelay:(float)delay
|
||||
interval:(float)interval;
|
||||
- (void)getPeriodicDelay: (float *)delay
|
||||
interval: (float *)interval;
|
||||
- (void)setPeriodicDelay: (float)delay
|
||||
interval: (float)interval;
|
||||
|
||||
//
|
||||
// Setting the Key Equivalent
|
||||
|
@ -180,53 +180,53 @@ typedef enum _NSGradientType {
|
|||
- (NSString *)keyEquivalent;
|
||||
- (NSFont *)keyEquivalentFont;
|
||||
- (unsigned int)keyEquivalentModifierMask;
|
||||
- (void)setKeyEquivalent:(NSString *)key;
|
||||
- (void)setKeyEquivalentModifierMask:(unsigned int)mask;
|
||||
- (void)setKeyEquivalentFont:(NSFont *)fontObj;
|
||||
- (void)setKeyEquivalentFont:(NSString *)fontName
|
||||
size:(float)fontSize;
|
||||
- (void)setKeyEquivalent: (NSString *)key;
|
||||
- (void)setKeyEquivalentModifierMask: (unsigned int)mask;
|
||||
- (void)setKeyEquivalentFont: (NSFont *)fontObj;
|
||||
- (void)setKeyEquivalentFont: (NSString *)fontName
|
||||
size: (float)fontSize;
|
||||
|
||||
//
|
||||
// Modifying Graphic Attributes
|
||||
//
|
||||
- (BOOL)isTransparent;
|
||||
- (void)setTransparent:(BOOL)flag;
|
||||
- (void)setTransparent: (BOOL)flag;
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (NSBezelStyle)bezelStyle;
|
||||
- (void)setBezelStyle:(NSBezelStyle)bezelStyle;
|
||||
- (void)setBezelStyle: (NSBezelStyle)bezelStyle;
|
||||
- (BOOL)showsBorderOnlyWhileMouseInside;
|
||||
- (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show;
|
||||
- (void)setShowsBorderOnlyWhileMouseInside: (BOOL)show;
|
||||
- (NSGradientType)gradientType;
|
||||
- (void)setGradientType:(NSGradientType)gradientType;
|
||||
- (void)setGradientType: (NSGradientType)gradientType;
|
||||
- (BOOL)imageDimsWhenDisabled;
|
||||
- (void)setImageDimsWhenDisabled:(BOOL)flag;
|
||||
- (void)setImageDimsWhenDisabled: (BOOL)flag;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (NSColor *)backgroundColor;
|
||||
- (void)setBackgroundColor:(NSColor *)color;
|
||||
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)control;
|
||||
- (void)drawImage:(NSImage*)imageToDisplay
|
||||
withFrame:(NSRect)frame
|
||||
inView:(NSView *)control;
|
||||
- (void)drawTitle:(NSAttributedString*)titleToDisplay
|
||||
withFrame:(NSRect)frame
|
||||
inView:(NSView *)control;
|
||||
- (NSColor *) backgroundColor;
|
||||
- (void) setBackgroundColor: (NSColor *)color;
|
||||
- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView*)controlView;
|
||||
- (void) drawImage: (NSImage*)imageToDisplay
|
||||
withFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView;
|
||||
- (void) drawTitle: (NSAttributedString*)titleToDisplay
|
||||
withFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Modifying Graphic Attributes
|
||||
//
|
||||
- (int)highlightsBy;
|
||||
- (void)setHighlightsBy:(int)mask;
|
||||
- (void)setShowsStateBy:(int)mask;
|
||||
- (void)setButtonType:(NSButtonType)buttonType;
|
||||
- (void)setHighlightsBy: (int)mask;
|
||||
- (void)setShowsStateBy: (int)mask;
|
||||
- (void)setButtonType: (NSButtonType)buttonType;
|
||||
- (int)showsStateBy;
|
||||
|
||||
//
|
||||
// Sound
|
||||
//
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (void)setSound:(NSSound *)aSound;
|
||||
- (void)setSound: (NSSound *)aSound;
|
||||
- (NSSound *)sound;
|
||||
#endif
|
||||
|
||||
|
@ -234,8 +234,8 @@ typedef enum _NSGradientType {
|
|||
// Mouse
|
||||
//
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (void)mouseEntered:(NSEvent *)event;
|
||||
- (void)mouseExited:(NSEvent *)event;
|
||||
- (void)mouseEntered: (NSEvent *)event;
|
||||
- (void)mouseExited: (NSEvent *)event;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
|
@ -609,9 +609,9 @@ GSCurrentServer(void)
|
|||
typically by calling [NSGraphicsContext-GSSetDevice:::],
|
||||
although depending on the concrete implmentation, more information
|
||||
than this may need to be exchanged. */
|
||||
- (void) windowdevice: (int) win
|
||||
- (void) windowdevice: (int)winNum
|
||||
{
|
||||
[self setWindowdevice: win forContext: GSCurrentContext()];
|
||||
[self setWindowdevice: winNum forContext: GSCurrentContext()];
|
||||
}
|
||||
|
||||
/** Sets the window device information for the NSGraphicsContext,
|
||||
|
@ -899,7 +899,7 @@ GSCurrentServer(void)
|
|||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (void) setParentWindow: (int)partentWin
|
||||
- (void) setParentWindow: (int)parentWin
|
||||
forChildWindow: (int)childWin
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
|
|
@ -100,6 +100,8 @@ typedef struct {
|
|||
NSMutableSet *owned;
|
||||
NSImage *icon;
|
||||
NSString *name;
|
||||
Class colorClass;
|
||||
Class imageClass;
|
||||
} internal;
|
||||
|
||||
#define _internal ((internal*)_reserved)
|
||||
|
@ -111,6 +113,8 @@ typedef struct {
|
|||
#define _owned _internal->owned
|
||||
#define _icon _internal->icon
|
||||
#define _name _internal->name
|
||||
#define _colorClass _internal->colorClass
|
||||
#define _imageClass _internal->imageClass
|
||||
|
||||
+ (void) defaultsDidChange: (NSNotification*)n
|
||||
{
|
||||
|
@ -298,7 +302,7 @@ typedef struct {
|
|||
* to memory, setting their names so that they are visible to
|
||||
* [NSImage+imageNamed:] and storing them in our local array.
|
||||
*/
|
||||
imageTypes = [NSImage imageFileTypes];
|
||||
imageTypes = [_imageClass imageFileTypes];
|
||||
imagePaths = [_bundle pathsForResourcesOfType: nil
|
||||
inDirectory: @"ThemeImages"];
|
||||
enumerator = [imagePaths objectEnumerator];
|
||||
|
@ -317,7 +321,7 @@ typedef struct {
|
|||
image = [_images objectForKey: imageName];
|
||||
if (image == nil)
|
||||
{
|
||||
image = [[NSImage alloc] initWithContentsOfFile: imagePath];
|
||||
image = [[_imageClass alloc] initWithContentsOfFile: imagePath];
|
||||
if (image != nil)
|
||||
{
|
||||
[_images setObject: image forKey: imageName];
|
||||
|
@ -337,7 +341,7 @@ typedef struct {
|
|||
* in use ... so we remove the name from the old
|
||||
* image and try again.
|
||||
*/
|
||||
old = [NSImage imageNamed: imageName];
|
||||
old = [_imageClass imageNamed: imageName];
|
||||
[old setName: nil];
|
||||
[image setName: imageName];
|
||||
}
|
||||
|
@ -436,6 +440,11 @@ typedef struct {
|
|||
return _bundle;
|
||||
}
|
||||
|
||||
- (Class) colorClass
|
||||
{
|
||||
return [NSColorList class];
|
||||
}
|
||||
|
||||
- (NSColor*) colorNamed: (NSString*)aName
|
||||
state: (GSThemeControlState)elementState
|
||||
cache: (BOOL)useCache
|
||||
|
@ -478,7 +487,7 @@ typedef struct {
|
|||
if (colorsPath != nil)
|
||||
{
|
||||
_extraColors[elementState]
|
||||
= [[NSColorList alloc] initWithName: listName
|
||||
= [[_colorClass alloc] initWithName: listName
|
||||
fromFile: colorsPath];
|
||||
/* If the list is actually empty, we get rid of it to avoid
|
||||
* unnecessary lookups.
|
||||
|
@ -515,7 +524,7 @@ typedef struct {
|
|||
}
|
||||
else
|
||||
{
|
||||
_colors = [[NSColorList alloc] initWithName: @"System"
|
||||
_colors = [[_colorClass alloc] initWithName: @"System"
|
||||
fromFile: colorsPath];
|
||||
}
|
||||
}
|
||||
|
@ -598,12 +607,12 @@ typedef struct {
|
|||
path = [_bundle pathForResource: path ofType: ext];
|
||||
if (path != nil)
|
||||
{
|
||||
_icon = [[NSImage alloc] initWithContentsOfFile: path];
|
||||
_icon = [[_imageClass alloc] initWithContentsOfFile: path];
|
||||
}
|
||||
}
|
||||
if (_icon == nil)
|
||||
{
|
||||
_icon = RETAIN([NSImage imageNamed: @"GNUstep"]);
|
||||
_icon = RETAIN([_imageClass imageNamed: @"GNUstep"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -626,6 +635,11 @@ typedef struct {
|
|||
return _icon;
|
||||
}
|
||||
|
||||
- (Class) imageClass
|
||||
{
|
||||
return [NSImage class];
|
||||
}
|
||||
|
||||
- (id) initWithBundle: (NSBundle*)bundle
|
||||
{
|
||||
GSThemeControlState state;
|
||||
|
@ -643,6 +657,8 @@ typedef struct {
|
|||
ASSIGN(_name,
|
||||
[[[_bundle bundlePath] lastPathComponent] stringByDeletingPathExtension]);
|
||||
|
||||
_colorClass = [self colorClass];
|
||||
_imageClass = [self imageClass];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -781,7 +797,7 @@ typedef struct {
|
|||
}
|
||||
else
|
||||
{
|
||||
image = [[NSImage alloc] initWithContentsOfFile: path];
|
||||
image = [[_imageClass alloc] initWithContentsOfFile: path];
|
||||
if (image != nil)
|
||||
{
|
||||
tiles = [[GSDrawTiles alloc] initWithImage: image
|
||||
|
@ -797,7 +813,7 @@ typedef struct {
|
|||
NSString *imagePath;
|
||||
unsigned count;
|
||||
|
||||
imageTypes = [NSImage imageFileTypes];
|
||||
imageTypes = [_imageClass imageFileTypes];
|
||||
for (count = 0; count < [imageTypes count]; count++)
|
||||
{
|
||||
NSString *ext = [imageTypes objectAtIndex: count];
|
||||
|
@ -807,7 +823,8 @@ typedef struct {
|
|||
inDirectory: @"ThemeTiles"];
|
||||
if (imagePath != nil)
|
||||
{
|
||||
image = [[NSImage alloc] initWithContentsOfFile: imagePath];
|
||||
image
|
||||
= [[_imageClass alloc] initWithContentsOfFile: imagePath];
|
||||
if (image != nil)
|
||||
{
|
||||
tiles = [[GSDrawTiles alloc] initWithImage: image];
|
||||
|
|
|
@ -400,7 +400,7 @@ create_error(int code, NSString* desc)
|
|||
{
|
||||
// FIXME
|
||||
return [self lineBreakBeforeIndex: location
|
||||
withinRange: aRange];
|
||||
withinRange: aRange];
|
||||
}
|
||||
|
||||
- (NSUInteger) lineBreakBeforeIndex: (NSUInteger)location
|
||||
|
|
|
@ -1342,11 +1342,11 @@ static NSTextFieldCell *titleCell;
|
|||
return browserColumn->_width;
|
||||
}
|
||||
|
||||
- (void) setWidth: (float)columnWidth ofColumn: (int)column
|
||||
- (void) setWidth: (float)columnWidth ofColumn: (int)columnIndex
|
||||
{
|
||||
NSBrowserColumn *browserColumn;
|
||||
|
||||
browserColumn = [_browserColumns objectAtIndex: column];
|
||||
browserColumn = [_browserColumns objectAtIndex: columnIndex];
|
||||
|
||||
browserColumn->_width = columnWidth;
|
||||
// FIXME: Send a notifiaction
|
||||
|
|
|
@ -893,19 +893,19 @@ typedef struct _GSButtonCellFlags
|
|||
state: buttonState];
|
||||
}
|
||||
|
||||
- (void) drawImage: (NSImage*)anImage
|
||||
withFrame: (NSRect)aRect
|
||||
- (void) drawImage: (NSImage*)imageToDisplay
|
||||
withFrame: (NSRect)cellFrame
|
||||
inView: (NSView*)controlView
|
||||
{
|
||||
// Draw image
|
||||
if (anImage != nil)
|
||||
if (imageToDisplay != nil)
|
||||
{
|
||||
NSSize size;
|
||||
NSPoint position;
|
||||
|
||||
size = [anImage size];
|
||||
position.x = MAX(NSMidX(aRect) - (size.width / 2.), 0.);
|
||||
position.y = MAX(NSMidY(aRect) - (size.height / 2.), 0.);
|
||||
size = [imageToDisplay size];
|
||||
position.x = MAX(NSMidX(cellFrame) - (size.width / 2.), 0.);
|
||||
position.y = MAX(NSMidY(cellFrame) - (size.height / 2.), 0.);
|
||||
|
||||
/*
|
||||
* Images are always drawn with their bottom-left corner at the origin
|
||||
|
@ -916,19 +916,19 @@ typedef struct _GSButtonCellFlags
|
|||
position.y += size.height;
|
||||
}
|
||||
|
||||
[[GSTheme theme] drawImage: anImage
|
||||
inButtonCell: self
|
||||
withFrame: aRect
|
||||
position: position];
|
||||
[[GSTheme theme] drawImage: imageToDisplay
|
||||
inButtonCell: self
|
||||
withFrame: cellFrame
|
||||
position: position];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) drawTitle: (NSAttributedString*)titleToDisplay
|
||||
withFrame: (NSRect)frame
|
||||
inView: (NSView*)control
|
||||
withFrame: (NSRect)cellFrame
|
||||
inView: (NSView*)controlView
|
||||
{
|
||||
[self _drawAttributedText: titleToDisplay
|
||||
inFrame: frame];
|
||||
inFrame: cellFrame];
|
||||
}
|
||||
|
||||
// Private helper method overridden in subclasses
|
||||
|
|
|
@ -502,7 +502,7 @@ systemColorWithName(NSString *name)
|
|||
}
|
||||
}
|
||||
|
||||
+ (NSControlTint) currentControlTint;
|
||||
+ (NSControlTint) currentControlTint
|
||||
{
|
||||
// FIXME: should be made a system setting
|
||||
return NSBlueControlTint;
|
||||
|
|
|
@ -858,7 +858,7 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
- (BOOL) writeSafelyToURL: (NSURL *)url
|
||||
ofType: (NSString *)type
|
||||
forSaveOperation: (NSSaveOperationType)saveOp
|
||||
forSaveOperation: (NSSaveOperationType)op
|
||||
error: (NSError **)error
|
||||
{
|
||||
NSURL *original = [self fileURL];
|
||||
|
@ -868,15 +868,15 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
if (OVERRIDDEN(writeWithBackupToFile:ofType:saveOperation:))
|
||||
{
|
||||
if (saveOp == NSAutosaveOperation)
|
||||
if (op == NSAutosaveOperation)
|
||||
{
|
||||
saveOp = NSSaveToOperation;
|
||||
op = NSSaveToOperation;
|
||||
}
|
||||
|
||||
*error = nil;
|
||||
return [self writeWithBackupToFile: [url path]
|
||||
ofType: type
|
||||
saveOperation: saveOp];
|
||||
saveOperation: op];
|
||||
}
|
||||
|
||||
if (!isNativeType || (url == nil))
|
||||
|
@ -886,7 +886,7 @@ withContentsOfURL: (NSURL *)url
|
|||
return NO;
|
||||
}
|
||||
|
||||
if (saveOp == NSSaveOperation)
|
||||
if (op == NSSaveOperation)
|
||||
{
|
||||
if ([url isFileURL])
|
||||
{
|
||||
|
@ -910,7 +910,7 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
if (![self writeToURL: url
|
||||
ofType: type
|
||||
forSaveOperation: saveOp
|
||||
forSaveOperation: op
|
||||
originalContentsURL: original
|
||||
error: error])
|
||||
{
|
||||
|
@ -923,18 +923,18 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
attrs = [self fileAttributesToWriteToURL: url
|
||||
ofType: type
|
||||
forSaveOperation: saveOp
|
||||
forSaveOperation: op
|
||||
originalContentsURL: original
|
||||
error: error];
|
||||
[fileManager changeFileAttributes: attrs atPath: [url path]];
|
||||
}
|
||||
|
||||
if (saveOp == NSAutosaveOperation)
|
||||
if (op == NSAutosaveOperation)
|
||||
{
|
||||
[self setAutosavedContentsFileURL: url];
|
||||
[self updateChangeCount: NSChangeAutosaved];
|
||||
}
|
||||
else if (saveOp != NSSaveToOperation)
|
||||
else if (op != NSSaveToOperation)
|
||||
{
|
||||
[self _removeAutosavedContentsFile];
|
||||
[self setFileURL: url];
|
||||
|
@ -989,22 +989,22 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
- (BOOL) writeToURL: (NSURL *)url
|
||||
ofType: (NSString *)type
|
||||
forSaveOperation: (NSSaveOperationType)saveOp
|
||||
forSaveOperation: (NSSaveOperationType)op
|
||||
originalContentsURL: (NSURL *)orig
|
||||
error: (NSError **)error
|
||||
{
|
||||
if (OVERRIDDEN(writeToFile:ofType:originalFile:saveOperation:))
|
||||
{
|
||||
if (saveOp == NSAutosaveOperation)
|
||||
if (op == NSAutosaveOperation)
|
||||
{
|
||||
saveOp = NSSaveToOperation;
|
||||
op = NSSaveToOperation;
|
||||
}
|
||||
|
||||
*error = nil;
|
||||
return [self writeToFile: [url path]
|
||||
ofType: type
|
||||
originalFile: [orig path]
|
||||
saveOperation: saveOp];
|
||||
saveOperation: op];
|
||||
}
|
||||
|
||||
return [self writeToURL: url
|
||||
|
@ -1240,11 +1240,11 @@ originalContentsURL: (NSURL *)orig
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (NSString *) fileNameExtensionForType: (NSString *)type
|
||||
- (NSString *) fileNameExtensionForType: (NSString *)typeName
|
||||
saveOperation: (NSSaveOperationType)saveOperation
|
||||
{
|
||||
NSArray *exts = [[NSDocumentController sharedDocumentController]
|
||||
fileExtensionsFromType: type];
|
||||
fileExtensionsFromType: typeName];
|
||||
|
||||
if ([exts count])
|
||||
return (NSString *)[exts objectAtIndex: 0];
|
||||
|
@ -1312,7 +1312,7 @@ originalContentsURL: (NSURL *)orig
|
|||
contextInfo: printInfo];
|
||||
}
|
||||
|
||||
- (void) runModalPageLayoutWithPrintInfo: (NSPrintInfo *)printInfo
|
||||
- (void) runModalPageLayoutWithPrintInfo: (NSPrintInfo *)info
|
||||
delegate: (id)delegate
|
||||
didRunSelector: (SEL)sel
|
||||
contextInfo: (void *)context
|
||||
|
@ -1322,7 +1322,7 @@ originalContentsURL: (NSURL *)orig
|
|||
pageLayout = [NSPageLayout pageLayout];
|
||||
if ([self preparePageLayout: pageLayout])
|
||||
{
|
||||
[pageLayout beginSheetWithPrintInfo: printInfo
|
||||
[pageLayout beginSheetWithPrintInfo: info
|
||||
modalForWindow: [self windowForSheet]
|
||||
delegate: delegate
|
||||
didEndSelector: sel
|
||||
|
|
|
@ -385,29 +385,29 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) presentError: (NSError *)error
|
||||
- (BOOL) presentError: (NSError *)err
|
||||
{
|
||||
error = [self willPresentError: error];
|
||||
return [NSApp presentError: error];
|
||||
err = [self willPresentError: err];
|
||||
return [NSApp presentError: err];
|
||||
}
|
||||
|
||||
- (void) presentError: (NSError *)error
|
||||
modalForWindow: (NSWindow *)window
|
||||
- (void) presentError: (NSError *)err
|
||||
modalForWindow: (NSWindow *)win
|
||||
delegate: (id)delegate
|
||||
didPresentSelector: (SEL)sel
|
||||
contextInfo: (void *)context
|
||||
{
|
||||
error = [self willPresentError: error];
|
||||
[NSApp presentError: error
|
||||
modalForWindow: window
|
||||
err = [self willPresentError: err];
|
||||
[NSApp presentError: err
|
||||
modalForWindow: win
|
||||
delegate: delegate
|
||||
didPresentSelector: sel
|
||||
contextInfo: context];
|
||||
}
|
||||
|
||||
- (NSError *) willPresentError: (NSError *)error
|
||||
- (NSError *) willPresentError: (NSError *)err
|
||||
{
|
||||
return error;
|
||||
return err;
|
||||
}
|
||||
|
||||
- (NSString*) defaultType
|
||||
|
@ -551,7 +551,7 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
return document;
|
||||
}
|
||||
|
||||
- (id) openUntitledDocumentAndDisplay: (BOOL)display
|
||||
- (id) openUntitledDocumentAndDisplay: (BOOL)flag
|
||||
error: (NSError **)err
|
||||
{
|
||||
NSString *type;
|
||||
|
@ -560,7 +560,7 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
|
||||
if (OVERRIDDEN(openUntitledDocumentOfType:display:))
|
||||
{
|
||||
return [self openUntitledDocumentOfType: type display: display];
|
||||
return [self openUntitledDocumentOfType: type display: flag];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -576,7 +576,7 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
if ([self shouldCreateUI])
|
||||
{
|
||||
[document makeWindowControllers];
|
||||
if (display)
|
||||
if (flag)
|
||||
{
|
||||
[document showWindows];
|
||||
}
|
||||
|
@ -587,13 +587,13 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
}
|
||||
|
||||
- (id) openDocumentWithContentsOfURL: (NSURL *)url
|
||||
display: (BOOL)display
|
||||
display: (BOOL)flag
|
||||
error: (NSError **)err
|
||||
{
|
||||
if (OVERRIDDEN(openDocumentWithContentsOfFile:display:) && [url isFileURL])
|
||||
{
|
||||
return [self openDocumentWithContentsOfFile: [url path]
|
||||
display: display];
|
||||
display: flag];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -628,7 +628,7 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
// remember this document as opened
|
||||
[self noteNewRecentDocumentURL: url];
|
||||
|
||||
if (display && [self shouldCreateUI])
|
||||
if (flag && [self shouldCreateUI])
|
||||
{
|
||||
[document showWindows];
|
||||
}
|
||||
|
|
|
@ -988,14 +988,15 @@ static BOOL flip_hack;
|
|||
[self setInContext: GSCurrentContext()];
|
||||
}
|
||||
|
||||
- (void) setInContext: (NSGraphicsContext*)ctxt
|
||||
- (void) setInContext: (NSGraphicsContext*)context
|
||||
{
|
||||
if (matrixExplicitlySet == NO && ([[NSView focusView] isFlipped] || flip_hack))
|
||||
[ctxt GSSetFont: [[self _flippedViewFont] fontRef]];
|
||||
if (matrixExplicitlySet == NO
|
||||
&& ([[NSView focusView] isFlipped] || flip_hack))
|
||||
[context GSSetFont: [[self _flippedViewFont] fontRef]];
|
||||
else
|
||||
[ctxt GSSetFont: [self fontRef]];
|
||||
[context GSSetFont: [self fontRef]];
|
||||
|
||||
[ctxt useFont: fontName];
|
||||
[context useFont: fontName];
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -1035,7 +1035,7 @@ static Class fontPanelClass = Nil;
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) removeCollection:(NSString *) collection;
|
||||
- (BOOL) removeCollection:(NSString *) collection
|
||||
{
|
||||
if ([_collections objectForKey: collection])
|
||||
{
|
||||
|
|
|
@ -66,48 +66,48 @@
|
|||
location: (float)loc
|
||||
options: (NSDictionary *)options
|
||||
{
|
||||
NSTextTabType type;
|
||||
NSTextTabType type;
|
||||
|
||||
switch (align)
|
||||
{
|
||||
default:
|
||||
case NSLeftTextAlignment:
|
||||
type = NSLeftTabStopType;
|
||||
break;
|
||||
case NSRightTextAlignment:
|
||||
if ([options objectForKey: NSTabColumnTerminatorsAttributeName] != nil)
|
||||
{
|
||||
type = NSDecimalTabStopType;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = NSRightTabStopType;
|
||||
}
|
||||
break;
|
||||
case NSCenterTextAlignment:
|
||||
type = NSCenterTabStopType;
|
||||
break;
|
||||
case NSJustifiedTextAlignment:
|
||||
type = NSLeftTabStopType;
|
||||
break;
|
||||
case NSNaturalTextAlignment:
|
||||
// FIXME: Get from language user setting
|
||||
type = YES ? NSLeftTabStopType : NSRightTabStopType;
|
||||
break;
|
||||
default:
|
||||
case NSLeftTextAlignment:
|
||||
type = NSLeftTabStopType;
|
||||
break;
|
||||
case NSRightTextAlignment:
|
||||
if ([options objectForKey: NSTabColumnTerminatorsAttributeName] != nil)
|
||||
{
|
||||
type = NSDecimalTabStopType;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = NSRightTabStopType;
|
||||
}
|
||||
break;
|
||||
case NSCenterTextAlignment:
|
||||
type = NSCenterTabStopType;
|
||||
break;
|
||||
case NSJustifiedTextAlignment:
|
||||
type = NSLeftTabStopType;
|
||||
break;
|
||||
case NSNaturalTextAlignment:
|
||||
// FIXME: Get from language user setting
|
||||
type = YES ? NSLeftTabStopType : NSRightTabStopType;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((self = [self initWithType: type location: loc]))
|
||||
{
|
||||
if ((self = [self initWithType: type location: loc]))
|
||||
{
|
||||
_alignment = align;
|
||||
ASSIGN(_options, options);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc;
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_options);
|
||||
[super dealloc];
|
||||
RELEASE(_options);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone*)aZone
|
||||
|
@ -414,27 +414,27 @@ static NSParagraphStyle *defaultStyle = nil;
|
|||
return _paragraphSpacingBefore;
|
||||
}
|
||||
|
||||
- (int) headerLevel;
|
||||
- (int) headerLevel
|
||||
{
|
||||
return _headerLevel;
|
||||
}
|
||||
|
||||
- (float) hyphenationFactor;
|
||||
- (float) hyphenationFactor
|
||||
{
|
||||
return _hyphenationFactor;
|
||||
}
|
||||
|
||||
- (NSArray *) textBlocks;
|
||||
- (NSArray *) textBlocks
|
||||
{
|
||||
return _textBlocks;
|
||||
}
|
||||
|
||||
- (NSArray *) textLists;
|
||||
- (NSArray *) textLists
|
||||
{
|
||||
return _textLists;
|
||||
}
|
||||
|
||||
- (float) tighteningFactorForTruncation;
|
||||
- (float) tighteningFactorForTruncation
|
||||
{
|
||||
return _tighteningFactorForTruncation;
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ static inline void _loadNSSoundPlugIns (void)
|
|||
return [self initWithData: [NSData dataWithContentsOfURL: url]];
|
||||
}
|
||||
|
||||
- (id) initWithData: (NSData *)data;
|
||||
- (id) initWithData: (NSData *)data
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
Class sourceClass,
|
||||
|
@ -444,7 +444,7 @@ static inline void _loadNSSoundPlugIns (void)
|
|||
[_playbackLock unlock];
|
||||
}
|
||||
|
||||
- (NSTimeInterval) currentTime;
|
||||
- (NSTimeInterval) currentTime
|
||||
{
|
||||
return [_source currentTime];
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ static inline void _loadNSSoundPlugIns (void)
|
|||
[_readLock unlock];
|
||||
}
|
||||
|
||||
- (BOOL) loops;
|
||||
- (BOOL) loops
|
||||
{
|
||||
return _shouldLoop;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString*) description;
|
||||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@: %@ (ident: %@)",
|
||||
NSStringFromClass([self class]), _label, _ident];
|
||||
|
|
|
@ -5532,7 +5532,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
- (NSImage *) dragImageForRowsWithIndexes: (NSIndexSet*)rows
|
||||
tableColumns: (NSArray*)cols
|
||||
event: (NSEvent*)event
|
||||
offset: (NSPoint*)offset;
|
||||
offset: (NSPoint*)offset
|
||||
{
|
||||
// FIXME
|
||||
NSArray *rowArray;
|
||||
|
|
|
@ -775,7 +775,7 @@ static GSValidationCenter *vc = nil;
|
|||
[self _build];
|
||||
}
|
||||
|
||||
- (void) setSelectedItemIdentifier: (NSString *)itemIdentifier
|
||||
- (void) setSelectedItemIdentifier: (NSString *)identifier
|
||||
{
|
||||
NSArray *selectedItems;
|
||||
NSArray *itemsToSelect;
|
||||
|
@ -815,7 +815,7 @@ static GSValidationCenter *vc = nil;
|
|||
return;
|
||||
}
|
||||
|
||||
itemsToSelect = [_items objectsWithValue: itemIdentifier
|
||||
itemsToSelect = [_items objectsWithValue: identifier
|
||||
forKey: @"_itemIdentifier"];
|
||||
e = [itemsToSelect objectEnumerator];
|
||||
while ((item = [e nextObject]) != nil)
|
||||
|
@ -830,7 +830,7 @@ static GSValidationCenter *vc = nil;
|
|||
|
||||
if (updated)
|
||||
{
|
||||
ASSIGN(_selectedItemIdentifier, itemIdentifier);
|
||||
ASSIGN(_selectedItemIdentifier, identifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2197,7 +2197,7 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
|||
return [self lockFocusIfCanDrawInContext: nil];
|
||||
}
|
||||
|
||||
- (BOOL) lockFocusIfCanDrawInContext: (NSGraphicsContext *)context;
|
||||
- (BOOL) lockFocusIfCanDrawInContext: (NSGraphicsContext *)context
|
||||
{
|
||||
if ([self canDraw])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue