/*******************************************************************************
 * Copyright (c) 2000, 2019 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * 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 "os_structs.h"

#ifndef NO_CGAffineTransform
typedef struct CGAffineTransform_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID a, b, c, d, tx, ty;
} CGAffineTransform_FID_CACHE;

CGAffineTransform_FID_CACHE CGAffineTransformFc;

void cacheCGAffineTransformFields(JNIEnv *env, jobject lpObject)
{
	if (CGAffineTransformFc.cached) return;
	CGAffineTransformFc.clazz = (*env)->GetObjectClass(env, lpObject);
	CGAffineTransformFc.a = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "a", "D");
	CGAffineTransformFc.b = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "b", "D");
	CGAffineTransformFc.c = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "c", "D");
	CGAffineTransformFc.d = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "d", "D");
	CGAffineTransformFc.tx = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "tx", "D");
	CGAffineTransformFc.ty = (*env)->GetFieldID(env, CGAffineTransformFc.clazz, "ty", "D");
	CGAffineTransformFc.cached = 1;
}

CGAffineTransform *getCGAffineTransformFields(JNIEnv *env, jobject lpObject, CGAffineTransform *lpStruct)
{
	if (!CGAffineTransformFc.cached) cacheCGAffineTransformFields(env, lpObject);
	lpStruct->a = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGAffineTransformFc.a);
	lpStruct->b = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGAffineTransformFc.b);
	lpStruct->c = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGAffineTransformFc.c);
	lpStruct->d = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGAffineTransformFc.d);
	lpStruct->tx = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGAffineTransformFc.tx);
	lpStruct->ty = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGAffineTransformFc.ty);
	return lpStruct;
}

void setCGAffineTransformFields(JNIEnv *env, jobject lpObject, CGAffineTransform *lpStruct)
{
	if (!CGAffineTransformFc.cached) cacheCGAffineTransformFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, CGAffineTransformFc.a, (jdouble)lpStruct->a);
	(*env)->SetDoubleField(env, lpObject, CGAffineTransformFc.b, (jdouble)lpStruct->b);
	(*env)->SetDoubleField(env, lpObject, CGAffineTransformFc.c, (jdouble)lpStruct->c);
	(*env)->SetDoubleField(env, lpObject, CGAffineTransformFc.d, (jdouble)lpStruct->d);
	(*env)->SetDoubleField(env, lpObject, CGAffineTransformFc.tx, (jdouble)lpStruct->tx);
	(*env)->SetDoubleField(env, lpObject, CGAffineTransformFc.ty, (jdouble)lpStruct->ty);
}
#endif

#ifndef NO_CGPathElement
typedef struct CGPathElement_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID type, points;
} CGPathElement_FID_CACHE;

CGPathElement_FID_CACHE CGPathElementFc;

void cacheCGPathElementFields(JNIEnv *env, jobject lpObject)
{
	if (CGPathElementFc.cached) return;
	CGPathElementFc.clazz = (*env)->GetObjectClass(env, lpObject);
	CGPathElementFc.type = (*env)->GetFieldID(env, CGPathElementFc.clazz, "type", "I");
	CGPathElementFc.points = (*env)->GetFieldID(env, CGPathElementFc.clazz, "points", "J");
	CGPathElementFc.cached = 1;
}

CGPathElement *getCGPathElementFields(JNIEnv *env, jobject lpObject, CGPathElement *lpStruct)
{
	if (!CGPathElementFc.cached) cacheCGPathElementFields(env, lpObject);
	lpStruct->type = (CGPathElementType)(*env)->GetIntField(env, lpObject, CGPathElementFc.type);
	lpStruct->points = (CGPoint*)(*env)->GetLongField(env, lpObject, CGPathElementFc.points);
	return lpStruct;
}

void setCGPathElementFields(JNIEnv *env, jobject lpObject, CGPathElement *lpStruct)
{
	if (!CGPathElementFc.cached) cacheCGPathElementFields(env, lpObject);
	(*env)->SetIntField(env, lpObject, CGPathElementFc.type, (jint)lpStruct->type);
	(*env)->SetLongField(env, lpObject, CGPathElementFc.points, (jlong)lpStruct->points);
}
#endif

#ifndef NO_CGPoint
typedef struct CGPoint_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID x, y;
} CGPoint_FID_CACHE;

CGPoint_FID_CACHE CGPointFc;

void cacheCGPointFields(JNIEnv *env, jobject lpObject)
{
	if (CGPointFc.cached) return;
	CGPointFc.clazz = (*env)->GetObjectClass(env, lpObject);
	CGPointFc.x = (*env)->GetFieldID(env, CGPointFc.clazz, "x", "D");
	CGPointFc.y = (*env)->GetFieldID(env, CGPointFc.clazz, "y", "D");
	CGPointFc.cached = 1;
}

CGPoint *getCGPointFields(JNIEnv *env, jobject lpObject, CGPoint *lpStruct)
{
	if (!CGPointFc.cached) cacheCGPointFields(env, lpObject);
	lpStruct->x = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGPointFc.x);
	lpStruct->y = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGPointFc.y);
	return lpStruct;
}

void setCGPointFields(JNIEnv *env, jobject lpObject, CGPoint *lpStruct)
{
	if (!CGPointFc.cached) cacheCGPointFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, CGPointFc.x, (jdouble)lpStruct->x);
	(*env)->SetDoubleField(env, lpObject, CGPointFc.y, (jdouble)lpStruct->y);
}
#endif

#ifndef NO_CGRect
typedef struct CGRect_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID origin, size;
} CGRect_FID_CACHE;

CGRect_FID_CACHE CGRectFc;

void cacheCGRectFields(JNIEnv *env, jobject lpObject)
{
	if (CGRectFc.cached) return;
	CGRectFc.clazz = (*env)->GetObjectClass(env, lpObject);
	CGRectFc.origin = (*env)->GetFieldID(env, CGRectFc.clazz, "origin", "Lorg/eclipse/swt/internal/cocoa/CGPoint;");
	CGRectFc.size = (*env)->GetFieldID(env, CGRectFc.clazz, "size", "Lorg/eclipse/swt/internal/cocoa/CGSize;");
	CGRectFc.cached = 1;
}

CGRect *getCGRectFields(JNIEnv *env, jobject lpObject, CGRect *lpStruct)
{
	if (!CGRectFc.cached) cacheCGRectFields(env, lpObject);
	{
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.origin);
	if (lpObject1 != NULL) getCGPointFields(env, lpObject1, &lpStruct->origin);
	}
	{
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.size);
	if (lpObject1 != NULL) getCGSizeFields(env, lpObject1, &lpStruct->size);
	}
	return lpStruct;
}

void setCGRectFields(JNIEnv *env, jobject lpObject, CGRect *lpStruct)
{
	if (!CGRectFc.cached) cacheCGRectFields(env, lpObject);
	{
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.origin);
	if (lpObject1 != NULL) setCGPointFields(env, lpObject1, &lpStruct->origin);
	}
	{
	jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.size);
	if (lpObject1 != NULL) setCGSizeFields(env, lpObject1, &lpStruct->size);
	}
}
#endif

#ifndef NO_CGSize
typedef struct CGSize_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID width, height;
} CGSize_FID_CACHE;

CGSize_FID_CACHE CGSizeFc;

void cacheCGSizeFields(JNIEnv *env, jobject lpObject)
{
	if (CGSizeFc.cached) return;
	CGSizeFc.clazz = (*env)->GetObjectClass(env, lpObject);
	CGSizeFc.width = (*env)->GetFieldID(env, CGSizeFc.clazz, "width", "D");
	CGSizeFc.height = (*env)->GetFieldID(env, CGSizeFc.clazz, "height", "D");
	CGSizeFc.cached = 1;
}

CGSize *getCGSizeFields(JNIEnv *env, jobject lpObject, CGSize *lpStruct)
{
	if (!CGSizeFc.cached) cacheCGSizeFields(env, lpObject);
	lpStruct->width = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGSizeFc.width);
	lpStruct->height = (CGFloat)(*env)->GetDoubleField(env, lpObject, CGSizeFc.height);
	return lpStruct;
}

void setCGSizeFields(JNIEnv *env, jobject lpObject, CGSize *lpStruct)
{
	if (!CGSizeFc.cached) cacheCGSizeFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, CGSizeFc.width, (jdouble)lpStruct->width);
	(*env)->SetDoubleField(env, lpObject, CGSizeFc.height, (jdouble)lpStruct->height);
}
#endif

#ifndef NO_NSAffineTransformStruct
typedef struct NSAffineTransformStruct_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID m11, m12, m21, m22, tX, tY;
} NSAffineTransformStruct_FID_CACHE;

NSAffineTransformStruct_FID_CACHE NSAffineTransformStructFc;

void cacheNSAffineTransformStructFields(JNIEnv *env, jobject lpObject)
{
	if (NSAffineTransformStructFc.cached) return;
	NSAffineTransformStructFc.clazz = (*env)->GetObjectClass(env, lpObject);
	NSAffineTransformStructFc.m11 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m11", "D");
	NSAffineTransformStructFc.m12 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m12", "D");
	NSAffineTransformStructFc.m21 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m21", "D");
	NSAffineTransformStructFc.m22 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m22", "D");
	NSAffineTransformStructFc.tX = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "tX", "D");
	NSAffineTransformStructFc.tY = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "tY", "D");
	NSAffineTransformStructFc.cached = 1;
}

NSAffineTransformStruct *getNSAffineTransformStructFields(JNIEnv *env, jobject lpObject, NSAffineTransformStruct *lpStruct)
{
	if (!NSAffineTransformStructFc.cached) cacheNSAffineTransformStructFields(env, lpObject);
	lpStruct->m11 = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSAffineTransformStructFc.m11);
	lpStruct->m12 = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSAffineTransformStructFc.m12);
	lpStruct->m21 = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSAffineTransformStructFc.m21);
	lpStruct->m22 = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSAffineTransformStructFc.m22);
	lpStruct->tX = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSAffineTransformStructFc.tX);
	lpStruct->tY = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSAffineTransformStructFc.tY);
	return lpStruct;
}

void setNSAffineTransformStructFields(JNIEnv *env, jobject lpObject, NSAffineTransformStruct *lpStruct)
{
	if (!NSAffineTransformStructFc.cached) cacheNSAffineTransformStructFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, NSAffineTransformStructFc.m11, (jdouble)lpStruct->m11);
	(*env)->SetDoubleField(env, lpObject, NSAffineTransformStructFc.m12, (jdouble)lpStruct->m12);
	(*env)->SetDoubleField(env, lpObject, NSAffineTransformStructFc.m21, (jdouble)lpStruct->m21);
	(*env)->SetDoubleField(env, lpObject, NSAffineTransformStructFc.m22, (jdouble)lpStruct->m22);
	(*env)->SetDoubleField(env, lpObject, NSAffineTransformStructFc.tX, (jdouble)lpStruct->tX);
	(*env)->SetDoubleField(env, lpObject, NSAffineTransformStructFc.tY, (jdouble)lpStruct->tY);
}
#endif

#ifndef NO_NSOperatingSystemVersion
typedef struct NSOperatingSystemVersion_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID majorVersion, minorVersion, patchVersion;
} NSOperatingSystemVersion_FID_CACHE;

NSOperatingSystemVersion_FID_CACHE NSOperatingSystemVersionFc;

void cacheNSOperatingSystemVersionFields(JNIEnv *env, jobject lpObject)
{
	if (NSOperatingSystemVersionFc.cached) return;
	NSOperatingSystemVersionFc.clazz = (*env)->GetObjectClass(env, lpObject);
	NSOperatingSystemVersionFc.majorVersion = (*env)->GetFieldID(env, NSOperatingSystemVersionFc.clazz, "majorVersion", "J");
	NSOperatingSystemVersionFc.minorVersion = (*env)->GetFieldID(env, NSOperatingSystemVersionFc.clazz, "minorVersion", "J");
	NSOperatingSystemVersionFc.patchVersion = (*env)->GetFieldID(env, NSOperatingSystemVersionFc.clazz, "patchVersion", "J");
	NSOperatingSystemVersionFc.cached = 1;
}

NSOperatingSystemVersion *getNSOperatingSystemVersionFields(JNIEnv *env, jobject lpObject, NSOperatingSystemVersion *lpStruct)
{
	if (!NSOperatingSystemVersionFc.cached) cacheNSOperatingSystemVersionFields(env, lpObject);
	lpStruct->majorVersion = (NSInteger)(*env)->GetLongField(env, lpObject, NSOperatingSystemVersionFc.majorVersion);
	lpStruct->minorVersion = (NSInteger)(*env)->GetLongField(env, lpObject, NSOperatingSystemVersionFc.minorVersion);
	lpStruct->patchVersion = (NSInteger)(*env)->GetLongField(env, lpObject, NSOperatingSystemVersionFc.patchVersion);
	return lpStruct;
}

void setNSOperatingSystemVersionFields(JNIEnv *env, jobject lpObject, NSOperatingSystemVersion *lpStruct)
{
	if (!NSOperatingSystemVersionFc.cached) cacheNSOperatingSystemVersionFields(env, lpObject);
	(*env)->SetLongField(env, lpObject, NSOperatingSystemVersionFc.majorVersion, (jlong)lpStruct->majorVersion);
	(*env)->SetLongField(env, lpObject, NSOperatingSystemVersionFc.minorVersion, (jlong)lpStruct->minorVersion);
	(*env)->SetLongField(env, lpObject, NSOperatingSystemVersionFc.patchVersion, (jlong)lpStruct->patchVersion);
}
#endif

#ifndef NO_NSPoint
typedef struct NSPoint_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID x, y;
} NSPoint_FID_CACHE;

NSPoint_FID_CACHE NSPointFc;

void cacheNSPointFields(JNIEnv *env, jobject lpObject)
{
	if (NSPointFc.cached) return;
	NSPointFc.clazz = (*env)->GetObjectClass(env, lpObject);
	NSPointFc.x = (*env)->GetFieldID(env, NSPointFc.clazz, "x", "D");
	NSPointFc.y = (*env)->GetFieldID(env, NSPointFc.clazz, "y", "D");
	NSPointFc.cached = 1;
}

NSPoint *getNSPointFields(JNIEnv *env, jobject lpObject, NSPoint *lpStruct)
{
	if (!NSPointFc.cached) cacheNSPointFields(env, lpObject);
	lpStruct->x = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSPointFc.x);
	lpStruct->y = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSPointFc.y);
	return lpStruct;
}

void setNSPointFields(JNIEnv *env, jobject lpObject, NSPoint *lpStruct)
{
	if (!NSPointFc.cached) cacheNSPointFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, NSPointFc.x, (jdouble)lpStruct->x);
	(*env)->SetDoubleField(env, lpObject, NSPointFc.y, (jdouble)lpStruct->y);
}
#endif

#ifndef NO_NSRange
typedef struct NSRange_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID location, length;
} NSRange_FID_CACHE;

NSRange_FID_CACHE NSRangeFc;

void cacheNSRangeFields(JNIEnv *env, jobject lpObject)
{
	if (NSRangeFc.cached) return;
	NSRangeFc.clazz = (*env)->GetObjectClass(env, lpObject);
	NSRangeFc.location = (*env)->GetFieldID(env, NSRangeFc.clazz, "location", "J");
	NSRangeFc.length = (*env)->GetFieldID(env, NSRangeFc.clazz, "length", "J");
	NSRangeFc.cached = 1;
}

NSRange *getNSRangeFields(JNIEnv *env, jobject lpObject, NSRange *lpStruct)
{
	if (!NSRangeFc.cached) cacheNSRangeFields(env, lpObject);
	lpStruct->location = (NSUInteger)(*env)->GetLongField(env, lpObject, NSRangeFc.location);
	lpStruct->length = (NSUInteger)(*env)->GetLongField(env, lpObject, NSRangeFc.length);
	return lpStruct;
}

void setNSRangeFields(JNIEnv *env, jobject lpObject, NSRange *lpStruct)
{
	if (!NSRangeFc.cached) cacheNSRangeFields(env, lpObject);
	(*env)->SetLongField(env, lpObject, NSRangeFc.location, (jlong)lpStruct->location);
	(*env)->SetLongField(env, lpObject, NSRangeFc.length, (jlong)lpStruct->length);
}
#endif

#ifndef NO_NSRect
typedef struct NSRect_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID x, y, width, height;
} NSRect_FID_CACHE;

NSRect_FID_CACHE NSRectFc;

void cacheNSRectFields(JNIEnv *env, jobject lpObject)
{
	if (NSRectFc.cached) return;
	NSRectFc.clazz = (*env)->GetObjectClass(env, lpObject);
	NSRectFc.x = (*env)->GetFieldID(env, NSRectFc.clazz, "x", "D");
	NSRectFc.y = (*env)->GetFieldID(env, NSRectFc.clazz, "y", "D");
	NSRectFc.width = (*env)->GetFieldID(env, NSRectFc.clazz, "width", "D");
	NSRectFc.height = (*env)->GetFieldID(env, NSRectFc.clazz, "height", "D");
	NSRectFc.cached = 1;
}

NSRect *getNSRectFields(JNIEnv *env, jobject lpObject, NSRect *lpStruct)
{
	if (!NSRectFc.cached) cacheNSRectFields(env, lpObject);
	lpStruct->origin.x = (*env)->GetDoubleField(env, lpObject, NSRectFc.x);
	lpStruct->origin.y = (*env)->GetDoubleField(env, lpObject, NSRectFc.y);
	lpStruct->size.width = (*env)->GetDoubleField(env, lpObject, NSRectFc.width);
	lpStruct->size.height = (*env)->GetDoubleField(env, lpObject, NSRectFc.height);
	return lpStruct;
}

void setNSRectFields(JNIEnv *env, jobject lpObject, NSRect *lpStruct)
{
	if (!NSRectFc.cached) cacheNSRectFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, NSRectFc.x, (jdouble)lpStruct->origin.x);
	(*env)->SetDoubleField(env, lpObject, NSRectFc.y, (jdouble)lpStruct->origin.y);
	(*env)->SetDoubleField(env, lpObject, NSRectFc.width, (jdouble)lpStruct->size.width);
	(*env)->SetDoubleField(env, lpObject, NSRectFc.height, (jdouble)lpStruct->size.height);
}
#endif

#ifndef NO_NSSize
typedef struct NSSize_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID width, height;
} NSSize_FID_CACHE;

NSSize_FID_CACHE NSSizeFc;

void cacheNSSizeFields(JNIEnv *env, jobject lpObject)
{
	if (NSSizeFc.cached) return;
	NSSizeFc.clazz = (*env)->GetObjectClass(env, lpObject);
	NSSizeFc.width = (*env)->GetFieldID(env, NSSizeFc.clazz, "width", "D");
	NSSizeFc.height = (*env)->GetFieldID(env, NSSizeFc.clazz, "height", "D");
	NSSizeFc.cached = 1;
}

NSSize *getNSSizeFields(JNIEnv *env, jobject lpObject, NSSize *lpStruct)
{
	if (!NSSizeFc.cached) cacheNSSizeFields(env, lpObject);
	lpStruct->width = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSSizeFc.width);
	lpStruct->height = (CGFloat)(*env)->GetDoubleField(env, lpObject, NSSizeFc.height);
	return lpStruct;
}

void setNSSizeFields(JNIEnv *env, jobject lpObject, NSSize *lpStruct)
{
	if (!NSSizeFc.cached) cacheNSSizeFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, NSSizeFc.width, (jdouble)lpStruct->width);
	(*env)->SetDoubleField(env, lpObject, NSSizeFc.height, (jdouble)lpStruct->height);
}
#endif

#ifndef NO_PMResolution
typedef struct PMResolution_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID hRes, vRes;
} PMResolution_FID_CACHE;

PMResolution_FID_CACHE PMResolutionFc;

void cachePMResolutionFields(JNIEnv *env, jobject lpObject)
{
	if (PMResolutionFc.cached) return;
	PMResolutionFc.clazz = (*env)->GetObjectClass(env, lpObject);
	PMResolutionFc.hRes = (*env)->GetFieldID(env, PMResolutionFc.clazz, "hRes", "D");
	PMResolutionFc.vRes = (*env)->GetFieldID(env, PMResolutionFc.clazz, "vRes", "D");
	PMResolutionFc.cached = 1;
}

PMResolution *getPMResolutionFields(JNIEnv *env, jobject lpObject, PMResolution *lpStruct)
{
	if (!PMResolutionFc.cached) cachePMResolutionFields(env, lpObject);
	lpStruct->hRes = (*env)->GetDoubleField(env, lpObject, PMResolutionFc.hRes);
	lpStruct->vRes = (*env)->GetDoubleField(env, lpObject, PMResolutionFc.vRes);
	return lpStruct;
}

void setPMResolutionFields(JNIEnv *env, jobject lpObject, PMResolution *lpStruct)
{
	if (!PMResolutionFc.cached) cachePMResolutionFields(env, lpObject);
	(*env)->SetDoubleField(env, lpObject, PMResolutionFc.hRes, (jdouble)lpStruct->hRes);
	(*env)->SetDoubleField(env, lpObject, PMResolutionFc.vRes, (jdouble)lpStruct->vRes);
}
#endif

#ifndef NO_objc_super
typedef struct objc_super_FID_CACHE {
	int cached;
	jclass clazz;
	jfieldID receiver, super_class;
} objc_super_FID_CACHE;

objc_super_FID_CACHE objc_superFc;

void cacheobjc_superFields(JNIEnv *env, jobject lpObject)
{
	if (objc_superFc.cached) return;
	objc_superFc.clazz = (*env)->GetObjectClass(env, lpObject);
	objc_superFc.receiver = (*env)->GetFieldID(env, objc_superFc.clazz, "receiver", "J");
	objc_superFc.super_class = (*env)->GetFieldID(env, objc_superFc.clazz, "super_class", "J");
	objc_superFc.cached = 1;
}

struct objc_super *getobjc_superFields(JNIEnv *env, jobject lpObject, struct objc_super *lpStruct)
{
	if (!objc_superFc.cached) cacheobjc_superFields(env, lpObject);
	lpStruct->receiver = (id)(*env)->GetLongField(env, lpObject, objc_superFc.receiver);
	lpStruct->swt_super_class = (Class)(*env)->GetLongField(env, lpObject, objc_superFc.super_class);
	return lpStruct;
}

void setobjc_superFields(JNIEnv *env, jobject lpObject, struct objc_super *lpStruct)
{
	if (!objc_superFc.cached) cacheobjc_superFields(env, lpObject);
	(*env)->SetLongField(env, lpObject, objc_superFc.receiver, (jlong)lpStruct->receiver);
	(*env)->SetLongField(env, lpObject, objc_superFc.super_class, (jlong)lpStruct->swt_super_class);
}
#endif

