mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 00:30:58 +00:00
Tidied method argument naming.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14763 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
76d90272f8
commit
af70a6521a
7 changed files with 193 additions and 132 deletions
|
@ -17,6 +17,8 @@
|
|||
* Source/NSView.m: ditto.
|
||||
* Source/NSToolbar.m: ditto.
|
||||
* Source/NSTextView.m: ditto.
|
||||
* Source/NSMatrix.m: ditto.
|
||||
* Source/NSLayoutManager.m: ditto.
|
||||
|
||||
2002-10-11 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ typedef enum {
|
|||
- (NSArray *) textContainers;
|
||||
|
||||
-(void) addTextContainer: (NSTextContainer *)container;
|
||||
- (void) insertTextContainer: (NSTextContainer *)container
|
||||
- (void) insertTextContainer: (NSTextContainer*)aTextContainer
|
||||
atIndex: (unsigned)index;
|
||||
- (void) removeTextContainerAtIndex: (unsigned)index;
|
||||
|
||||
|
@ -194,7 +194,7 @@ typedef enum {
|
|||
|
||||
- (void) textStorage: (NSTextStorage *)aTextStorage
|
||||
edited: (unsigned)mask
|
||||
range: (NSRange)range
|
||||
range: (NSRange)newCharRange
|
||||
changeInLength: (int)lengthChange
|
||||
invalidatedRange: (NSRange)invalidatedRange;
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ GSCurrentServer(void)
|
|||
|
||||
/** <init />
|
||||
Initializes the server. This typically causes the receiver to
|
||||
<em>connect</em> to the display (e.g. XOpenDisplay() on an X-Windows
|
||||
<em>connect</em> to the display (e.g. XOpenDisplay () on an X-Windows
|
||||
server).
|
||||
*/
|
||||
- (id) initWithAttributes: (NSDictionary *)attributes
|
||||
|
|
|
@ -903,14 +903,14 @@ _GLog(NSLayoutManager *lm, SEL _cmd)
|
|||
/**
|
||||
* Adds a container to the layout manager.
|
||||
*/
|
||||
- (void) addTextContainer: (NSTextContainer*)obj
|
||||
- (void) addTextContainer: (NSTextContainer*)container
|
||||
{
|
||||
if ([_textContainers indexOfObjectIdenticalTo: obj] == NSNotFound)
|
||||
if ([_textContainers indexOfObjectIdenticalTo: container] == NSNotFound)
|
||||
{
|
||||
int i;
|
||||
|
||||
[_textContainers addObject: obj];
|
||||
[obj setLayoutManager: self];
|
||||
[_textContainers addObject: container];
|
||||
[container setLayoutManager: self];
|
||||
// FIXME: Invalidate layout beyond previous last container
|
||||
_textContainersCount++;
|
||||
/* NB: We do not retain this here ! It's already retained in the
|
||||
|
@ -1555,17 +1555,17 @@ _Sane(self);
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the glyph at the specified index.<br />
|
||||
* Returns the glyph at the specified glyphIndex.<br />
|
||||
* Causes any gaps (areas where glyphs have been invalidated) before this
|
||||
* index to be re-filled.<br />
|
||||
* Raises an exception if the index is out of range.
|
||||
* glyphIndex to be re-filled.<br />
|
||||
* Raises an exception if the glyphIndex is out of range.
|
||||
*/
|
||||
- (NSGlyph) glyphAtIndex: (unsigned)index
|
||||
- (NSGlyph) glyphAtIndex: (unsigned)glyphIndex
|
||||
{
|
||||
BOOL flag;
|
||||
NSGlyph glyph;
|
||||
|
||||
glyph = [self glyphAtIndex: index isValidIndex: &flag];
|
||||
glyph = [self glyphAtIndex: glyphIndex isValidIndex: &flag];
|
||||
if (flag == NO)
|
||||
{
|
||||
[NSException raise: NSRangeException
|
||||
|
@ -1575,14 +1575,14 @@ _Sane(self);
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the glyph at the specified index.<br />
|
||||
* Returns the glyph at the specified glyphIndex.<br />
|
||||
* Causes any gaps (areas where glyphs have been invalidated) before this
|
||||
* index to be re-filled.<br />
|
||||
* Sets the flag to indicate whether the index was found ... if it wasn't
|
||||
* glyphIndex to be re-filled.<br />
|
||||
* Sets the flag to indicate whether the glyphIndex was found ... if it wasn't
|
||||
* the returned glyph is meaningless.
|
||||
*/
|
||||
- (NSGlyph) glyphAtIndex: (unsigned)index
|
||||
isValidIndex: (BOOL*)flag
|
||||
- (NSGlyph) glyphAtIndex: (unsigned)glyphIndex
|
||||
isValidIndex: (BOOL*)isValidIndex
|
||||
{
|
||||
#if USE_GLYPHS
|
||||
NSGlyph glyph;
|
||||
|
@ -1591,14 +1591,15 @@ _Sane(self);
|
|||
|
||||
_GLog(self,_cmd);
|
||||
if (GSIArrayCount((GSIArray)_glyphGaps) > 0
|
||||
&& (GSIArrayItemAtIndex((GSIArray)_glyphGaps, 0).ulng) <= index)
|
||||
&& (GSIArrayItemAtIndex((GSIArray)_glyphGaps, 0).ulng) <= glyphIndex)
|
||||
{
|
||||
unsigned long gap;
|
||||
|
||||
string = [_textStorage string];
|
||||
|
||||
while (GSIArrayCount((GSIArray)_glyphGaps) > 0
|
||||
&& (gap = GSIArrayItemAtIndex((GSIArray)_glyphGaps, 0).ulng) <= index)
|
||||
&& (gap = GSIArrayItemAtIndex((GSIArray)_glyphGaps, 0).ulng)
|
||||
<= glyphIndex)
|
||||
{
|
||||
unsigned endChar;
|
||||
unsigned startChar;
|
||||
|
@ -1656,7 +1657,7 @@ _GLog(self,_cmd);
|
|||
}
|
||||
}
|
||||
|
||||
if (index >= _GlyphEnd(self) && _CharEnd(self) < textLength)
|
||||
if (glyphIndex >= _GlyphEnd(self) && _CharEnd(self) < textLength)
|
||||
{
|
||||
unsigned endChar = textLength;
|
||||
unsigned startChar = _CharEnd(self);
|
||||
|
@ -1667,7 +1668,7 @@ _GLog(self,_cmd);
|
|||
string = [_textStorage string];
|
||||
}
|
||||
/* FIXME ... should generate glyphs properly here */
|
||||
while (startChar < endChar && glyphIndex <= index)
|
||||
while (startChar < endChar && glyphIndex <= glyphIndex)
|
||||
{
|
||||
unichar c = [string characterAtIndex: startChar];
|
||||
|
||||
|
@ -1679,48 +1680,49 @@ _GLog(self,_cmd);
|
|||
|
||||
_GLog(self,_cmd);
|
||||
_Sane(self);
|
||||
if (_JumpToGlyph(self, index) == YES)
|
||||
if (_JumpToGlyph(self, glyphIndex) == YES)
|
||||
{
|
||||
*flag = YES;
|
||||
*isValidIndex = YES;
|
||||
glyph = gGlyph(*_Info(self));
|
||||
}
|
||||
else
|
||||
{
|
||||
*flag = NO;
|
||||
*isValidIndex = NO;
|
||||
glyph = NSNullGlyph;
|
||||
}
|
||||
#if ALL_CHECKS
|
||||
if (index >= [_textStorage length])
|
||||
if (glyphIndex >= [_textStorage length])
|
||||
{
|
||||
if (glyph != NSNullGlyph)
|
||||
{
|
||||
missmatch(_cmd);
|
||||
*flag = NO;
|
||||
*isValidIndex = NO;
|
||||
glyph = NSNullGlyph;
|
||||
}
|
||||
}
|
||||
else if (glyph != (NSGlyph)[[_textStorage string] characterAtIndex: index])
|
||||
else if (glyph != (NSGlyph)[[_textStorage string] characterAtIndex:
|
||||
glyphIndex])
|
||||
{
|
||||
missmatch(_cmd);
|
||||
*flag = YES;
|
||||
glyph = (NSGlyph)[[_textStorage string] characterAtIndex: index];
|
||||
*isValidIndex = YES;
|
||||
glyph = (NSGlyph)[[_textStorage string] characterAtIndex: glyphIndex];
|
||||
}
|
||||
#endif
|
||||
return glyph;
|
||||
#else
|
||||
return (NSGlyph)[[_textStorage string] characterAtIndex: index];
|
||||
return (NSGlyph)[[_textStorage string] characterAtIndex: glyphIndex];
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the glyph at index with newGlyph without changing
|
||||
* Replaces the glyph at glyphIndex with newGlyph without changing
|
||||
* character index or other attributes.
|
||||
*/
|
||||
- (void) replaceGlyphAtIndex: (unsigned)index
|
||||
- (void) replaceGlyphAtIndex: (unsigned)glyphIndex
|
||||
withGlyph: (NSGlyph)newGlyph
|
||||
{
|
||||
_GLog(self,_cmd);
|
||||
if (_JumpToGlyph(self, index) == NO)
|
||||
if (_JumpToGlyph(self, glyphIndex) == NO)
|
||||
{
|
||||
[NSException raise: NSRangeException
|
||||
format: @"glyph index out of range"];
|
||||
|
@ -2280,7 +2282,7 @@ _GLog(self,_cmd);
|
|||
* add new attributed, you must replace this method with one which can
|
||||
* store your new attributes.
|
||||
*/
|
||||
- (void) setIntAttribute: (int)attribute
|
||||
- (void) setIntAttribute: (int)attributeTag
|
||||
value: (int)anInt
|
||||
forGlyphAtIndex: (unsigned)glyphIndex
|
||||
{
|
||||
|
@ -2293,7 +2295,7 @@ _GLog(self,_cmd);
|
|||
format: @"glyph index out of range"];
|
||||
}
|
||||
info = *_Info(self);
|
||||
if (attribute == GSGlyphDrawsOutsideLineFragment)
|
||||
if (attributeTag == GSGlyphDrawsOutsideLineFragment)
|
||||
{
|
||||
if (anInt == 0)
|
||||
{
|
||||
|
@ -2304,7 +2306,7 @@ _GLog(self,_cmd);
|
|||
gDrawsOutside(info) = 1;
|
||||
}
|
||||
}
|
||||
else if (attribute == GSGlyphIsNotShown)
|
||||
else if (attributeTag == GSGlyphIsNotShown)
|
||||
{
|
||||
if (anInt == 0)
|
||||
{
|
||||
|
@ -2315,11 +2317,11 @@ _GLog(self,_cmd);
|
|||
gIsNotShown(info) = 1;
|
||||
}
|
||||
}
|
||||
else if (attribute == GSGlyphGeneration)
|
||||
else if (attributeTag == GSGlyphGeneration)
|
||||
{
|
||||
gGeneration(info) = anInt;
|
||||
}
|
||||
else if (attribute == GSGlyphInscription)
|
||||
else if (attributeTag == GSGlyphInscription)
|
||||
{
|
||||
gInscription(info) = anInt;
|
||||
}
|
||||
|
@ -2328,9 +2330,9 @@ _GLog(self,_cmd);
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the value for the attribute at the glyphIndex.
|
||||
* Returns the value for the attributeTag at the glyphIndex.
|
||||
*/
|
||||
- (int) intAttribute: (int)attribute
|
||||
- (int) intAttribute: (int)attributeTag
|
||||
forGlyphAtIndex: (unsigned)glyphIndex
|
||||
{
|
||||
GSIArrayItem info;
|
||||
|
@ -2343,7 +2345,7 @@ _GLog(self,_cmd);
|
|||
}
|
||||
info = *_Info(self);
|
||||
|
||||
if (attribute == GSGlyphDrawsOutsideLineFragment)
|
||||
if (attributeTag == GSGlyphDrawsOutsideLineFragment)
|
||||
{
|
||||
if (gDrawsOutside(info) == 0)
|
||||
{
|
||||
|
@ -2354,7 +2356,7 @@ _GLog(self,_cmd);
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
else if (attribute == GSGlyphIsNotShown)
|
||||
else if (attributeTag == GSGlyphIsNotShown)
|
||||
{
|
||||
if (gIsNotShown(info) == 0)
|
||||
{
|
||||
|
@ -2365,11 +2367,11 @@ _GLog(self,_cmd);
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
else if (attribute == GSGlyphGeneration)
|
||||
else if (attributeTag == GSGlyphGeneration)
|
||||
{
|
||||
return gGeneration(info);
|
||||
}
|
||||
else if (attribute == GSGlyphInscription)
|
||||
else if (attributeTag == GSGlyphInscription)
|
||||
{
|
||||
return gInscription(info);
|
||||
}
|
||||
|
@ -2383,7 +2385,7 @@ _GLog(self,_cmd);
|
|||
/* TODO */
|
||||
}
|
||||
|
||||
- (NSRange) glyphRangeForTextContainer: (NSTextContainer*)aTextContainer
|
||||
- (NSRange) glyphRangeForTextContainer: (NSTextContainer*)container
|
||||
{
|
||||
/* TODO */
|
||||
return NSMakeRange(NSNotFound, 0);
|
||||
|
@ -2412,6 +2414,9 @@ _GLog(self,_cmd);
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (void) setLineFragmentRect: (NSRect)fragmentRect
|
||||
forGlyphRange: (NSRange)glyphRange
|
||||
usedRect: (NSRect)usedRect
|
||||
|
@ -2419,27 +2424,33 @@ _GLog(self,_cmd);
|
|||
/* TODO */
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRect) lineFragmentRectForGlyphAtIndex: (unsigned)glyphIndex
|
||||
effectiveRange: (NSRange*)lineFragmentRange
|
||||
effectiveRange: (NSRange*)effectiveGlyphRange
|
||||
{
|
||||
/* TODO */
|
||||
return NSZeroRect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRect) lineFragmentUsedRectForGlyphAtIndex: (unsigned)glyphIndex
|
||||
effectiveRange: (NSRange*)lineFragmentRange
|
||||
effectiveRange: (NSRange*)effectiveGlyphRange
|
||||
{
|
||||
/* TODO */
|
||||
return NSZeroRect;
|
||||
}
|
||||
|
||||
- (void) setExtraLineFragmentRect: (NSRect)aRect
|
||||
- (void) setExtraLineFragmentRect: (NSRect)fragmentRect
|
||||
usedRect: (NSRect)usedRect
|
||||
textContainer: (NSTextContainer*)aTextContainer
|
||||
textContainer: (NSTextContainer*)container
|
||||
{
|
||||
_extraLineFragmentRect = aRect;
|
||||
_extraLineFragmentRect = fragmentRect;
|
||||
_extraLineFragmentUsedRect = usedRect;
|
||||
_extraLineFragmentContainer = aTextContainer;
|
||||
_extraLineFragmentContainer = container;
|
||||
}
|
||||
|
||||
- (NSRect) extraLineFragmentRect
|
||||
|
@ -2487,42 +2498,60 @@ _GLog(self,_cmd);
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (void) setLocation: (NSPoint)aPoint
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (void) setLocation: (NSPoint)location
|
||||
forStartOfGlyphRange: (NSRange)glyphRange
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSPoint) locationForGlyphAtIndex: (unsigned)glyphIndex
|
||||
{
|
||||
/* TODO */
|
||||
return NSZeroPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRange) rangeOfNominallySpacedGlyphsContainingIndex: (unsigned)glyphIndex
|
||||
{
|
||||
/* TODO */
|
||||
return NSMakeRange(NSNotFound, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRect*) rectArrayForCharacterRange: (NSRange)charRange
|
||||
withinSelectedCharacterRange: (NSRange)selChareRange
|
||||
inTextContainer: (NSTextContainer*)aTextContainer
|
||||
withinSelectedCharacterRange: (NSRange)selCharRange
|
||||
inTextContainer: (NSTextContainer*)container
|
||||
rectCount: (unsigned*)rectCount
|
||||
{
|
||||
/* TODO */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRect*) rectArrayForGlyphRange: (NSRange)glyphRange
|
||||
withinSelectedGlyphRange: (NSRange)selectedGlyphRange
|
||||
inTextContainer: (NSTextContainer*)aTextContainer
|
||||
withinSelectedGlyphRange: (NSRange)selGlyphRange
|
||||
inTextContainer: (NSTextContainer*)container
|
||||
rectCount: (unsigned*)rectCount
|
||||
{
|
||||
/* TODO */
|
||||
return _cachedRectArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRect) boundingRectForGlyphRange: (NSRange)glyphRange
|
||||
inTextContainer: (NSTextContainer*)aTextContainer
|
||||
{
|
||||
|
@ -2530,22 +2559,31 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
|||
return NSZeroRect;
|
||||
}
|
||||
|
||||
- (NSRange) glyphRangeForBoundingRect: (NSRect)aRect
|
||||
inTextContainer: (NSTextContainer*)aTextContainer
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRange) glyphRangeForBoundingRect: (NSRect)bounds
|
||||
inTextContainer: (NSTextContainer*)container
|
||||
{
|
||||
/* TODO */
|
||||
return NSMakeRange(0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (NSRange) glyphRangeForBoundingRectWithoutAdditionalLayout: (NSRect)bounds
|
||||
inTextContainer: (NSTextContainer*)aTextContainer
|
||||
inTextContainer: (NSTextContainer*)container
|
||||
{
|
||||
/* TODO */
|
||||
return NSMakeRange(0, 0);
|
||||
}
|
||||
|
||||
- (unsigned) glyphIndexForPoint: (NSPoint)aPoint
|
||||
inTextContainer: (NSTextContainer*)aTextContainer
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (unsigned) glyphIndexForPoint: (NSPoint)point
|
||||
inTextContainer: (NSTextContainer*)container
|
||||
fractionOfDistanceThroughGlyph: (float*)partialFraction
|
||||
{
|
||||
/* TODO */
|
||||
|
|
|
@ -264,13 +264,13 @@ static SEL getSel;
|
|||
|
||||
- (id) initWithFrame: (NSRect)frameRect
|
||||
mode: (int)aMode
|
||||
cellClass: (Class)class
|
||||
cellClass: (Class)classId
|
||||
numberOfRows: (int)rowsHigh
|
||||
numberOfColumns: (int)colsWide
|
||||
{
|
||||
self = [super initWithFrame: frameRect];
|
||||
|
||||
[self setCellClass: class];
|
||||
[self setCellClass: classId];
|
||||
return [self _privateFrame: frameRect
|
||||
mode: aMode
|
||||
numberOfRows: rowsHigh
|
||||
|
@ -279,13 +279,13 @@ static SEL getSel;
|
|||
|
||||
- (id) initWithFrame: (NSRect)frameRect
|
||||
mode: (int)aMode
|
||||
prototype: (NSCell*)prototype
|
||||
prototype: (NSCell*)aCell
|
||||
numberOfRows: (int)rowsHigh
|
||||
numberOfColumns: (int)colsWide
|
||||
{
|
||||
self = [super initWithFrame: frameRect];
|
||||
|
||||
[self setPrototype: prototype];
|
||||
[self setPrototype: aCell];
|
||||
return [self _privateFrame: frameRect
|
||||
mode: aMode
|
||||
numberOfRows: rowsHigh
|
||||
|
@ -593,9 +593,9 @@ static SEL getSel;
|
|||
[self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]];
|
||||
}
|
||||
|
||||
- (void) removeColumn: (int)col
|
||||
- (void) removeColumn: (int)column
|
||||
{
|
||||
if (col >= 0 && col < _numCols)
|
||||
if (column >= 0 && column < _numCols)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -603,8 +603,8 @@ static SEL getSel;
|
|||
{
|
||||
int j;
|
||||
|
||||
AUTORELEASE(_cells[i][col]);
|
||||
for (j = col + 1; j < _maxCols; j++)
|
||||
AUTORELEASE(_cells[i][column]);
|
||||
for (j = column + 1; j < _maxCols; j++)
|
||||
{
|
||||
_cells[i][j-1] = _cells[i][j];
|
||||
_selectedCells[i][j-1] = _selectedCells[i][j];
|
||||
|
@ -613,12 +613,12 @@ static SEL getSel;
|
|||
_numCols--;
|
||||
_maxCols--;
|
||||
|
||||
if (col == _selectedColumn)
|
||||
if (column == _selectedColumn)
|
||||
{
|
||||
_selectedCell = nil;
|
||||
[self selectCellAtRow: _selectedRow column: 0];
|
||||
}
|
||||
if (col == _dottedColumn)
|
||||
if (column == _dottedColumn)
|
||||
{
|
||||
if (_numCols && [_cells[_dottedRow][0] acceptsFirstResponder])
|
||||
_dottedColumn = 0;
|
||||
|
@ -629,10 +629,10 @@ static SEL getSel;
|
|||
else
|
||||
{
|
||||
#if STRICT == 0
|
||||
NSLog(@"remove non-existent column (%d) from matrix", col);
|
||||
NSLog(@"remove non-existent column (%d) from matrix", column);
|
||||
#else
|
||||
[NSException raise: NSRangeException
|
||||
format: @"remove non-existent column (%d) from matrix", col];
|
||||
format: @"remove non-existent column (%d) from matrix", column];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -683,21 +683,21 @@ static SEL getSel;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) renewRows: (int)r
|
||||
columns: (int)c
|
||||
- (void) renewRows: (int)newRows
|
||||
columns: (int)newColumns
|
||||
{
|
||||
[self _renewRows: r columns: c rowSpace: 0 colSpace: 0];
|
||||
[self _renewRows: newRows columns: newColumns rowSpace: 0 colSpace: 0];
|
||||
}
|
||||
|
||||
- (void) setCellSize: (NSSize)size
|
||||
- (void) setCellSize: (NSSize)aSize
|
||||
{
|
||||
_cellSize = size;
|
||||
_cellSize = aSize;
|
||||
[self sizeToCells];
|
||||
}
|
||||
|
||||
- (void) setIntercellSpacing: (NSSize)size
|
||||
- (void) setIntercellSpacing: (NSSize)aSize
|
||||
{
|
||||
_intercell = size;
|
||||
_intercell = aSize;
|
||||
[self sizeToCells];
|
||||
}
|
||||
|
||||
|
@ -765,20 +765,20 @@ static SEL getSel;
|
|||
|
||||
- (BOOL) getRow: (int*)row
|
||||
column: (int*)column
|
||||
forPoint: (NSPoint)point
|
||||
forPoint: (NSPoint)aPoint
|
||||
{
|
||||
BOOL betweenRows;
|
||||
BOOL betweenCols;
|
||||
BOOL beyondRows;
|
||||
BOOL beyondCols;
|
||||
int approxRow = point.y / (_cellSize.height + _intercell.height);
|
||||
int approxRow = aPoint.y / (_cellSize.height + _intercell.height);
|
||||
float approxRowsHeight = approxRow * (_cellSize.height + _intercell.height);
|
||||
int approxCol = point.x / (_cellSize.width + _intercell.width);
|
||||
int approxCol = aPoint.x / (_cellSize.width + _intercell.width);
|
||||
float approxColsWidth = approxCol * (_cellSize.width + _intercell.width);
|
||||
|
||||
/* First check the limit cases - is the point outside the matrix */
|
||||
beyondCols = (point.x > _bounds.size.width || point.x < 0);
|
||||
beyondRows = (point.y > _bounds.size.height || point.y < 0);
|
||||
beyondCols = (aPoint.x > _bounds.size.width || aPoint.x < 0);
|
||||
beyondRows = (aPoint.y > _bounds.size.height || aPoint.y < 0);
|
||||
|
||||
/* Determine if the point is inside a cell - note: if the point lies
|
||||
on the cell boundaries, we consider it inside the cell. to be
|
||||
|
@ -786,13 +786,13 @@ static SEL getSel;
|
|||
completely in the intercell spacing - not on the border */
|
||||
/* The following is non zero if the point lies between rows (not inside
|
||||
a cell) */
|
||||
betweenRows = (point.y < approxRowsHeight
|
||||
|| point.y > approxRowsHeight + _cellSize.height);
|
||||
betweenCols = (point.x < approxColsWidth
|
||||
|| point.x > approxColsWidth + _cellSize.width);
|
||||
betweenRows = (aPoint.y < approxRowsHeight
|
||||
|| aPoint.y > approxRowsHeight + _cellSize.height);
|
||||
betweenCols = (aPoint.x < approxColsWidth
|
||||
|| aPoint.x > approxColsWidth + _cellSize.width);
|
||||
|
||||
if (beyondRows || betweenRows || beyondCols || betweenCols ||
|
||||
(_numCols == 0) || (_numRows == 0))
|
||||
if (beyondRows || betweenRows || beyondCols || betweenCols
|
||||
|| (_numCols == 0) || (_numRows == 0))
|
||||
{
|
||||
if (row)
|
||||
{
|
||||
|
@ -1605,14 +1605,15 @@ static SEL getSel;
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL) textShouldBeginEditing: (NSText *)textObject
|
||||
- (BOOL) textShouldBeginEditing: (NSText*)aTextObject
|
||||
{
|
||||
if (_delegate && [_delegate respondsToSelector:
|
||||
@selector(control:textShouldBeginEditing:)])
|
||||
return [_delegate control: self
|
||||
textShouldBeginEditing: textObject];
|
||||
else
|
||||
return YES;
|
||||
@selector(control:textShouldBeginEditing:)])
|
||||
{
|
||||
return [_delegate control: self
|
||||
textShouldBeginEditing: aTextObject];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) textShouldEndEditing: (NSText *)aTextObject
|
||||
|
@ -2614,9 +2615,9 @@ static SEL getSel;
|
|||
return _mode;
|
||||
}
|
||||
|
||||
- (void) setCellClass: (Class)class
|
||||
- (void) setCellClass: (Class)classId
|
||||
{
|
||||
_cellClass = class;
|
||||
_cellClass = classId;
|
||||
if (_cellClass == nil)
|
||||
{
|
||||
_cellClass = defaultCellClass;
|
||||
|
@ -2661,9 +2662,9 @@ static SEL getSel;
|
|||
return _intercell;
|
||||
}
|
||||
|
||||
- (void) setBackgroundColor: (NSColor*)c
|
||||
- (void) setBackgroundColor: (NSColor*)aColor
|
||||
{
|
||||
ASSIGN(_backgroundColor, c);
|
||||
ASSIGN(_backgroundColor, aColor);
|
||||
}
|
||||
|
||||
- (NSColor*) backgroundColor
|
||||
|
@ -2671,9 +2672,9 @@ static SEL getSel;
|
|||
return _backgroundColor;
|
||||
}
|
||||
|
||||
- (void) setCellBackgroundColor: (NSColor*)c
|
||||
- (void) setCellBackgroundColor: (NSColor*)aColor
|
||||
{
|
||||
ASSIGN(_cellBackgroundColor, c);
|
||||
ASSIGN(_cellBackgroundColor, aColor);
|
||||
}
|
||||
|
||||
- (NSColor*) cellBackgroundColor
|
||||
|
@ -2681,11 +2682,11 @@ static SEL getSel;
|
|||
return _cellBackgroundColor;
|
||||
}
|
||||
|
||||
- (void) setDelegate: (id)object
|
||||
- (void) setDelegate: (id)anObject
|
||||
{
|
||||
if (_delegate)
|
||||
[nc removeObserver: _delegate name: nil object: self];
|
||||
_delegate = object;
|
||||
_delegate = anObject;
|
||||
|
||||
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
||||
if ([_delegate respondsToSelector: @selector(controlText##notif_name:)]) \
|
||||
|
@ -2716,9 +2717,12 @@ static SEL getSel;
|
|||
return _target;
|
||||
}
|
||||
|
||||
- (void) setAction: (SEL)sel
|
||||
/**
|
||||
* Sets the message to send when a single click occurs.<br />
|
||||
*/
|
||||
- (void) setAction: (SEL)aSelector
|
||||
{
|
||||
_action = sel;
|
||||
_action = aSelector;
|
||||
}
|
||||
|
||||
- (SEL) action
|
||||
|
@ -2726,12 +2730,15 @@ static SEL getSel;
|
|||
return _action;
|
||||
}
|
||||
|
||||
// NB: In GNUstep the following method does *not* set
|
||||
// ignoresMultiClick to NO as in the MacOS-X spec.
|
||||
// It simply sets the doubleAction, as in OpenStep spec.
|
||||
- (void) setDoubleAction: (SEL)sel
|
||||
/**
|
||||
* Sets the message to send when a double click occurs.<br />
|
||||
* NB: In GNUstep the following method does *not* set
|
||||
* ignoresMultiClick to NO as in the MacOS-X spec.<br />
|
||||
* It simply sets the doubleAction, as in OpenStep spec.
|
||||
*/
|
||||
- (void) setDoubleAction: (SEL)aSelector
|
||||
{
|
||||
_doubleAction = sel;
|
||||
_doubleAction = aSelector;
|
||||
}
|
||||
|
||||
- (SEL) doubleAction
|
||||
|
@ -2739,9 +2746,9 @@ static SEL getSel;
|
|||
return _doubleAction;
|
||||
}
|
||||
|
||||
- (void) setErrorAction: (SEL)sel
|
||||
- (void) setErrorAction: (SEL)aSelector
|
||||
{
|
||||
_errorAction = sel;
|
||||
_errorAction = aSelector;
|
||||
}
|
||||
|
||||
- (SEL) errorAction
|
||||
|
@ -2749,9 +2756,13 @@ static SEL getSel;
|
|||
return _errorAction;
|
||||
}
|
||||
|
||||
- (void) setAllowsEmptySelection: (BOOL)f
|
||||
/**
|
||||
* Sets a flag to indicate whether the matrix should permit empty selections
|
||||
* or should force one or mor cells to be selected at all times.
|
||||
*/
|
||||
- (void) setAllowsEmptySelection: (BOOL)flag
|
||||
{
|
||||
_allowsEmptySelection = f;
|
||||
_allowsEmptySelection = flag;
|
||||
}
|
||||
|
||||
- (BOOL) allowsEmptySelection
|
||||
|
@ -2779,9 +2790,13 @@ static SEL getSel;
|
|||
return _drawsBackground;
|
||||
}
|
||||
|
||||
- (void) setDrawsCellBackground: (BOOL)f
|
||||
/**
|
||||
* Set a flag to say whether the matrix will draw call backgrounds (YES)
|
||||
* or expect the cell to do it itsself (NO).
|
||||
*/
|
||||
- (void) setDrawsCellBackground: (BOOL)flag
|
||||
{
|
||||
_drawsCellBackground = f;
|
||||
_drawsCellBackground = flag;
|
||||
}
|
||||
|
||||
- (BOOL) drawsCellBackground
|
||||
|
|
|
@ -677,24 +677,30 @@
|
|||
}
|
||||
|
||||
|
||||
- (NSControlSize)controlSize
|
||||
- (NSControlSize) controlSize
|
||||
{
|
||||
// FIXME
|
||||
return NSRegularControlSize;
|
||||
}
|
||||
|
||||
- (void)setControlSize:(NSControlSize)size
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (void) setControlSize: (NSControlSize)controlSize
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (NSControlTint)controlTint
|
||||
- (NSControlTint) controlTint
|
||||
{
|
||||
// FIXME
|
||||
return NSDefaultControlTint;
|
||||
}
|
||||
|
||||
- (void)setControlTint:(NSControlTint)tint
|
||||
/**
|
||||
* Not implemented.
|
||||
*/
|
||||
- (void) setControlTint: (NSControlTint)controlTint
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
|
|
@ -3068,7 +3068,7 @@ _isCellEditable (id delegate, NSArray *tableColumns,
|
|||
NSDefaultMallocZone ()]);
|
||||
}
|
||||
|
||||
- (int) columnWithIdentifier: (id)anObject
|
||||
- (int) columnWithIdentifier: (id)identifier
|
||||
{
|
||||
NSEnumerator *enumerator = [_tableColumns objectEnumerator];
|
||||
NSTableColumn *tb;
|
||||
|
@ -3076,7 +3076,7 @@ _isCellEditable (id delegate, NSArray *tableColumns,
|
|||
|
||||
while ((tb = [enumerator nextObject]) != nil)
|
||||
{
|
||||
if ([[tb identifier] isEqual: anObject])
|
||||
if ([[tb identifier] isEqual: identifier])
|
||||
return return_value;
|
||||
else
|
||||
return_value++;
|
||||
|
@ -5175,9 +5175,9 @@ byExtendingSelection: (BOOL)flag
|
|||
}
|
||||
}
|
||||
|
||||
- (void) setFrame: (NSRect) aRect
|
||||
- (void) setFrame: (NSRect)frameRect
|
||||
{
|
||||
[super setFrame: aRect];
|
||||
[super setFrame: frameRect];
|
||||
}
|
||||
|
||||
- (void) sizeToFit
|
||||
|
@ -5607,7 +5607,7 @@ byExtendingSelection: (BOOL)flag
|
|||
* Drawing
|
||||
*/
|
||||
|
||||
- (void)drawRow: (int)rowIndex clipRect: (NSRect)aRect
|
||||
- (void) drawRow: (int)rowIndex clipRect: (NSRect)clipRect
|
||||
{
|
||||
int startingColumn;
|
||||
int endingColumn;
|
||||
|
@ -5626,7 +5626,7 @@ byExtendingSelection: (BOOL)flag
|
|||
rect - so we avoid it and do it natively */
|
||||
|
||||
/* Determine starting column as fast as possible */
|
||||
x_pos = NSMinX (aRect);
|
||||
x_pos = NSMinX (clipRect);
|
||||
i = 0;
|
||||
while ((x_pos > _columnOrigins[i]) && (i < _numberOfColumns))
|
||||
{
|
||||
|
@ -5638,7 +5638,7 @@ byExtendingSelection: (BOOL)flag
|
|||
startingColumn = 0;
|
||||
|
||||
/* Determine ending column as fast as possible */
|
||||
x_pos = NSMaxX (aRect);
|
||||
x_pos = NSMaxX (clipRect);
|
||||
// Nota Bene: we do *not* reset i
|
||||
while ((x_pos > _columnOrigins[i]) && (i < _numberOfColumns))
|
||||
{
|
||||
|
@ -6104,13 +6104,13 @@ byExtendingSelection: (BOOL)flag
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) textShouldEndEditing: (NSText *)aTextObject
|
||||
- (BOOL) textShouldEndEditing: (NSText*)textObject
|
||||
{
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(control:textShouldEndEditing:)])
|
||||
{
|
||||
if ([_delegate control: self
|
||||
textShouldEndEditing: aTextObject] == NO)
|
||||
textShouldEndEditing: textObject] == NO)
|
||||
{
|
||||
NSBeep ();
|
||||
return NO;
|
||||
|
@ -6137,7 +6137,7 @@ byExtendingSelection: (BOOL)flag
|
|||
}
|
||||
}
|
||||
|
||||
return [_editedCell isEntryAcceptable: [aTextObject text]];
|
||||
return [_editedCell isEntryAcceptable: [textObject text]];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue