Author: mlytwyn Date: Thu Dec 4 22:55:21 2014 New Revision: 38234 URL: http://svn.gna.org/viewcvs/gnustep?rev=38234&view=rev Log: Create working stubs for table view batch insertions/removals of rows
Modified: libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSTableView.h libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m Modified: libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSTableView.h URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSTableView.h?rev=38234&r1=38233&r2=38234&view=diff ============================================================================== --- libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSTableView.h (original) +++ libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSTableView.h Thu Dec 4 22:55:21 2014 @@ -68,6 +68,18 @@ } NSTableViewColumnAutoresizingStyle; #endif +#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) +typedef enum _NSTableViewAnimationOptions +{ + NSTableViewAnimationEffectNone = 0x0, + NSTableViewAnimationEffectFade = 0x1, + NSTableViewAnimationEffectGap = 0x2, + NSTableViewAnimationSlideUp = 0x10, + NSTableViewAnimationSlideDown = 0x20, + NSTableViewAnimationSlideLeft = 0x30, + NSTableViewAnimationSlideRight = 0x40, +} NSTableViewAnimationOptions; +#endif @interface NSTableView : NSControl <NSUserInterfaceValidations> { @@ -114,7 +126,8 @@ /* * Ivars Acting as Control... */ - BOOL _isValidating; + BOOL _isValidating; + NSInteger _beginEndUpdates; /* * Ivars Acting as Cache @@ -341,6 +354,19 @@ - (NSArray *) sortDescriptors; #endif +#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) +- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes columnIndexes:(NSIndexSet *)columnIndexes; +#endif + +#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) +- (void)beginUpdates; +- (void)endUpdates; +- (NSInteger)columnForView:(NSView *)view; +- (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions; +- (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions; +- (NSInteger)rowForView:(NSView *)view; +#endif + @end /* interface of NSTableView */ @interface NSTableView (GNUPrivate) @@ -459,6 +485,7 @@ - (NSCell *)tableView:(NSTableView*)tableView dataCellForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row; - (NSIndexSet *)tableView:(NSTableView*)tableView selectionIndexesForProposedSelection:(NSIndexSet*)proposedSelectionIndexes; #endif + @end #endif /* _GNUstep_H_NSTableView */ Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m?rev=38234&r1=38233&r2=38234&view=diff ============================================================================== --- libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m (original) +++ libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m Thu Dec 4 22:55:21 2014 @@ -6998,6 +6998,47 @@ return NO; } +- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes columnIndexes:(NSIndexSet *)columnIndexes +{ + [self reloadData]; +} + +- (void)beginUpdates +{ + _beginEndUpdates++; +} + +- (void)endUpdates +{ + if (_beginEndUpdates > 0) + { + if (--_beginEndUpdates == 0) + { + // Process batched inserts/removes.... + // Just reload table for now until we get inserts/removes working... + [self reloadData]; + } + } +} + +- (NSInteger)columnForView:(NSView *)view +{ + return(NSNotFound); +} + +- (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions +{ +} + +- (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions +{ +} + +- (NSInteger)rowForView:(NSView *)view +{ + return(NSNotFound); +} + @end /* implementation of NSTableView */ @implementation NSTableView (SelectionHelper) _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs