/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2004 the Java-Gnome Team, all rights reserved.
 *
 * The Java-Gnome bindings library is free software distributed under
 * the terms of the GNU Library General Public License version 2.
 */

package org.gnu.gdk;

import org.gnu.glib.Handle;

/**
 * 
 */
public class EventMotion extends Event {
    /**
     * Promotion constructor. Construct the specific event object by promoting
     * (sharing the <tt>Handle</tt> object of) the base <tt>Event</tt>.
     */
    public EventMotion(Event evt) {
        // We share the handle with both instances. This avoids
        // copying the event (via the constructor ( super( evt ) ).
        // It is more of a "promotion" constructor.
        super(evt.getHandle());
    }

    public EventMotion(Handle handle) {
        super(handle);
    }

    public Window getWindow() {
        return Window.getWindowFromHandle(getWindow(getHandle()));
    }

    public boolean getSendEvent() {
        return getSendEvent(getHandle());
    }

    public int getTimeMillis() {
        return getTime(getHandle());
    }

    public double getX() {
        return getX(getHandle());
    }

    public double getY() {
        return getY(getHandle());
    }

    public ModifierType getState() {
        return ModifierType.intern(getState(getHandle()));
    }

    public boolean isHint() {
        return getIsHint(getHandle()) == 1;
    }

    public Device getDevice() {
        return Device.getDeviceFromHandle(getDevice(getHandle()));
    }

    public double getXRoot() {
        return getXRoot(getHandle());
    }

    public double getYRoot() {
        return getYRoot(getHandle());
    }

    native static final protected Handle getWindow(Handle obj);

    native static final protected boolean getSendEvent(Handle obj);

    native static final protected int getTime(Handle obj);

    native static final protected double getX(Handle obj);

    native static final protected double getY(Handle obj);

    native static final protected int getState(Handle obj);

    native static final protected int getIsHint(Handle obj);

    native static final protected Handle getDevice(Handle obj);

    native static final protected double getXRoot(Handle obj);

    native static final protected double getYRoot(Handle obj);
}
