/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */

package com.sun.rain.graphics;

import com.sun.rain.shapes.Shape;

import com.sun.glass.ui.View;

import java.nio.ByteBuffer;

import java.util.Map;
import java.util.HashMap;

public abstract class Graphics3D extends Graphics2D
{
    static native void _initIDs();
    static
    {
        System.loadLibrary("rain");

        _initIDs();
    }

    private long ptr;

    static final private Map capabilities = new HashMap();
    static
    {
        Graphics3D.capabilities.put(View.Capability.k3dKey, new Boolean(true));
        Graphics3D.capabilities.put(View.Capability.kSyncKey, new Boolean(true));
    }

    @Override
    native long _createGraphics();
    public Graphics3D()
    {
        this.ptr = _createGraphics();
    }

    @Override
    public Map getCapabilities()
    {
        return Graphics3D.capabilities;
    }

    @Override
    native void _setColor(long ptr, Color color);

    @Override
    native void _setFont(long ptr, Font font);

    @Override
    native void _drawString(long ptr, String string, float x, float y);

    @Override
    native void _fillRect(long ptr, float x, float y, float width, float height);

    @Override
    native void _fillEllipse(long ptr, float x, float y, float width, float height);

    @Override
    native void _fillShape(long ptr, Shape shape, ByteBuffer buffer, float x, float y);

    @Override
    native void _drawImage(long ptr, Image image, float x, float y, float width, float height);

    @Override
    native void _translate(long ptr, float x, float y);

    @Override
    native void _scale(long ptr, float x, float y);

    @Override
    native void _rotate(long ptr, float a);

    @Override
    native void _pushCTM(long ptr);

    @Override
    native void _popCTM(long ptr);

    @Override
    native void _clip(long ptr, float x, float y, float width, float height);

    @Override
    native void _pushClip(long ptr);

    @Override
    native void _popClip(long ptr);
    
    @Override
    native void _begin(long ptr, long viewPtr);
    
    @Override
    native void _end(long ptr);
}
