/***************************************************************************
                            QGLFormat.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

#define _BOOL_H_
#include <qgl.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QGLFormat.h>

class QGLFormatJBridge : public QGLFormat
{
public:
	QGLFormatJBridge() : QGLFormat() {}
	QGLFormatJBridge(int options, int plane) : QGLFormat(options, plane) {}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_newQGLFormat__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QGLFormatJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_newQGLFormat__II(JNIEnv *env, jobject obj, jint options, jint plane)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QGLFormatJBridge((int) options, (int) plane));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_newQGLFormat__I(JNIEnv *env, jobject obj, jint options)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QGLFormatJBridge((int) options, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_doubleBuffer(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->doubleBuffer();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setDoubleBuffer(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setDoubleBuffer((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_depth(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->depth();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setDepth(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setDepth((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_rgba(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->rgba();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setRgba(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setRgba((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_alpha(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->alpha();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setAlpha(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setAlpha((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_accum(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->accum();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setAccum(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setAccum((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_stencil(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->stencil();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setStencil(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setStencil((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_stereo(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->stereo();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setStereo(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setStereo((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_directRendering(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->directRendering();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setDirectRendering(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setDirectRendering((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_hasOverlay(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->hasOverlay();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setOverlay(JNIEnv *env, jobject obj, jboolean enable)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setOverlay((bool) enable);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGLFormat_plane(JNIEnv *env, jobject obj)
{
	return (jint) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->plane();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setPlane(JNIEnv *env, jobject obj, jint plane)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setPlane((int) plane);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setOption(JNIEnv *env, jobject obj, jint opt)
{
	((QGLFormatJBridge*) QtSupport::getQt(env, obj))->setOption((QGLFormat::FormatOption) opt);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_testOption(JNIEnv *env, jobject obj, jint opt)
{
	return (jboolean) ((QGLFormatJBridge*) QtSupport::getQt(env, obj))->testOption((QGLFormat::FormatOption) opt);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QGLFormat_defaultFormat(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QGLFormat (QGLFormatJBridge::defaultFormat()), "org.kde.qt.QGLFormat", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setDefaultFormat(JNIEnv *env, jclass obj, jobject f)
{
	QGLFormatJBridge::setDefaultFormat((QGLFormat&) *(QGLFormat *) QtSupport::getQt(env, f));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QGLFormat_defaultOverlayFormat(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QGLFormat (QGLFormatJBridge::defaultOverlayFormat()), "org.kde.qt.QGLFormat", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGLFormat_setDefaultOverlayFormat(JNIEnv *env, jclass obj, jobject f)
{
	QGLFormatJBridge::setDefaultOverlayFormat((QGLFormat&) *(QGLFormat *) QtSupport::getQt(env, f));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_hasOpenGL(JNIEnv *env, jclass obj)
{
	return (jboolean) QGLFormatJBridge::hasOpenGL();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QGLFormat_hasOpenGLOverlays(JNIEnv *env, jclass obj)
{
	return (jboolean) QGLFormatJBridge::hasOpenGLOverlays();
}

