Author: fredkiefer Date: Mon Dec 8 16:08:53 2014 New Revision: 38240 URL: http://svn.gna.org/viewcvs/gnustep?rev=38240&view=rev Log: * Headers/AppKit/NSTableView.h, * Source/NSTableView.m: Create working stubs for table view batch insertions/removals of rows Patch by Marcian Lytwyn <g...@advcsi.com>.
Modified: libs/gui/trunk/ChangeLog libs/gui/trunk/Headers/AppKit/NSTableView.h libs/gui/trunk/Source/NSTableView.m Modified: libs/gui/trunk/ChangeLog URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38240&r1=38239&r2=38240&view=diff ============================================================================== --- libs/gui/trunk/ChangeLog (original) +++ libs/gui/trunk/ChangeLog Mon Dec 8 16:08:53 2014 @@ -1,3 +1,10 @@ +2014-12-08 Fred Kiefer <fredkie...@gmx.de> + + * Headers/AppKit/NSTableView.h, + * Source/NSTableView.m: + Create working stubs for table view batch insertions/removals of rows + Patch by Marcian Lytwyn <g...@advcsi.com>. + 2014-12-08 Fred Kiefer <fredkie...@gmx.de> * Source/NSParagraphStyle.m (-description): Add method. Modified: libs/gui/trunk/Headers/AppKit/NSTableView.h URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Headers/AppKit/NSTableView.h?rev=38240&r1=38239&r2=38240&view=diff ============================================================================== --- libs/gui/trunk/Headers/AppKit/NSTableView.h (original) +++ libs/gui/trunk/Headers/AppKit/NSTableView.h Mon Dec 8 16:08:53 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> { @@ -148,6 +160,8 @@ NSDragOperation _draggingSourceOperationMaskForLocal; NSDragOperation _draggingSourceOperationMaskForRemote; + + NSInteger _beginEndUpdates; } /* Data Source */ @@ -339,6 +353,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) Modified: libs/gui/trunk/Source/NSTableView.m URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSTableView.m?rev=38240&r1=38239&r2=38240&view=diff ============================================================================== --- libs/gui/trunk/Source/NSTableView.m (original) +++ libs/gui/trunk/Source/NSTableView.m Mon Dec 8 16:08:53 2014 @@ -6724,6 +6724,50 @@ 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