Mercurial > projects > dwt-mac
view dwt/internal/cocoa/id.d @ 130:3d4579727e0e
Fixes #2 and #3
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 10 Feb 2009 21:01:24 +0100 |
parents | d8635bb48c7c |
children |
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 <doob@me.com> *******************************************************************************/ module dwt.internal.cocoa.id; import dwt.dwthelper.utils; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; /** * @jniclass flags=no_gen */ public class id { public objc.id id; public this() { } public this(objc.id id) { this.id = id; } public this(dwt.internal.cocoa.id.id id) { this.id = id !is null ? id.id : null; } public objc.id objc_getClass() { String name = this.classinfo.name; int index = name.lastIndexOf('.'); if (index !is -1) name = name.substring(index + 1); return OS.objc_getClass(name); } }