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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QCustomMenuItem_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QCustomMenuItem*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCustomMenuItem_fullSpan(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCustomMenuItem*) QtSupport::getQt(env, obj))->fullSpan();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCustomMenuItem_isSeparator(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCustomMenuItem*) QtSupport::getQt(env, obj))->isSeparator();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCustomMenuItem_setFont(JNIEnv *env, jobject obj, jobject font)
{
	((QCustomMenuItem*) QtSupport::getQt(env, obj))->setFont((QFont&) *(QFont *) QtSupport::getQt(env, font));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCustomMenuItem_paint(JNIEnv *env, jobject obj, jobject p, jobject cg, jboolean act, jboolean enabled, jint x, jint y, jint w, jint h)
{
	((QCustomMenuItem*) QtSupport::getQt(env, obj))->paint((QPainter*) QtSupport::getQt(env, p), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), (bool) act, (bool) enabled, (int) x, (int) y, (int) w, (int) h);
	return;
}

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

