Mercurial > projects > dwt-mac
view dwt/internal/cocoa/NSBrowser.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2007 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 * * Port to the D Programming language: * Jacob Carlborg <jacob.carlborg@gmail.com> *******************************************************************************/ module dwt.internal.cocoa.NSBrowser; import dwt.internal.cocoa.id; import dwt.internal.cocoa.CGFloat; import dwt.internal.cocoa.NSArray; import dwt.internal.cocoa.NSCell; import dwt.internal.cocoa.NSColor; import dwt.internal.cocoa.NSControl; import dwt.internal.cocoa.NSEvent; import dwt.internal.cocoa.NSImage; import dwt.internal.cocoa.NSIndexSet; import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSMatrix; import dwt.internal.cocoa.NSPoint : NSPointPointer; import dwt.internal.cocoa.NSRect; import dwt.internal.cocoa.NSScroller; import dwt.internal.cocoa.NSString; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; public class NSBrowser : NSControl { public this () { super(); } public this (objc.id id) { super(id); } public bool acceptsArrowKeys () { return OS.objc_msgSend(this.id_, OS.sel_acceptsArrowKeys) !is null; } public void addColumn () { OS.objc_msgSend(this.id_, OS.sel_addColumn); } public bool allowsBranchSelection () { return OS.objc_msgSend(this.id_, OS.sel_allowsBranchSelection) !is null; } 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 NSColor backgroundColor () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); return result !is null ? new NSColor(result) : null; } public bool canDragRowsWithIndexes (NSIndexSet rowIndexes, NSInteger column, NSEvent event) { return OS.objc_msgSend(this.id_, OS.sel_canDragRowsWithIndexes_1inColumn_1withEvent_1, rowIndexes !is null ? rowIndexes.id_ : null, column, event !is null ? event.id_ : null) !is null; } public static objc.Class cellClass () { return cast(objc.Class) OS.objc_msgSend(OS.class_NSBrowser, OS.sel_cellClass); } public id cellPrototype () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_cellPrototype); return result !is null ? new id(result) : null; } public CGFloat columnContentWidthForColumnWidth (CGFloat columnWidth) { return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_columnContentWidthForColumnWidth_1, columnWidth); } public NSInteger columnOfMatrix (NSMatrix matrix) { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_columnOfMatrix_1, matrix !is null ? matrix.id_ : null); } public objc.id columnResizingType () { return OS.objc_msgSend(this.id_, OS.sel_columnResizingType); } public CGFloat columnWidthForColumnContentWidth (CGFloat columnContentWidth) { return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_columnWidthForColumnContentWidth_1, columnContentWidth); } public NSString columnsAutosaveName () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_columnsAutosaveName); return result !is null ? new NSString(result) : null; } public id delegatee () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate); return result !is null ? new id(result) : null; } public void displayAllColumns () { OS.objc_msgSend(this.id_, OS.sel_displayAllColumns); } public void displayColumn (NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_displayColumn_1, column); } public void doClick (id sender) { OS.objc_msgSend(this.id_, OS.sel_doClick_1, sender !is null ? sender.id_ : null); } public void doDoubleClick (id sender) { OS.objc_msgSend(this.id_, OS.sel_doDoubleClick_1, sender !is null ? sender.id_ : null); } public objc.SEL doubleAction () { return cast(objc.SEL) OS.objc_msgSend(this.id_, OS.sel_doubleAction); } public NSImage draggingImageForRowsWithIndexes (NSIndexSet rowIndexes, NSInteger column, NSEvent event, NSPointPointer dragImageOffset) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_draggingImageForRowsWithIndexes_1inColumn_1withEvent_1offset_1, rowIndexes !is null ? rowIndexes.id_ : null, column, event !is null ? event.id_ : null, dragImageOffset); return result !is null ? new NSImage(result) : null; } public void drawTitleOfColumn (NSInteger column, NSRect aRect) { OS.objc_msgSend(this.id_, OS.sel_drawTitleOfColumn_1inRect_1, column, aRect); } public NSInteger firstVisibleColumn () { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_firstVisibleColumn); } public NSRect frameOfColumn (NSInteger column) { NSRect result; OS.objc_msgSend_stret(&result, this.id_, OS.sel_frameOfColumn_1, column); return result; } public NSRect frameOfInsideOfColumn (NSInteger column) { NSRect result; OS.objc_msgSend_stret(&result, this.id_, OS.sel_frameOfInsideOfColumn_1, column); return result; } public bool hasHorizontalScroller () { return OS.objc_msgSend(this.id_, OS.sel_hasHorizontalScroller) !is null; } public bool isLoaded () { return OS.objc_msgSend(this.id_, OS.sel_isLoaded) !is null; } public bool isTitled () { return OS.objc_msgSend(this.id_, OS.sel_isTitled) !is null; } public NSInteger lastColumn () { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_lastColumn); } public NSInteger lastVisibleColumn () { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_lastVisibleColumn); } public void loadColumnZero () { OS.objc_msgSend(this.id_, OS.sel_loadColumnZero); } public id loadedCellAtRow (NSInteger row, NSInteger col) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_loadedCellAtRow_1column_1, row, col); return result !is null ? new id(result) : null; } public objc.Class matrixClass () { return cast(objc.Class) OS.objc_msgSend(this.id_, OS.sel_matrixClass); } public NSMatrix matrixInColumn (NSInteger column) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_matrixInColumn_1, column); return result !is null ? new NSMatrix(result) : null; } public NSInteger maxVisibleColumns () { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_maxVisibleColumns); } public CGFloat minColumnWidth () { return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_minColumnWidth); } public NSInteger numberOfVisibleColumns () { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfVisibleColumns); } public NSString path () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_path); return result !is null ? new NSString(result) : null; } public NSString pathSeparator () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_pathSeparator); return result !is null ? new NSString(result) : null; } public NSString pathToColumn (NSInteger column) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_pathToColumn_1, column); return result !is null ? new NSString(result) : null; } public bool prefersAllColumnUserResizing () { return OS.objc_msgSend(this.id_, OS.sel_prefersAllColumnUserResizing) !is null; } public void reloadColumn (NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_reloadColumn_1, column); } public static void removeSavedColumnsWithAutosaveName (NSString name) { OS.objc_msgSend(OS.class_NSBrowser, OS.sel_removeSavedColumnsWithAutosaveName_1, name !is null ? name.id_ : null); } public bool reusesColumns () { return OS.objc_msgSend(this.id_, OS.sel_reusesColumns) !is null; } public void scrollColumnToVisible (NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_scrollColumnToVisible_1, column); } public void scrollColumnsLeftBy (NSInteger shiftAmount) { OS.objc_msgSend(this.id_, OS.sel_scrollColumnsLeftBy_1, shiftAmount); } public void scrollColumnsRightBy (NSInteger shiftAmount) { OS.objc_msgSend(this.id_, OS.sel_scrollColumnsRightBy_1, shiftAmount); } public void scrollViaScroller (NSScroller sender) { OS.objc_msgSend(this.id_, OS.sel_scrollViaScroller_1, sender !is null ? sender.id_ : null); } public void selectAll (id sender) { OS.objc_msgSend(this.id_, OS.sel_selectAll_1, sender !is null ? sender.id_ : null); } public void selectRow (NSInteger row, NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_selectRow_1inColumn_1, row, column); } public void selectRowIndexes (NSIndexSet indexes, NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_selectRowIndexes_1inColumn_1, indexes !is null ? indexes.id_ : null, column); } public id selectedCell () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedCell); return result !is null ? new id(result) : null; } public id selectedCellInColumn (NSInteger column) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedCellInColumn_1, column); return result !is null ? new id(result) : null; } public NSArray selectedCells () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedCells); return result !is null ? new NSArray(result) : null; } public NSInteger selectedColumn () { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedColumn); } public NSInteger selectedRowInColumn (NSInteger column) { return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedRowInColumn_1, column); } public NSIndexSet selectedRowIndexesInColumn (NSInteger column) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRowIndexesInColumn_1, column); return result !is null ? new NSIndexSet(result) : null; } public bool sendAction () { return OS.objc_msgSend(this.id_, OS.sel_sendAction) !is null; } public bool sendsActionOnArrowKeys () { return OS.objc_msgSend(this.id_, OS.sel_sendsActionOnArrowKeys) !is null; } public bool separatesColumns () { return OS.objc_msgSend(this.id_, OS.sel_separatesColumns) !is null; } public void setAcceptsArrowKeys (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setAcceptsArrowKeys_1, flag); } public void setAllowsBranchSelection (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setAllowsBranchSelection_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 setAllowsTypeSelect (bool value) { OS.objc_msgSend(this.id_, OS.sel_setAllowsTypeSelect_1, value); } public void setBackgroundColor (NSColor color) { OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null); } //public void setCellClass(Class factoryId) { // OS.objc_msgSend(this.id_, OS.sel_setCellClass_1, factoryId); //} public void setCellPrototype (NSCell aCell) { OS.objc_msgSend(this.id_, OS.sel_setCellPrototype_1, aCell !is null ? aCell.id_ : null); } public void setColumnResizingType (objc.id columnResizingType) { OS.objc_msgSend(this.id_, OS.sel_setColumnResizingType_1, columnResizingType); } public void setColumnsAutosaveName (NSString name) { OS.objc_msgSend(this.id_, OS.sel_setColumnsAutosaveName_1, name !is null ? name.id_ : null); } public void setDelegate (id anObject) { OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, anObject !is null ? anObject.id_ : null); } public void setDoubleAction (objc.SEL aSelector) { OS.objc_msgSend(this.id_, OS.sel_setDoubleAction_1, aSelector); } public void setDraggingSourceOperationMask (objc.id mask, bool isLocal) { OS.objc_msgSend(this.id_, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal); } public void setHasHorizontalScroller (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setHasHorizontalScroller_1, flag); } public void setLastColumn (NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_setLastColumn_1, column); } public void setMatrixClass (objc.Class factoryId) { OS.objc_msgSend(this.id_, OS.sel_setMatrixClass_1, factoryId); } public void setMaxVisibleColumns (NSInteger columnCount) { OS.objc_msgSend(this.id_, OS.sel_setMaxVisibleColumns_1, columnCount); } public void setMinColumnWidth (CGFloat columnWidth) { OS.objc_msgSend(this.id_, OS.sel_setMinColumnWidth_1, columnWidth); } public bool setPath (NSString path) { return OS.objc_msgSend(this.id_, OS.sel_setPath_1, path !is null ? path.id_ : null) !is null; } public void setPathSeparator (NSString newString) { OS.objc_msgSend(this.id_, OS.sel_setPathSeparator_1, newString !is null ? newString.id_ : null); } public void setPrefersAllColumnUserResizing (bool prefersAllColumnResizing) { OS.objc_msgSend(this.id_, OS.sel_setPrefersAllColumnUserResizing_1, prefersAllColumnResizing); } public void setReusesColumns (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setReusesColumns_1, flag); } public void setSendsActionOnArrowKeys (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setSendsActionOnArrowKeys_1, flag); } public void setSeparatesColumns (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setSeparatesColumns_1, flag); } public void setTakesTitleFromPreviousColumn (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setTakesTitleFromPreviousColumn_1, flag); } public void setTitle (NSString aString, NSInteger column) { OS.objc_msgSend(this.id_, OS.sel_setTitle_1ofColumn_1, aString !is null ? aString.id_ : null, column); } public void setTitled (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setTitled_1, flag); } public void setWidth (CGFloat columnWidth, NSInteger columnIndex) { OS.objc_msgSend(this.id_, OS.sel_setWidth_1ofColumn_1, columnWidth, columnIndex); } public bool takesTitleFromPreviousColumn () { return OS.objc_msgSend(this.id_, OS.sel_takesTitleFromPreviousColumn) !is null; } public void tile () { OS.objc_msgSend(this.id_, OS.sel_tile); } public NSRect titleFrameOfColumn (NSInteger column) { NSRect result; OS.objc_msgSend_stret(&result, this.id_, OS.sel_titleFrameOfColumn_1, column); return result; } public CGFloat titleHeight () { return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_titleHeight); } public NSString titleOfColumn (NSInteger column) { objc.id result = OS.objc_msgSend(this.id_, OS.sel_titleOfColumn_1, column); return result !is null ? new NSString(result) : null; } public void updateScroller () { OS.objc_msgSend(this.id_, OS.sel_updateScroller); } public void validateVisibleColumns () { OS.objc_msgSend(this.id_, OS.sel_validateVisibleColumns); } public CGFloat widthOfColumn (NSInteger column) { return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_widthOfColumn_1, column); } }