/*******************************************************************************
 * Copyright (c) 2009, 2019 IBM Corporation and others. All rights reserved.
 * The contents of this file are made available under the terms
 * of the GNU Lesser General Public License (LGPL) Version 2.1 that
 * accompanies this distribution (lgpl-v21.txt).  The LGPL is also
 * available at http://www.gnu.org/licenses/lgpl.html.  If the version
 * of the LGPL at http://www.gnu.org is different to the version of
 * the LGPL accompanying this distribution and there is any conflict
 * between the two license versions, the terms of the LGPL accompanying
 * this distribution shall govern.
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/* Note: This file was auto-generated by org.eclipse.swt.tools.internal.JNIGenerator */
/* DO NOT EDIT - your changes will be lost. */

#include "swt.h"
#include "webkit_win32_structs.h"

#ifndef NO_JSClassDefinition
typedef struct JSClassDefinition_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID version, attributes, className, parentClass, staticValues, staticFunctions, initialize, finalize, hasProperty, getProperty, setProperty, deleteProperty, getPropertyNames, callAsFunction, callAsConstructor, hasInstance, convertToType;
} JSClassDefinition_FID_CACHE;

JSClassDefinition_FID_CACHE JSClassDefinitionFc;

void cacheJSClassDefinitionFields(JNIEnv *env, jobject lpObject)
{
	if (JSClassDefinitionFc.cached) return;
	JSClassDefinitionFc.clazz = env->GetObjectClass(lpObject);
	JSClassDefinitionFc.version = env->GetFieldID(JSClassDefinitionFc.clazz, "version", "I");
	JSClassDefinitionFc.attributes = env->GetFieldID(JSClassDefinitionFc.clazz, "attributes", "I");
	JSClassDefinitionFc.className = env->GetFieldID(JSClassDefinitionFc.clazz, "className", "J");
	JSClassDefinitionFc.parentClass = env->GetFieldID(JSClassDefinitionFc.clazz, "parentClass", "J");
	JSClassDefinitionFc.staticValues = env->GetFieldID(JSClassDefinitionFc.clazz, "staticValues", "J");
	JSClassDefinitionFc.staticFunctions = env->GetFieldID(JSClassDefinitionFc.clazz, "staticFunctions", "J");
	JSClassDefinitionFc.initialize = env->GetFieldID(JSClassDefinitionFc.clazz, "initialize", "J");
	JSClassDefinitionFc.finalize = env->GetFieldID(JSClassDefinitionFc.clazz, "finalize", "J");
	JSClassDefinitionFc.hasProperty = env->GetFieldID(JSClassDefinitionFc.clazz, "hasProperty", "J");
	JSClassDefinitionFc.getProperty = env->GetFieldID(JSClassDefinitionFc.clazz, "getProperty", "J");
	JSClassDefinitionFc.setProperty = env->GetFieldID(JSClassDefinitionFc.clazz, "setProperty", "J");
	JSClassDefinitionFc.deleteProperty = env->GetFieldID(JSClassDefinitionFc.clazz, "deleteProperty", "J");
	JSClassDefinitionFc.getPropertyNames = env->GetFieldID(JSClassDefinitionFc.clazz, "getPropertyNames", "J");
	JSClassDefinitionFc.callAsFunction = env->GetFieldID(JSClassDefinitionFc.clazz, "callAsFunction", "J");
	JSClassDefinitionFc.callAsConstructor = env->GetFieldID(JSClassDefinitionFc.clazz, "callAsConstructor", "J");
	JSClassDefinitionFc.hasInstance = env->GetFieldID(JSClassDefinitionFc.clazz, "hasInstance", "J");
	JSClassDefinitionFc.convertToType = env->GetFieldID(JSClassDefinitionFc.clazz, "convertToType", "J");
	JSClassDefinitionFc.cached = 1;
}

JSClassDefinition *getJSClassDefinitionFields(JNIEnv *env, jobject lpObject, JSClassDefinition *lpStruct)
{
	if (!JSClassDefinitionFc.cached) cacheJSClassDefinitionFields(env, lpObject);
	lpStruct->version = env->GetIntField(lpObject, JSClassDefinitionFc.version);
	lpStruct->attributes = (JSClassAttributes)env->GetIntField(lpObject, JSClassDefinitionFc.attributes);
	lpStruct->className = (const char*)env->GetLongField(lpObject, JSClassDefinitionFc.className);
	lpStruct->parentClass = (JSClassRef)env->GetLongField(lpObject, JSClassDefinitionFc.parentClass);
	lpStruct->staticValues = (const JSStaticValue*)env->GetLongField(lpObject, JSClassDefinitionFc.staticValues);
	lpStruct->staticFunctions = (const JSStaticFunction*)env->GetLongField(lpObject, JSClassDefinitionFc.staticFunctions);
	lpStruct->initialize = (JSObjectInitializeCallback)env->GetLongField(lpObject, JSClassDefinitionFc.initialize);
	lpStruct->finalize = (JSObjectFinalizeCallback)env->GetLongField(lpObject, JSClassDefinitionFc.finalize);
	lpStruct->hasProperty = (JSObjectHasPropertyCallback)env->GetLongField(lpObject, JSClassDefinitionFc.hasProperty);
	lpStruct->getProperty = (JSObjectGetPropertyCallback)env->GetLongField(lpObject, JSClassDefinitionFc.getProperty);
	lpStruct->setProperty = (JSObjectSetPropertyCallback)env->GetLongField(lpObject, JSClassDefinitionFc.setProperty);
	lpStruct->deleteProperty = (JSObjectDeletePropertyCallback)env->GetLongField(lpObject, JSClassDefinitionFc.deleteProperty);
	lpStruct->getPropertyNames = (JSObjectGetPropertyNamesCallback)env->GetLongField(lpObject, JSClassDefinitionFc.getPropertyNames);
	lpStruct->callAsFunction = (JSObjectCallAsFunctionCallback)env->GetLongField(lpObject, JSClassDefinitionFc.callAsFunction);
	lpStruct->callAsConstructor = (JSObjectCallAsConstructorCallback)env->GetLongField(lpObject, JSClassDefinitionFc.callAsConstructor);
	lpStruct->hasInstance = (JSObjectHasInstanceCallback)env->GetLongField(lpObject, JSClassDefinitionFc.hasInstance);
	lpStruct->convertToType = (JSObjectConvertToTypeCallback)env->GetLongField(lpObject, JSClassDefinitionFc.convertToType);
	return lpStruct;
}

void setJSClassDefinitionFields(JNIEnv *env, jobject lpObject, JSClassDefinition *lpStruct)
{
	if (!JSClassDefinitionFc.cached) cacheJSClassDefinitionFields(env, lpObject);
	env->SetIntField(lpObject, JSClassDefinitionFc.version, (jint)lpStruct->version);
	env->SetIntField(lpObject, JSClassDefinitionFc.attributes, (jint)lpStruct->attributes);
	env->SetLongField(lpObject, JSClassDefinitionFc.className, (jlong)lpStruct->className);
	env->SetLongField(lpObject, JSClassDefinitionFc.parentClass, (jlong)lpStruct->parentClass);
	env->SetLongField(lpObject, JSClassDefinitionFc.staticValues, (jlong)lpStruct->staticValues);
	env->SetLongField(lpObject, JSClassDefinitionFc.staticFunctions, (jlong)lpStruct->staticFunctions);
	env->SetLongField(lpObject, JSClassDefinitionFc.initialize, (jlong)lpStruct->initialize);
	env->SetLongField(lpObject, JSClassDefinitionFc.finalize, (jlong)lpStruct->finalize);
	env->SetLongField(lpObject, JSClassDefinitionFc.hasProperty, (jlong)lpStruct->hasProperty);
	env->SetLongField(lpObject, JSClassDefinitionFc.getProperty, (jlong)lpStruct->getProperty);
	env->SetLongField(lpObject, JSClassDefinitionFc.setProperty, (jlong)lpStruct->setProperty);
	env->SetLongField(lpObject, JSClassDefinitionFc.deleteProperty, (jlong)lpStruct->deleteProperty);
	env->SetLongField(lpObject, JSClassDefinitionFc.getPropertyNames, (jlong)lpStruct->getPropertyNames);
	env->SetLongField(lpObject, JSClassDefinitionFc.callAsFunction, (jlong)lpStruct->callAsFunction);
	env->SetLongField(lpObject, JSClassDefinitionFc.callAsConstructor, (jlong)lpStruct->callAsConstructor);
	env->SetLongField(lpObject, JSClassDefinitionFc.hasInstance, (jlong)lpStruct->hasInstance);
	env->SetLongField(lpObject, JSClassDefinitionFc.convertToType, (jlong)lpStruct->convertToType);
}
#endif

