Mercurial > projects > dwt-mac
view dwt/internal/cocoa/NSIndexSet.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
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.NSIndexSet; import dwt.internal.cocoa.id; import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSObject; import dwt.internal.cocoa.NSRange; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; public class NSIndexSet : NSObject { public this () { super(); } public this (objc.id id) { super(id); } public bool containsIndex (NSUInteger value) { return OS.objc_msgSend(this.id, OS.sel_containsIndex_1, value) !is null; } public bool containsIndexes (NSIndexSet indexSet) { return OS.objc_msgSend(this.id, OS.sel_containsIndexes_1, indexSet !is null ? indexSet.id : null) !is null; } public bool containsIndexesInRange (NSRange range) { return OS.objc_msgSend(this.id, OS.sel_containsIndexesInRange_1, range) !is null; } public NSUInteger count () { return OS.objc_msgSend(this.id, OS.sel_count); } public NSUInteger countOfIndexesInRange (NSRange range) { return OS.objc_msgSend(this.id, OS.sel_countOfIndexesInRange_1, range); } public NSUInteger firstIndex () { return OS.objc_msgSend(this.id, OS.sel_firstIndex); } public NSUInteger getIndexes (NSUInteger* indexBuffer, NSUInteger bufferSize, NSRangePointer range) { return OS.objc_msgSend(this.id, OS.sel_getIndexes_1maxCount_1inIndexRange_1, indexBuffer, bufferSize, range); } public NSUInteger indexGreaterThanIndex (NSUInteger value) { return OS.objc_msgSend(this.id, OS.sel_indexGreaterThanIndex_1, value); } public NSUInteger indexGreaterThanOrEqualToIndex (NSUInteger value) { return OS.objc_msgSend(this.id, OS.sel_indexGreaterThanOrEqualToIndex_1, value); } public NSUInteger indexLessThanIndex (NSUInteger value) { return OS.objc_msgSend(this.id, OS.sel_indexLessThanIndex_1, value); } public NSUInteger indexLessThanOrEqualToIndex (NSUInteger value) { return OS.objc_msgSend(this.id, OS.sel_indexLessThanOrEqualToIndex_1, value); } public static id indexSet () { objc.id result = OS.objc_msgSend(OS.class_NSIndexSet, OS.sel_indexSet); return result !is null ? new id(result) : null; } public static id indexSetWithIndex (NSUInteger value) { objc.id result = OS.objc_msgSend(OS.class_NSIndexSet, OS.sel_indexSetWithIndex_1, value); return result !is null ? new id(result) : null; } public static id indexSetWithIndexesInRange (NSRange range) { objc.id result = OS.objc_msgSend(OS.class_NSIndexSet, OS.sel_indexSetWithIndexesInRange_1, range); return result !is null ? new id(result) : null; } public id initWithIndex (NSUInteger value) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithIndex_1, value); return result !is null ? new id(result) : null; } public id initWithIndexSet (NSIndexSet indexSet) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithIndexSet_1, indexSet !is null ? indexSet.id : null); return result !is null ? new id(result) : null; } public id initWithIndexesInRange (NSRange range) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithIndexesInRange_1, range); return result !is null ? new id(result) : null; } public bool intersectsIndexesInRange (NSRange range) { return OS.objc_msgSend(this.id, OS.sel_intersectsIndexesInRange_1, range) !is null; } public bool isEqualToIndexSet (NSIndexSet indexSet) { return OS.objc_msgSend(this.id, OS.sel_isEqualToIndexSet_1, indexSet !is null ? indexSet.id : null) !is null; } public NSUInteger lastIndex () { return OS.objc_msgSend(this.id, OS.sel_lastIndex); } }