/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */
package com.sun.glass.ui.win;

import com.sun.glass.ui.Application;
import com.sun.glass.ui.Timer;

/**
 * MS Windows platform implementation class for Timer.
 *
 * @author Anthony Petrov
 */
final class WinTimer extends Timer {
    protected WinTimer(Runnable runnable) {
        super(runnable);
    }

    private static final int minPeriod, maxPeriod;

    native private static int _getMinPeriod();
    native private static int _getMaxPeriod();

    static {
        Application.loadNativeLibrary();
        minPeriod = _getMinPeriod();
        maxPeriod = _getMaxPeriod();
    }

    static int getMinPeriod_impl() {
        return minPeriod;
    }

    static int getMaxPeriod_impl() {
        return maxPeriod;
    }

    @Override native protected long _start(Runnable runnable, int period);
    @Override native protected void _stop(long timer);
}

