diff dwt/internal/cocoa/NSTableView.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children 62202ce0039f
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSTableView.d	Tue Oct 21 15:20:04 2008 +0200
+++ b/dwt/internal/cocoa/NSTableView.d	Mon Dec 01 17:07:00 2008 +0100
@@ -1,41 +1,33 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *     IBM Corporation - initial API and implementation
+ *    IBM Corporation - initial API and implementation
  *     
  * Port to the D programming language:
- *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *    Jacob Carlborg <doob@me.com>
  *******************************************************************************/
 module dwt.internal.cocoa.NSTableView;
 
-import dwt.internal.cocoa.CGFloat;
-import dwt.internal.cocoa.id;
+import dwt.dwthelper.utils;
+import dwt.internal.c.Carbon;
+import cocoa = dwt.internal.cocoa.id;
 import dwt.internal.cocoa.NSArray;
-import dwt.internal.cocoa.NSCell;
+import dwt.internal.cocoa.NSIndexSet;
 import dwt.internal.cocoa.NSColor;
 import dwt.internal.cocoa.NSControl;
-import dwt.internal.cocoa.NSDragOperation;
-import dwt.internal.cocoa.NSEnumerator;
-import dwt.internal.cocoa.NSEvent;
-import dwt.internal.cocoa.NSImage;
-import dwt.internal.cocoa.NSIndexSet;
-import dwt.internal.cocoa.NSInteger;
-import dwt.internal.cocoa.NSNotification;
 import dwt.internal.cocoa.NSPoint;
 import dwt.internal.cocoa.NSRange;
 import dwt.internal.cocoa.NSRect;
 import dwt.internal.cocoa.NSSize;
-import dwt.internal.cocoa.NSString;
 import dwt.internal.cocoa.NSTableColumn;
 import dwt.internal.cocoa.NSTableHeaderView;
-import dwt.internal.cocoa.NSText;
-import dwt.internal.cocoa.NSView;
 import dwt.internal.cocoa.OS;
+import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
 enum NSTableViewColumnAutoresizingStyle : NSUInteger
@@ -48,657 +40,212 @@
     NSTableViewFirstColumnOnlyAutoresizingStyle
 }
 
-alias NSTableViewColumnAutoresizingStyle.NSTableViewNoColumnAutoresizing NSTableViewNoColumnAutoresizing;
-alias NSTableViewColumnAutoresizingStyle.NSTableViewUniformColumnAutoresizingStyle NSTableViewUniformColumnAutoresizingStyle;
-alias NSTableViewColumnAutoresizingStyle.NSTableViewSequentialColumnAutoresizingStyle NSTableViewSequentialColumnAutoresizingStyle;
-alias NSTableViewColumnAutoresizingStyle.NSTableViewReverseSequentialColumnAutoresizingStyle NSTableViewReverseSequentialColumnAutoresizingStyle;
-alias NSTableViewColumnAutoresizingStyle.NSTableViewLastColumnOnlyAutoresizingStyle NSTableViewLastColumnOnlyAutoresizingStyle;
-alias NSTableViewColumnAutoresizingStyle.NSTableViewFirstColumnOnlyAutoresizingStyle NSTableViewFirstColumnOnlyAutoresizingStyle;
+public class NSTableView : NSControl {
+
+public this() {
+    super();
+}
+
+public this(objc.id id) {
+    super(id);
+}
+
+public this(cocoa.id id) {
+    super(id);
+}
+
+public void addTableColumn(NSTableColumn column) {
+    OS.objc_msgSend(this.id, OS.sel_addTableColumn_, column !is null ? column.id : null);
+}
+
+public NSTableViewColumnAutoresizingStyle columnAutoresizingStyle() {
+    return cast(NSTableViewColumnAutoresizingStyle) OS.objc_msgSend(this.id, OS.sel_columnAutoresizingStyle);
+}
 
-enum NSTableViewSelectionHighlightStyle : NSInteger
-{
-    NSTableViewSelectionHighlightStyleRegular = 0,
-    NSTableViewSelectionHighlightStyleSourceList = 1,
+public NSIndexSet columnIndexesInRect(NSRect rect) {
+    objc.id result = OS.objc_msgSend(this.id, OS.sel_columnIndexesInRect_, rect);
+    return result !is null ? new NSIndexSet(result) : null;
+}
+
+public NSInteger columnWithIdentifier(cocoa.id identifier) {
+    return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_columnWithIdentifier_, identifier !is null ? identifier.id : null);
+}
+
+public void deselectAll(cocoa.id sender) {
+    OS.objc_msgSend(this.id, OS.sel_deselectAll_, sender !is null ? sender.id : null);
+}
+
+public void deselectRow(NSInteger row) {
+    OS.objc_msgSend(this.id, OS.sel_deselectRow_, row);
+}
+
+public NSRect frameOfCellAtColumn(NSInteger column, NSInteger row) {
+    NSRect result = NSRect();
+    OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfCellAtColumn_row_, column, row);
+    return result;
+}
+
+public NSTableHeaderView headerView() {
+    objc.id result = OS.objc_msgSend(this.id, OS.sel_headerView);
+    return result !is null ? new NSTableHeaderView(result) : null;
 }
 
-alias NSTableViewSelectionHighlightStyle.NSTableViewSelectionHighlightStyleRegular NSTableViewSelectionHighlightStyleRegular;
-alias NSTableViewSelectionHighlightStyle.NSTableViewSelectionHighlightStyleSourceList NSTableViewSelectionHighlightStyleSourceList;
+public void highlightSelectionInClipRect(NSRect clipRect) {
+    OS.objc_msgSend(this.id, OS.sel_highlightSelectionInClipRect_, clipRect);
+}
+
+public NSSize intercellSpacing() {
+    NSSize result = NSSize();
+    OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
+    return result;
+}
+
+public bool isRowSelected(NSInteger row) {
+    return OS.objc_msgSend_bool(this.id, OS.sel_isRowSelected_, row);
+}
+
+public void moveColumn(NSInteger column, NSInteger newIndex) {
+    OS.objc_msgSend(this.id, OS.sel_moveColumn_toColumn_, column, newIndex);
+}
+
+public void noteNumberOfRowsChanged() {
+    OS.objc_msgSend(this.id, OS.sel_noteNumberOfRowsChanged);
+}
+
+public NSInteger numberOfColumns() {
+    return OS.objc_msgSend(this.id, OS.sel_numberOfColumns);
+}
 
-enum NSTableViewDropOperation : NSUInteger
-{
-    NSTableViewDropOn,
-    NSTableViewDropAbove
+public NSInteger numberOfRows() {
+    return OS.objc_msgSend(this.id, OS.sel_numberOfRows);
+}
+
+public NSInteger numberOfSelectedRows() {
+    return OS.objc_msgSend(this.id, OS.sel_numberOfSelectedRows);
+}
+
+public NSRect rectOfColumn(NSInteger column) {
+    NSRect result = NSRect();
+    OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfColumn_, column);
+    return result;
+}
+
+public NSRect rectOfRow(NSInteger row) {
+    NSRect result = NSRect();
+    OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfRow_, row);
+    return result;
+}
+
+public void reloadData() {
+    OS.objc_msgSend(this.id, OS.sel_reloadData);
+}
+
+public void removeTableColumn(NSTableColumn column) {
+    OS.objc_msgSend(this.id, OS.sel_removeTableColumn_, column !is null ? column.id : null);
 }
 
-alias NSTableViewDropOperation.NSTableViewDropOn NSTableViewDropOn;
-alias NSTableViewDropOperation.NSTableViewDropAbove NSTableViewDropAbove;
-
-public class NSTableView : NSControl
-{
-
-    public this ()
-    {
-        super();
-    }
-
-    public this (objc.id id)
-    {
-        super(id);
-    }
-
-    public void addTableColumn (NSTableColumn column)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_addTableColumn_1, column !is null ? column.id_ : null);
-    }
-
-    public bool allowsColumnReordering ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_allowsColumnReordering) !is null;
-    }
-
-    public bool allowsColumnResizing ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_allowsColumnResizing) !is null;
-    }
-
-    public bool allowsColumnSelection ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_allowsColumnSelection) !is null;
-    }
+public NSInteger rowAtPoint(NSPoint point) {
+    return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_rowAtPoint_, point);
+}
 
-    public bool allowsEmptySelection ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_allowsEmptySelection) !is null;
-    }
-
-    public bool allowsMultipleSelection ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_allowsMultipleSelection) !is null;
-    }
-
-    public bool allowsTypeSelect ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_allowsTypeSelect) !is null;
-    }
-
-    public bool autoresizesAllColumnsToFit ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_autoresizesAllColumnsToFit) !is null;
-    }
-
-    public NSString autosaveName ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_autosaveName);
-        return result !is null ? new NSString(result) : null;
-    }
-
-    public bool autosaveTableColumns ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_autosaveTableColumns) !is null;
-    }
-
-    public NSColor backgroundColor ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor);
-        return result !is null ? new NSColor(result) : null;
-    }
+public CGFloat rowHeight() {
+    return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_rowHeight);
+}
 
-    public bool canDragRowsWithIndexes (NSIndexSet rowIndexes, NSPoint mouseDownPoint)
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_canDragRowsWithIndexes_1atPoint_1, rowIndexes !is null ? rowIndexes.id_ : null, mouseDownPoint) !is null;
-    }
-
-    public NSInteger clickedColumn ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_clickedColumn);
-    }
-
-    public NSInteger clickedRow ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_clickedRow);
-    }
-
-    public NSTableViewColumnAutoresizingStyle columnAtPoint (NSPoint point)
-    {
-        return cast(NSTableViewColumnAutoresizingStyle) OS.objc_msgSend(this.id_, OS.sel_columnAtPoint_1, point);
-    }
-
-    public NSInteger columnAutoresizingStyle ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_columnAutoresizingStyle);
-    }
-
-    public NSIndexSet columnIndexesInRect (NSRect rect)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_columnIndexesInRect_1, rect);
-        return result !is null ? new NSIndexSet(result) : null;
-    }
-
-    public NSInteger columnWithIdentifier (id identifier)
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_columnWithIdentifier_1, identifier !is null ? identifier.id_ : null);
-    }
+public NSRange rowsInRect(NSRect rect) {
+    NSRange result = NSRange();
+    OS.objc_msgSend_stret(result, this.id, OS.sel_rowsInRect_, rect);
+    return result;
+}
 
-    public NSRange columnsInRect (NSRect rect)
-    {
-        NSRange result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_columnsInRect_1, rect);
-        return result;
-    }
-
-    public NSView cornerView ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_cornerView);
-        return result !is null ? new NSView(result) : null;
-    }
-
-    public id dataSource ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_dataSource);
-        return result !is null ? new id(result) : null;
-    }
+public void scrollColumnToVisible(NSInteger column) {
+    OS.objc_msgSend(this.id, OS.sel_scrollColumnToVisible_, column);
+}
 
-    public id delegatee ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate);
-        return result !is null ? new id(result) : null;
-    }
-
-    public void deselectAll (id sender)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_deselectAll_1, sender !is null ? sender.id_ : null);
-    }
-
-    public void deselectColumn (NSInteger column)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_deselectColumn_1, column);
-    }
-
-    public void deselectRow (NSInteger row)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_deselectRow_1, row);
-    }
-
-    public objc.SEL doubleAction ()
-    {
-        return cast(objc.SEL) OS.objc_msgSend(this.id_, OS.sel_doubleAction);
-    }
+public void scrollRowToVisible(NSInteger row) {
+    OS.objc_msgSend(this.id, OS.sel_scrollRowToVisible_, row);
+}
 
-    public NSImage dragImageForRows (NSArray dragRows, NSEvent dragEvent, NSPointPointer dragImageOffset)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_dragImageForRows_1event_1dragImageOffset_1, dragRows !is null ? dragRows.id_ : null,
-                dragEvent !is null ? dragEvent.id_ : null, dragImageOffset);
-        return result !is null ? new NSImage(result) : null;
-    }
-
-    public NSImage dragImageForRowsWithIndexes (NSIndexSet dragRows, NSArray tableColumns, NSEvent dragEvent, NSPointPointer dragImageOffset)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_dragImageForRowsWithIndexes_1tableColumns_1event_1offset_1,
-                dragRows !is null ? dragRows.id_ : null, tableColumns !is null ? tableColumns.id_ : null, dragEvent !is null ? dragEvent.id_ : null,
-                dragImageOffset);
-        return result !is null ? new NSImage(result) : null;
-    }
-
-    public void drawBackgroundInClipRect (NSRect clipRect)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_drawBackgroundInClipRect_1, clipRect);
-    }
-
-    public void drawGridInClipRect (NSRect clipRect)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_drawGridInClipRect_1, clipRect);
-    }
-
-    public void drawRow (NSInteger row, NSRect clipRect)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_drawRow_1clipRect_1, row, clipRect);
-    }
-
-    public bool drawsGrid ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_drawsGrid) !is null;
-    }
+public void selectAll(cocoa.id sender) {
+    OS.objc_msgSend(this.id, OS.sel_selectAll_, sender !is null ? sender.id : null);
+}
 
-    public void editColumn (NSInteger column, NSInteger row, NSEvent theEvent, bool select)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_editColumn_1row_1withEvent_1select_1, column, row, theEvent !is null ? theEvent.id_ : null, select);
-    }
-
-    public NSInteger editedColumn ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_editedColumn);
-    }
-
-    public NSInteger editedRow ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_editedRow);
-    }
+public void selectRow(NSInteger row, bool extend) {
+    OS.objc_msgSend(this.id, OS.sel_selectRow_byExtendingSelection_, row, extend);
+}
 
-    public NSRect frameOfCellAtColumn (NSInteger column, NSInteger row)
-    {
-        NSRect result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_frameOfCellAtColumn_1row_1, column, row);
-        return result;
-    }
-
-    public NSColor gridColor ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_gridColor);
-        return result !is null ? new NSColor(result) : null;
-    }
-
-    public NSUInteger gridStyleMask ()
-    {
-        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_gridStyleMask);
-    }
-
-    public NSTableHeaderView headerView ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_headerView);
-        return result !is null ? new NSTableHeaderView(result) : null;
-    }
+public void selectRowIndexes(NSIndexSet indexes, bool extend) {
+    OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_byExtendingSelection_, indexes !is null ? indexes.id : null, extend);
+}
 
-    public void highlightSelectionInClipRect (NSRect clipRect)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_highlightSelectionInClipRect_1, clipRect);
-    }
-
-    public NSTableColumn highlightedTableColumn ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_highlightedTableColumn);
-        return result !is null ? new NSTableColumn(result) : null;
-    }
-
-    public NSImage indicatorImageInTableColumn (NSTableColumn tc)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_indicatorImageInTableColumn_1, tc !is null ? tc.id_ : null);
-        return result !is null ? new NSImage(result) : null;
-    }
-
-    public NSSize intercellSpacing ()
-    {
-        NSSize result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_intercellSpacing);
-        return result;
-    }
-
-    public bool isColumnSelected (NSInteger column)
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_isColumnSelected_1, column) !is null;
-    }
-
-    public bool isRowSelected (NSInteger row)
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_isRowSelected_1, row) !is null;
-    }
-
-    public void moveColumn (NSInteger column, NSInteger newIndex)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_moveColumn_1toColumn_1, column, newIndex);
-    }
+public NSInteger selectedRow() {
+    return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_selectedRow);
+}
 
-    public void noteHeightOfRowsWithIndexesChanged (NSIndexSet indexSet)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_noteHeightOfRowsWithIndexesChanged_1, indexSet !is null ? indexSet.id_ : null);
-    }
-
-    public void noteNumberOfRowsChanged ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_noteNumberOfRowsChanged);
-    }
-
-    public NSInteger numberOfColumns ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfColumns);
-    }
-
-    public NSInteger numberOfRows ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfRows);
-    }
+public NSIndexSet selectedRowIndexes() {
+    objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexes);
+    return result !is null ? new NSIndexSet(result) : null;
+}
 
-    public NSInteger numberOfSelectedColumns ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfSelectedColumns);
-    }
-
-    public NSInteger numberOfSelectedRows ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfSelectedRows);
-    }
+public void setAllowsColumnReordering(bool flag) {
+    OS.objc_msgSend(this.id, OS.sel_setAllowsColumnReordering_, flag);
+}
 
-    public NSCell preparedCellAtColumn (NSInteger column, NSInteger row)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_preparedCellAtColumn_1row_1, column, row);
-        return result !is null ? new NSCell(result) : null;
-    }
-
-    public NSRect rectOfColumn (NSInteger column)
-    {
-        NSRect result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectOfColumn_1, column);
-        return result;
-    }
+public void setAllowsMultipleSelection(bool flag) {
+    OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_, flag);
+}
 
-    public NSRect rectOfRow (NSInteger row)
-    {
-        NSRect result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectOfRow_1, row);
-        return result;
-    }
-
-    public void reloadData ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_reloadData);
-    }
-
-    public void removeTableColumn (NSTableColumn column)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_removeTableColumn_1, column !is null ? column.id_ : null);
-    }
-
-    public NSInteger rowAtPoint (NSPoint point)
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_rowAtPoint_1, point);
-    }
-
-    public CGFloat rowHeight ()
-    {
-        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_rowHeight);
-    }
-
-    public NSRange rowsInRect (NSRect rect)
-    {
-        NSRange result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rowsInRect_1, rect);
-        return result;
-    }
+public void setBackgroundColor(NSColor color) {
+    OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_, color !is null ? color.id : null);
+}
 
-    public void scrollColumnToVisible (NSInteger column)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_scrollColumnToVisible_1, column);
-    }
-
-    public void scrollRowToVisible (NSInteger row)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_scrollRowToVisible_1, row);
-    }
-
-    public void selectAll (id sender)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_selectAll_1, sender !is null ? sender.id_ : null);
-    }
-
-    public void selectColumn (NSInteger column, bool extend)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_selectColumn_1byExtendingSelection_1, column, extend);
-    }
+public void setColumnAutoresizingStyle(NSTableViewColumnAutoresizingStyle style) {
+    OS.objc_msgSend(this.id, OS.sel_setColumnAutoresizingStyle_, style);
+}
 
-    public void selectColumnIndexes (NSIndexSet indexes, bool extend)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_selectColumnIndexes_1byExtendingSelection_1, indexes !is null ? indexes.id_ : null, extend);
-    }
-
-    public void selectRow (NSInteger row, bool extend)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_selectRow_1byExtendingSelection_1, row, extend);
-    }
-
-    public void selectRowIndexes (NSIndexSet indexes, bool extend)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_selectRowIndexes_1byExtendingSelection_1, indexes !is null ? indexes.id_ : null, extend);
-    }
-
-    public NSInteger selectedColumn ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedColumn);
-    }
+public void setDataSource(cocoa.id aSource) {
+    OS.objc_msgSend(this.id, OS.sel_setDataSource_, aSource !is null ? aSource.id : null);
+}
 
-    public NSEnumerator selectedColumnEnumerator ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedColumnEnumerator);
-        return result !is null ? new NSEnumerator(result) : null;
-    }
-
-    public NSIndexSet selectedColumnIndexes ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedColumnIndexes);
-        return result !is null ? new NSIndexSet(result) : null;
-    }
-
-    public NSInteger selectedRow ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedRow);
-    }
-
-    public NSEnumerator selectedRowEnumerator ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRowEnumerator);
-        return result !is null ? new NSEnumerator(result) : null;
-    }
-
-    public NSIndexSet selectedRowIndexes ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRowIndexes);
-        return result !is null ? new NSIndexSet(result) : null;
-    }
-
-    public NSTableViewSelectionHighlightStyle selectionHighlightStyle ()
-    {
-        return cast(NSTableViewSelectionHighlightStyle) OS.objc_msgSend(this.id_, OS.sel_selectionHighlightStyle);
-    }
-
-    public void setAllowsColumnReordering (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAllowsColumnReordering_1, flag);
-    }
+public void setDelegate(cocoa.id delegate_) {
+    OS.objc_msgSend(this.id, OS.sel_setDelegate_, delegate_ !is null ? delegate_.id : null);
+}
 
-    public void setAllowsColumnResizing (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAllowsColumnResizing_1, flag);
-    }
-
-    public void setAllowsColumnSelection (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAllowsColumnSelection_1, flag);
-    }
-
-    public void setAllowsEmptySelection (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAllowsEmptySelection_1, flag);
-    }
-
-    public void setAllowsMultipleSelection (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAllowsMultipleSelection_1, flag);
-    }
+public void setDoubleAction(objc.SEL aSelector) {
+    OS.objc_msgSend(this.id, OS.sel_setDoubleAction_, aSelector);
+}
 
-    public void setAllowsTypeSelect (bool value)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAllowsTypeSelect_1, value);
-    }
-
-    public void setAutoresizesAllColumnsToFit (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAutoresizesAllColumnsToFit_1, flag);
-    }
-
-    public void setAutosaveName (NSString name)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAutosaveName_1, name !is null ? name.id_ : null);
-    }
-
-    public void setAutosaveTableColumns (bool save)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAutosaveTableColumns_1, save);
-    }
-
-    public void setBackgroundColor (NSColor color)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null);
-    }
+public void setHeaderView(NSTableHeaderView headerView) {
+    OS.objc_msgSend(this.id, OS.sel_setHeaderView_, headerView !is null ? headerView.id : null);
+}
 
-    public void setColumnAutoresizingStyle (NSTableViewColumnAutoresizingStyle style)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setColumnAutoresizingStyle_1, style);
-    }
-
-    public void setCornerView (NSView cornerView)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setCornerView_1, cornerView !is null ? cornerView.id_ : null);
-    }
-
-    public void setDataSource (id aSource)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDataSource_1, aSource !is null ? aSource.id_ : null);
-    }
-
-    public void setDelegate (id delegatee)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id_ : null);
-    }
-
-    public void setDoubleAction (objc.SEL aSelector)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDoubleAction_1, aSelector);
-    }
-
-    public void setDraggingSourceOperationMask (NSDragOperation mask, bool isLocal)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
-    }
-
-    public void setDrawsGrid (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDrawsGrid_1, flag);
-    }
-
-    public void setDropRow (NSInteger row, NSTableViewDropOperation op)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDropRow_1dropOperation_1, row, op);
-    }
+public void setRowHeight(CGFloat rowHeight) {
+    OS.objc_msgSend(this.id, OS.sel_setRowHeight_, rowHeight);
+}
 
-    public void setGridColor (NSColor color)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setGridColor_1, color !is null ? color.id_ : null);
-    }
-
-    public void setGridStyleMask (NSUInteger gridType)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setGridStyleMask_1, gridType);
-    }
-
-    public void setHeaderView (NSTableHeaderView headerView)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setHeaderView_1, headerView !is null ? headerView.id_ : null);
-    }
-
-    public void setHighlightedTableColumn (NSTableColumn tc)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setHighlightedTableColumn_1, tc !is null ? tc.id_ : null);
-    }
+public void setUsesAlternatingRowBackgroundColors(bool useAlternatingRowColors) {
+    OS.objc_msgSend(this.id, OS.sel_setUsesAlternatingRowBackgroundColors_, useAlternatingRowColors);
+}
 
-    public void setIndicatorImage (NSImage anImage, NSTableColumn tc)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setIndicatorImage_1inTableColumn_1, anImage !is null ? anImage.id_ : null, tc !is null ? tc.id_ : null);
-    }
-
-    public void setIntercellSpacing (NSSize aSize)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setIntercellSpacing_1, aSize);
-    }
-
-    public void setRowHeight (CGFloat rowHeight)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setRowHeight_1, rowHeight);
-    }
-
-    public void setSelectionHighlightStyle (NSTableViewSelectionHighlightStyle selectionHighlightStyle)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setSelectionHighlightStyle_1, selectionHighlightStyle);
-    }
+public NSArray tableColumns() {
+    objc.id result = OS.objc_msgSend(this.id, OS.sel_tableColumns);
+    return result !is null ? new NSArray(result) : null;
+}
 
-    public void setSortDescriptors (NSArray array)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setSortDescriptors_1, array !is null ? array.id_ : null);
-    }
-
-    public void setUsesAlternatingRowBackgroundColors (bool useAlternatingRowColors)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setUsesAlternatingRowBackgroundColors_1, useAlternatingRowColors);
-    }
-
-    public void setVerticalMotionCanBeginDrag (bool flag)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setVerticalMotionCanBeginDrag_1, flag);
-    }
+public void tile() {
+    OS.objc_msgSend(this.id, OS.sel_tile);
+}
 
-    public void sizeLastColumnToFit ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_sizeLastColumnToFit);
-    }
-
-    public void sizeToFit ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_sizeToFit);
-    }
-
-    public NSArray sortDescriptors ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortDescriptors);
-        return result !is null ? new NSArray(result) : null;
-    }
-
-    public NSTableColumn tableColumnWithIdentifier (id identifier)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_tableColumnWithIdentifier_1, identifier !is null ? identifier.id_ : null);
-        return result !is null ? new NSTableColumn(result) : null;
-    }
+public bool usesAlternatingRowBackgroundColors() {
+    return OS.objc_msgSend_bool(this.id, OS.sel_usesAlternatingRowBackgroundColors);
+}
 
-    public NSArray tableColumns ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_tableColumns);
-        return result !is null ? new NSArray(result) : null;
-    }
-
-    public void textDidBeginEditing (NSNotification notification)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_textDidBeginEditing_1, notification !is null ? notification.id_ : null);
-    }
-
-    public void textDidChange (NSNotification notification)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_textDidChange_1, notification !is null ? notification.id_ : null);
-    }
-
-    public void textDidEndEditing (NSNotification notification)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_textDidEndEditing_1, notification !is null ? notification.id_ : null);
-    }
+public static objc.Class cellClass() {
+    return cast(objc.Class) OS.objc_msgSend(OS.class_NSTableView, OS.sel_cellClass);
+}
 
-    public bool textShouldBeginEditing (NSText textObject)
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_textShouldBeginEditing_1, textObject !is null ? textObject.id_ : null) !is null;
-    }
-
-    public bool textShouldEndEditing (NSText textObject)
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_textShouldEndEditing_1, textObject !is null ? textObject.id_ : null) !is null;
-    }
-
-    public void tile ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_tile);
-    }
-
-    public bool usesAlternatingRowBackgroundColors ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_usesAlternatingRowBackgroundColors) !is null;
-    }
-
-    public bool verticalMotionCanBeginDrag ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_verticalMotionCanBeginDrag) !is null;
-    }
+public static void setCellClass(objc.Class factoryId) {
+    OS.objc_msgSend(OS.class_NSTableView, OS.sel_setCellClass_, factoryId);
+}
 
 }