/*******************************************************************************
* Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
#include "swt.h"
#include "os_structs.h"
#include "os_stats.h"
#define OS_NATIVE(func) Java_org_eclipse_swt_internal_cocoa_OS_##func
#ifndef NO_ATSFontActivateFromFileReference
JNIEXPORT jint JNICALL OS_NATIVE(ATSFontActivateFromFileReference)
(JNIEnv *env, jclass that, jbyteArray arg0, jint arg1, jint arg2, jintLong arg3, jint arg4, jintLongArray arg5)
{
jbyte *lparg0=NULL;
jintLong *lparg5=NULL;
jint rc = 0;
OS_NATIVE_ENTER(env, that, ATSFontActivateFromFileReference_FUNC);
if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
if (arg5) if ((lparg5 = (*env)->GetIntLongArrayElements(env, arg5, NULL)) == NULL) goto fail;
/*
rc = (jint)ATSFontActivateFromFileReference((const FSRef *)lparg0, (ATSFontContext)arg1, (ATSFontFormat)arg2, (void *)arg3, (ATSOptionFlags)arg4, (ATSFontContainerRef *)lparg5);
*/
{
LOAD_FUNCTION(fp, ATSFontActivateFromFileReference)
if (fp) {
rc = (jint)((jint (CALLING_CONVENTION*)(const FSRef *, ATSFontContext, ATSFontFormat, void *, ATSOptionFlags, ATSFontContainerRef *))fp)((const FSRef *)lparg0, (ATSFontContext)arg1, (ATSFontFormat)arg2, (void *)arg3, (ATSOptionFlags)arg4, (ATSFontContainerRef *)lparg5);
}
}
fail:
if (arg5 && lparg5) (*env)->ReleaseIntLongArrayElements(env, arg5, lparg5, 0);
if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
OS_NATIVE_EXIT(env, that, ATSFontActivateFromFileReference_FUNC);
return rc;
}
#endif
#ifndef NO_AcquireRootMenu
JNIEXPORT jintLong JNICALL OS_NATIVE(AcquireRootMenu)
(JNIEnv *env, jclass that)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, AcquireRootMenu_FUNC);
/*
rc = (jintLong)AcquireRootMenu();
*/
{
LOAD_FUNCTION(fp, AcquireRootMenu)
if (fp) {
rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)();
}
}
OS_NATIVE_EXIT(env, that, AcquireRootMenu_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1NSTextAttachmentCell_1cellSize
static jintLong CALLBACK_1NSTextAttachmentCell_1cellSize;
static NSSize proc_CALLBACK_1NSTextAttachmentCell_1cellSize(id arg0, SEL arg1) {
NSSize* lprc = ((NSSize* (*)(id, SEL))CALLBACK_1NSTextAttachmentCell_1cellSize)(arg0, arg1);
NSSize rc;
if (lprc) {
rc = *lprc;
free(lprc);
} else {
memset(&rc, 0, sizeof(NSSize));
}
return rc;
}
static jintLong CALLBACK_NSTextAttachmentCell_cellSize(jintLong func) {
CALLBACK_1NSTextAttachmentCell_1cellSize = func;
return (jintLong)proc_CALLBACK_1NSTextAttachmentCell_1cellSize;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1NSTextAttachmentCell_1cellSize)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1NSTextAttachmentCell_1cellSize_FUNC);
rc = (jintLong)CALLBACK_NSTextAttachmentCell_cellSize(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1NSTextAttachmentCell_1cellSize_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1accessibilityHitTest_1
static jintLong CALLBACK_1accessibilityHitTest_1;
static id proc_CALLBACK_1accessibilityHitTest_1(id arg0, SEL arg1, NSPoint arg2) {
return ((id (*)(id, SEL, NSPoint*))CALLBACK_1accessibilityHitTest_1)(arg0, arg1, &arg2);
}
static jintLong CALLBACK_accessibilityHitTest_(jintLong func) {
CALLBACK_1accessibilityHitTest_1 = func;
return (jintLong)proc_CALLBACK_1accessibilityHitTest_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1accessibilityHitTest_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1accessibilityHitTest_1_FUNC);
rc = (jintLong)CALLBACK_accessibilityHitTest_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1accessibilityHitTest_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1attributedSubstringFromRange_1
static jintLong CALLBACK_1attributedSubstringFromRange_1;
static NSAttributedString* proc_CALLBACK_1attributedSubstringFromRange_1(id arg0, SEL arg1, NSRange arg2) {
return ((NSAttributedString* (*)(id, SEL, NSRange*))CALLBACK_1attributedSubstringFromRange_1)(arg0, arg1, &arg2);
}
static jintLong CALLBACK_attributedSubstringFromRange_(jintLong func) {
CALLBACK_1attributedSubstringFromRange_1 = func;
return (jintLong)proc_CALLBACK_1attributedSubstringFromRange_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1attributedSubstringFromRange_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1attributedSubstringFromRange_1_FUNC);
rc = (jintLong)CALLBACK_attributedSubstringFromRange_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1attributedSubstringFromRange_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1canDragRowsWithIndexes_1atPoint_1
static jintLong CALLBACK_1canDragRowsWithIndexes_1atPoint_1;
static BOOL proc_CALLBACK_1canDragRowsWithIndexes_1atPoint_1(id arg0, SEL arg1, NSIndexSet* arg2, NSPoint arg3) {
return ((BOOL (*)(id, SEL, NSIndexSet*, NSPoint*))CALLBACK_1canDragRowsWithIndexes_1atPoint_1)(arg0, arg1, arg2, &arg3);
}
static jintLong CALLBACK_canDragRowsWithIndexes_atPoint_(jintLong func) {
CALLBACK_1canDragRowsWithIndexes_1atPoint_1 = func;
return (jintLong)proc_CALLBACK_1canDragRowsWithIndexes_1atPoint_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1canDragRowsWithIndexes_1atPoint_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1canDragRowsWithIndexes_1atPoint_1_FUNC);
rc = (jintLong)CALLBACK_canDragRowsWithIndexes_atPoint_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1canDragRowsWithIndexes_1atPoint_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1cellBaselineOffset
static jintLong CALLBACK_1cellBaselineOffset;
static NSPoint proc_CALLBACK_1cellBaselineOffset(id arg0, SEL arg1) {
NSPoint* lprc = ((NSPoint* (*)(id, SEL))CALLBACK_1cellBaselineOffset)(arg0, arg1);
NSPoint rc;
if (lprc) {
rc = *lprc;
free(lprc);
} else {
memset(&rc, 0, sizeof(NSPoint));
}
return rc;
}
static jintLong CALLBACK_cellBaselineOffset(jintLong func) {
CALLBACK_1cellBaselineOffset = func;
return (jintLong)proc_CALLBACK_1cellBaselineOffset;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1cellBaselineOffset)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1cellBaselineOffset_FUNC);
rc = (jintLong)CALLBACK_cellBaselineOffset(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1cellBaselineOffset_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1cellSize
static jintLong CALLBACK_1cellSize;
static NSSize proc_CALLBACK_1cellSize(id arg0, SEL arg1) {
NSSize* lprc = ((NSSize* (*)(id, SEL))CALLBACK_1cellSize)(arg0, arg1);
NSSize rc;
if (lprc) {
rc = *lprc;
free(lprc);
} else {
memset(&rc, 0, sizeof(NSSize));
}
return rc;
}
static jintLong CALLBACK_cellSize(jintLong func) {
CALLBACK_1cellSize = func;
return (jintLong)proc_CALLBACK_1cellSize;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1cellSize)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1cellSize_FUNC);
rc = (jintLong)CALLBACK_cellSize(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1cellSize_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1characterIndexForPoint_1
static jintLong CALLBACK_1characterIndexForPoint_1;
static NSUInteger proc_CALLBACK_1characterIndexForPoint_1(id arg0, SEL arg1, NSPoint arg2) {
return ((NSUInteger (*)(id, SEL, NSPoint*))CALLBACK_1characterIndexForPoint_1)(arg0, arg1, &arg2);
}
static jintLong CALLBACK_characterIndexForPoint_(jintLong func) {
CALLBACK_1characterIndexForPoint_1 = func;
return (jintLong)proc_CALLBACK_1characterIndexForPoint_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1characterIndexForPoint_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1characterIndexForPoint_1_FUNC);
rc = (jintLong)CALLBACK_characterIndexForPoint_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1characterIndexForPoint_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1
static jintLong CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1;
static BOOL proc_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1(id arg0, SEL arg1, NSEvent* arg2, NSSize arg3, BOOL arg4) {
return ((BOOL (*)(id, SEL, NSEvent*, NSSize*, BOOL))CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1)(arg0, arg1, arg2, &arg3, arg4);
}
static jintLong CALLBACK_dragSelectionWithEvent_offset_slideBack_(jintLong func) {
CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1 = func;
return (jintLong)proc_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1_FUNC);
rc = (jintLong)CALLBACK_dragSelectionWithEvent_offset_slideBack_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1draggedImage_1beganAt_1
static jintLong CALLBACK_1draggedImage_1beganAt_1;
static void proc_CALLBACK_1draggedImage_1beganAt_1(id arg0, SEL arg1, NSImage* arg2, NSPoint arg3) {
((void (*)(id, SEL, NSImage*, NSPoint*))CALLBACK_1draggedImage_1beganAt_1)(arg0, arg1, arg2, &arg3);
}
static jintLong CALLBACK_draggedImage_beganAt_(jintLong func) {
CALLBACK_1draggedImage_1beganAt_1 = func;
return (jintLong)proc_CALLBACK_1draggedImage_1beganAt_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1draggedImage_1beganAt_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1draggedImage_1beganAt_1_FUNC);
rc = (jintLong)CALLBACK_draggedImage_beganAt_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1draggedImage_1beganAt_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1draggedImage_1endedAt_1operation_1
static jintLong CALLBACK_1draggedImage_1endedAt_1operation_1;
static void proc_CALLBACK_1draggedImage_1endedAt_1operation_1(id arg0, SEL arg1, NSImage* arg2, NSPoint arg3, NSDragOperation arg4) {
((void (*)(id, SEL, NSImage*, NSPoint*, NSDragOperation))CALLBACK_1draggedImage_1endedAt_1operation_1)(arg0, arg1, arg2, &arg3, arg4);
}
static jintLong CALLBACK_draggedImage_endedAt_operation_(jintLong func) {
CALLBACK_1draggedImage_1endedAt_1operation_1 = func;
return (jintLong)proc_CALLBACK_1draggedImage_1endedAt_1operation_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1draggedImage_1endedAt_1operation_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1draggedImage_1endedAt_1operation_1_FUNC);
rc = (jintLong)CALLBACK_draggedImage_endedAt_operation_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1draggedImage_1endedAt_1operation_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1drawBackgroundInClipRect_1
static jintLong CALLBACK_1drawBackgroundInClipRect_1;
static void proc_CALLBACK_1drawBackgroundInClipRect_1(id arg0, SEL arg1, NSRect arg2) {
((void (*)(id, SEL, NSRect*))CALLBACK_1drawBackgroundInClipRect_1)(arg0, arg1, &arg2);
}
static jintLong CALLBACK_drawBackgroundInClipRect_(jintLong func) {
CALLBACK_1drawBackgroundInClipRect_1 = func;
return (jintLong)proc_CALLBACK_1drawBackgroundInClipRect_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1drawBackgroundInClipRect_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1drawBackgroundInClipRect_1_FUNC);
rc = (jintLong)CALLBACK_drawBackgroundInClipRect_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1drawBackgroundInClipRect_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1drawImage_1withFrame_1inView_1
static jintLong CALLBACK_1drawImage_1withFrame_1inView_1;
static void proc_CALLBACK_1drawImage_1withFrame_1inView_1(id arg0, SEL arg1, NSImage* arg2, NSRect arg3, NSView* arg4) {
((void (*)(id, SEL, NSImage*, NSRect*, NSView*))CALLBACK_1drawImage_1withFrame_1inView_1)(arg0, arg1, arg2, &arg3, arg4);
}
static jintLong CALLBACK_drawImage_withFrame_inView_(jintLong func) {
CALLBACK_1drawImage_1withFrame_1inView_1 = func;
return (jintLong)proc_CALLBACK_1drawImage_1withFrame_1inView_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1drawImage_1withFrame_1inView_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1drawImage_1withFrame_1inView_1_FUNC);
rc = (jintLong)CALLBACK_drawImage_withFrame_inView_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1drawImage_1withFrame_1inView_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1drawInteriorWithFrame_1inView_1
static jintLong CALLBACK_1drawInteriorWithFrame_1inView_1;
static void proc_CALLBACK_1drawInteriorWithFrame_1inView_1(id arg0, SEL arg1, NSRect arg2, NSView* arg3) {
((void (*)(id, SEL, NSRect*, NSView*))CALLBACK_1drawInteriorWithFrame_1inView_1)(arg0, arg1, &arg2, arg3);
}
static jintLong CALLBACK_drawInteriorWithFrame_inView_(jintLong func) {
CALLBACK_1drawInteriorWithFrame_1inView_1 = func;
return (jintLong)proc_CALLBACK_1drawInteriorWithFrame_1inView_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1drawInteriorWithFrame_1inView_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1drawInteriorWithFrame_1inView_1_FUNC);
rc = (jintLong)CALLBACK_drawInteriorWithFrame_inView_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1drawInteriorWithFrame_1inView_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1drawLabel_1inRect_1
static jintLong CALLBACK_1drawLabel_1inRect_1;
static void proc_CALLBACK_1drawLabel_1inRect_1(id arg0, SEL arg1, BOOL arg2, NSRect arg3) {
((void (*)(id, SEL, BOOL, NSRect*))CALLBACK_1drawLabel_1inRect_1)(arg0, arg1, arg2, &arg3);
}
static jintLong CALLBACK_drawLabel_inRect_(jintLong func) {
CALLBACK_1drawLabel_1inRect_1 = func;
return (jintLong)proc_CALLBACK_1drawLabel_1inRect_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1drawLabel_1inRect_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, CALLBACK_1drawLabel_1inRect_1_FUNC);
rc = (jintLong)CALLBACK_drawLabel_inRect_(arg0);
OS_NATIVE_EXIT(env, that, CALLBACK_1drawLabel_1inRect_1_FUNC);
return rc;
}
#endif
#ifndef NO_CALLBACK_1drawRect_1
static jintLong CALLBACK_1drawRect_1;
static void proc_CALLBACK_1drawRect_1(id arg0, SEL arg1, NSRect arg2) {
((void (*)(id, SEL, NSRect*))CALLBACK_1drawRect_1)(arg0, arg1, &arg2);
}
static jintLong CALLBACK_drawRect_(jintLong func) {
CALLBACK_1drawRect_1 = func;
return (jintLong)proc_CALLBACK_1drawRect_1;
}
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1drawRect_1)
(JNIEnv *env, jclass that, jintLong arg0)
{
jintLong rc = 0;
|