view org.eclipse.draw2d/src/org/eclipse/draw2d/AccessibleBase.d @ 104:88652073d1c2

More work on icu
author Frank Benoit <benoit@tionex.de>
date Sat, 02 May 2009 11:27:24 +0200
parents bc29606a740c
children
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2000, 2005 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:
 *     Frank Benoit <benoit@tionex.de>
 *******************************************************************************/
module org.eclipse.draw2d.AccessibleBase;

import java.lang.all;

/**
 * The base class for accessible objects which provides accesibilty clients with a unique
 * ID.
 */
public class AccessibleBase {

/**
 * Returns the id of this accessible object using {@link Object#toHash()}.  
 * @return the id
 */
public final int getAccessibleID() {
    /* This assumes that the native implementation of toHash in Object is to
     * return the pointer to the Object, which should be U-unique.
     */
    int value = super.toHash();
    /*
     * Values -3, -2, and -1 are reserved by SWT's ACC class to have special meaning.
     * Therefore, a child cannot have this value.
     */
    if (value < 0)
        value -= 4;
    return value;
}

}