Add skeleton for NSTableRowView class that includes set/get methods

This commit is contained in:
Gregory John Casamento 2024-04-25 09:18:13 -04:00
parent 82dce67eb4
commit 4d2dcb9e04
3 changed files with 164 additions and 1 deletions

View file

@ -25,7 +25,8 @@
#ifndef _NSTableRowView_h_GNUSTEP_GUI_INCLUDE
#define _NSTableRowView_h_GNUSTEP_GUI_INCLUDE
#import <AppKit/NSView.h>
#import <AppKit/NSTableView.h>
#import <AppKit/NSCell.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
@ -34,6 +35,59 @@ extern "C" {
#endif
@interface NSTableRowView : NSView
{
// Display style...
BOOL _emphasized;
NSBackgroundStyle _interiorBackgroundStyle;
BOOL _floating;
// Row selection...
BOOL _selected;
NSTableViewSelectionHighlightStyle _selectionHighlightStyle;
// Drag and Drop...
NSTableViewDraggingDestinationFeedbackStyle _draggingDestinationFeedbackStyle;
CGFloat _indentationForDropOperation;
BOOL _targetForDropOperation;
// Row grouping...
BOOL _groupRowStyle;
NSInteger _numberOfColumns;
// Overriding row view display characteristics...
NSColor *_backgroundColor;
}
- (BOOL) isEmphasized;
- (void) setEmphasized: (BOOL)flag;
- (NSBackgroundStyle) interiorBackgroundStyle;
- (BOOL) isFloating;
- (void) setFloating: (BOOL)flag;
- (BOOL) isSelected;
- (void) setSelected: (BOOL)flag;
- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle;
- (void) setSelectionHighlightStyle: (NSTableViewSelectionHighlightStyle) selectionHighlightStyle;
- (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle;
- (void) setTableViewDraggingDestinationFeedbackStyle: (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle;
- (CGFloat) indentationForDropOperation;
- (void) setIndentationForDropOperation: (CGFloat)indentationForDropOperation;
- (BOOL) targetForDropOperation;
- (void) setTargetForDropOperation: (BOOL)flag;
- (BOOL) groupRowStyle;
- (void) setGroupRowStyle: (BOOL)flag;
- (NSInteger) numberOfColumns;
- (NSColor *) backgroundColor;
- (void) setBackgroundColor: (NSColor *)color;
@end

View file

@ -102,6 +102,15 @@ typedef enum _NSTableViewRowSizeStyle
} NSTableViewRowSizeStyle;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
typedef enum _NSTableViewDraggingDestinationFeedbackStyle
{
NSTableViewDraggingDestinationFeedbackStyleNone = 0,
NSTableViewDraggingDestinationFeedbackStyleRegular,
NSTableViewDraggingDestinationFeedbackStyleSourceList,
NSTableViewDraggingDestinationFeedbackStyleGap,
} NSTableViewDraggingDestinationFeedbackStyle;
#endif
APPKIT_EXPORT_CLASS
@interface NSTableView : NSControl <NSUserInterfaceValidations>

View file

@ -26,5 +26,105 @@
@implementation NSTableRowView
- (BOOL) isEmphasized
{
return _emphasized;
}
- (void) setEmphasized: (BOOL)flag
{
_emphasized = flag;
}
- (NSBackgroundStyle) interiorBackgroundStyle
{
return _interiorBackgroundStyle;
}
- (BOOL) isFloating
{
return _floating;
}
- (void) setFloating: (BOOL)flag
{
_floating = flag;
}
- (BOOL) isSelected
{
return _selected;
}
- (void) setSelected: (BOOL)flag
{
_selected = flag;
}
- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle
{
return _selectionHighlightStyle;
}
- (void) setSelectionHighlightStyle: (NSTableViewSelectionHighlightStyle) selectionHighlightStyle
{
_selectionHighlightStyle = selectionHighlightStyle;
}
- (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle
{
return _draggingDestinationFeedbackStyle;
}
- (void) setTableViewDraggingDestinationFeedbackStyle: (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle
{
_draggingDestinationFeedbackStyle = draggingDestinationFeedbackStyle;
}
- (CGFloat) indentationForDropOperation
{
return _indentationForDropOperation;
}
- (void) setIndentationForDropOperation: (CGFloat)indentationForDropOperation
{
_indentationForDropOperation = indentationForDropOperation;
}
- (BOOL) targetForDropOperation
{
return _targetForDropOperation;
}
- (void) setTargetForDropOperation: (BOOL)flag
{
_targetForDropOperation = flag;
}
- (BOOL) groupRowStyle
{
return _groupRowStyle;
}
- (void) setGroupRowStyle: (BOOL)flag
{
_groupRowStyle = flag;
}
- (NSInteger) numberOfColumns
{
return 0;
}
- (NSColor *) backgroundColor
{
return _backgroundColor;
}
- (void) setBackgroundColor: (NSColor *)color
{
ASSIGN(_backgroundColor, color);
}
@end