/***************************************************************************
                            QSize.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 <qsize.h>
#include <qstring.h>
#include <qcstring.h>

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

class QSizeJBridge : public QSize
{
public:
	QSizeJBridge() : QSize() {}
	QSizeJBridge(int w, int h) : QSize(w, h) {}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSize_newQSize__II(JNIEnv *env, jobject obj, jint w, jint h)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSizeJBridge((int) w, (int) h));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSize_isNull(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizeJBridge*) QtSupport::getQt(env, obj))->isNull();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSize_isEmpty(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizeJBridge*) QtSupport::getQt(env, obj))->isEmpty();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSize_isValid(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizeJBridge*) QtSupport::getQt(env, obj))->isValid();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSize_width(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizeJBridge*) QtSupport::getQt(env, obj))->width();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSize_height(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizeJBridge*) QtSupport::getQt(env, obj))->height();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSize_setWidth(JNIEnv *env, jobject obj, jint w)
{
	((QSizeJBridge*) QtSupport::getQt(env, obj))->setWidth((int) w);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSize_setHeight(JNIEnv *env, jobject obj, jint h)
{
	((QSizeJBridge*) QtSupport::getQt(env, obj))->setHeight((int) h);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSize_transpose(JNIEnv *env, jobject obj)
{
	((QSizeJBridge*) QtSupport::getQt(env, obj))->transpose();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSize_expandedTo(JNIEnv *env, jobject obj, jobject arg1)
{
	QSize _s= ((QSizeJBridge*) QtSupport::getQt(env, obj))->expandedTo((QSize&) *(QSize *) QtSupport::getQt(env, arg1));
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSize_boundedTo(JNIEnv *env, jobject obj, jobject arg1)
{
	QSize _s= ((QSizeJBridge*) QtSupport::getQt(env, obj))->boundedTo((QSize&) *(QSize *) QtSupport::getQt(env, arg1));
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jshort JNICALL
Java_org_kde_qt_QSize_rwidth(JNIEnv *env, jobject obj)
{
	return (jshort) ((QSizeJBridge*) QtSupport::getQt(env, obj))->rwidth();
}

JNIEXPORT jshort JNICALL
Java_org_kde_qt_QSize_rheight(JNIEnv *env, jobject obj)
{
	return (jshort) ((QSizeJBridge*) QtSupport::getQt(env, obj))->rheight();
}

