### Eclipse Workspace Patch 1.0 #P org.eclipse.swt Index: Eclipse SWT PI/carbon/library/os.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c,v retrieving revision 1.173 diff -u -r1.173 os.c --- Eclipse SWT PI/carbon/library/os.c 1 Oct 2009 21:46:24 -0000 1.173 +++ Eclipse SWT PI/carbon/library/os.c 30 Nov 2009 21:28:04 -0000 @@ -129,6 +129,22 @@ } #endif +#ifndef NO_AEGetParamDesc +JNIEXPORT jint JNICALL OS_NATIVE(AEGetParamDesc) + (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3) +{ + AEDesc _arg3, *lparg3=NULL; + jint rc = 0; + OS_NATIVE_ENTER(env, that, AEGetParamDesc_FUNC); + if (arg3) if ((lparg3 = getAEDescFields(env, arg3, &_arg3)) == NULL) goto fail; + rc = (jint)AEGetParamDesc((const AppleEvent *)arg0, (AEKeyword)arg1, (DescType)arg2, (AEDesc *)lparg3); +fail: + if (arg3 && lparg3) setAEDescFields(env, arg3, lparg3); + OS_NATIVE_EXIT(env, that, AEGetParamDesc_FUNC); + return rc; +} +#endif + #ifndef NO_AEInstallEventHandler JNIEXPORT jint JNICALL OS_NATIVE(AEInstallEventHandler) (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jboolean arg4) Index: Eclipse SWT PI/carbon/library/os_stats.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c,v retrieving revision 1.138 diff -u -r1.138 os_stats.c --- Eclipse SWT PI/carbon/library/os_stats.c 19 Oct 2009 17:45:08 -0000 1.138 +++ Eclipse SWT PI/carbon/library/os_stats.c 30 Nov 2009 21:28:04 -0000 @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 999; -int OS_nativeFunctionCallCount[999]; +int OS_nativeFunctionCount = 1000; +int OS_nativeFunctionCallCount[1000]; char * OS_nativeFunctionNames[] = { "AECoerceDesc", "AECountItems", @@ -23,6 +23,7 @@ "AEDisposeDesc", "AEGetDescData", "AEGetNthPtr", + "AEGetParamDesc", "AEInstallEventHandler", "AEProcessAppleEvent", "ATSFontActivateFromFileSpecification", Index: Eclipse SWT PI/carbon/library/os_stats.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h,v retrieving revision 1.137 diff -u -r1.137 os_stats.h --- Eclipse SWT PI/carbon/library/os_stats.h 19 Oct 2009 17:45:08 -0000 1.137 +++ Eclipse SWT PI/carbon/library/os_stats.h 30 Nov 2009 21:28:04 -0000 @@ -31,6 +31,7 @@ AEDisposeDesc_FUNC, AEGetDescData_FUNC, AEGetNthPtr_FUNC, + AEGetParamDesc_FUNC, AEInstallEventHandler_FUNC, AEProcessAppleEvent_FUNC, ATSFontActivateFromFileSpecification_FUNC, Index: Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java,v retrieving revision 1.335 diff -u -r1.335 OS.java --- Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java 22 Oct 2009 19:04:15 -0000 1.335 +++ Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java 30 Nov 2009 21:28:04 -0000 @@ -62,6 +62,9 @@ public static final int kAESmallSystemFontChanged = ('s'<<24) + ('s'<<16) + ('f'<<8) + 'n'; public static final int kAEViewsFontChanged = ('v'<<24) + ('f'<<16) + ('n'<<8) + 't'; public static final int kAEQuitApplication = ('q'<<24) + ('u'<<16) + ('i'<<8) + 't'; + public static final int kAEOpenDocuments = ('o' << 24) + ('d' << 16) + ('o' << 8) + 'c'; + public static final int keyDirectObject = ('-' << 24) + ('-' << 16) + ('-' << 8) + '-'; + public static final int typeAEList = ('l' << 24) + ('i' << 16) + ('s' << 8) + 't'; public static final int kCoreEventClass = ('a'<<24) + ('e'<<16) + ('v'<<8) + 't'; public static final int kAlertCautionAlert = 2; public static final int kAlertCautionIcon = ('c'<<24) + ('a'<<16) + ('u'<<8) + 't'; @@ -1131,6 +1134,13 @@ */ public static final native int AEGetNthPtr(AEDesc theAEDescList, int index, int desiredType, int[] theAEKeyword, int[] typeCode, int dataPtr, int maximumSize, int[] actualSize); /** + * @param theAppleEvent cast=(const AppleEvent *) + * @param theAEKeyword cast=(AEKeyword) + * @param desiredType cast=(DescType) + * @param result cast=(AEDesc *) + */ +public static final native int AEGetParamDesc (int theAppleEvent, int theAEKeyword, int desiredType, AEDesc result); +/** * @param theAEEventClass cast=(AEEventClass) * @param theAEEventID cast=(AEEventID) * @param handler cast=(AEEventHandlerUPP) Index: Eclipse SWT PI/cocoa/library/os.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c,v retrieving revision 1.119 diff -u -r1.119 os.c --- Eclipse SWT PI/cocoa/library/os.c 13 Nov 2009 19:39:10 -0000 1.119 +++ Eclipse SWT PI/cocoa/library/os.c 30 Nov 2009 21:28:05 -0000 @@ -1547,7 +1547,7 @@ jint rc = 0; OS_NATIVE_ENTER(env, that, CGGetDisplaysWithRect_FUNC); if (arg0) if ((lparg0 = getCGRectFields(env, arg0, &_arg0)) == NULL) goto fail; - rc = (jint)CGGetDisplaysWithRect(*lparg0, (CGDisplayCount)arg1, (CGDirectDisplayID*)arg2, (CGDisplayCount*)arg3); + rc = (jint)CGGetDisplaysWithRect(*lparg0, (uint32_t)arg1, (CGDirectDisplayID*)arg2, (uint32_t*)arg3); fail: if (arg0 && lparg0) setCGRectFields(env, arg0, lparg0); OS_NATIVE_EXIT(env, that, CGGetDisplaysWithRect_FUNC); @@ -7535,6 +7535,18 @@ } #endif +#ifndef NO_objc_1msgSend__JJJJII +JNIEXPORT jlong JNICALL OS_NATIVE(objc_1msgSend__JJJJII) + (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jlong arg3, jint arg4, jint arg5) +{ + jlong rc = 0; + OS_NATIVE_ENTER(env, that, objc_1msgSend__JJJJII_FUNC); + rc = (jlong)((jlong (*)(jlong, jlong, jlong, jlong, jint, jint))objc_msgSend)(arg0, arg1, arg2, arg3, arg4, arg5); + OS_NATIVE_EXIT(env, that, objc_1msgSend__JJJJII_FUNC); + return rc; +} +#endif + #ifndef NO_objc_1msgSend__JJ_3I JNIEXPORT jlong JNICALL OS_NATIVE(objc_1msgSend__JJ_3I) (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jintArray arg2) @@ -8318,6 +8330,29 @@ } #endif +#if (!defined(NO_objc_1msgSend_1bool__IIIZ) && !defined(JNI64)) || (!defined(NO_objc_1msgSend_1bool__JJJZ) && defined(JNI64)) +#ifndef JNI64 +JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__IIIZ)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jboolean arg3) +#else +JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__JJJZ)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jboolean arg3) +#endif +{ + jboolean rc = 0; +#ifndef JNI64 + OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__IIIZ_FUNC); +#else + OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__JJJZ_FUNC); +#endif + rc = (jboolean)((BOOL (*)(jintLong, jintLong, jintLong, jboolean))objc_msgSend_bool)(arg0, arg1, arg2, arg3); +#ifndef JNI64 + OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__IIIZ_FUNC); +#else + OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__JJJZ_FUNC); +#endif + return rc; +} +#endif + #if (!defined(NO_objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2) && !defined(JNI64)) || (!defined(NO_objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2) && defined(JNI64)) #ifndef JNI64 JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2) Index: Eclipse SWT PI/cocoa/library/os_stats.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c,v retrieving revision 1.110 diff -u -r1.110 os_stats.c --- Eclipse SWT PI/cocoa/library/os_stats.c 13 Nov 2009 19:39:12 -0000 1.110 +++ Eclipse SWT PI/cocoa/library/os_stats.c 30 Nov 2009 21:28:05 -0000 @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 532; -int OS_nativeFunctionCallCount[532]; +int OS_nativeFunctionCount = 534; +int OS_nativeFunctionCallCount[534]; char * OS_nativeFunctionNames[] = { "ATSFontActivateFromFileReference", "AcquireRootMenu", @@ -846,6 +846,7 @@ #endif "objc_1msgSend__JJFD", "objc_1msgSend__JJI", + "objc_1msgSend__JJJJII", "objc_1msgSend__JJ_3I", "objc_1msgSend__JJ_3JJJ", #ifndef JNI64 @@ -980,6 +981,11 @@ "objc_1msgSend_1bool__JJJLorg_eclipse_swt_internal_cocoa_NSSize_2Z", #endif #ifndef JNI64 + "objc_1msgSend_1bool__IIIZ", +#else + "objc_1msgSend_1bool__JJJZ", +#endif +#ifndef JNI64 "objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2", #else "objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2", Index: Eclipse SWT PI/cocoa/library/os_stats.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h,v retrieving revision 1.110 diff -u -r1.110 os_stats.h --- Eclipse SWT PI/cocoa/library/os_stats.h 13 Nov 2009 19:39:10 -0000 1.110 +++ Eclipse SWT PI/cocoa/library/os_stats.h 30 Nov 2009 21:28:05 -0000 @@ -854,6 +854,7 @@ #endif objc_1msgSend__JJFD_FUNC, objc_1msgSend__JJI_FUNC, + objc_1msgSend__JJJJII_FUNC, objc_1msgSend__JJ_3I_FUNC, objc_1msgSend__JJ_3JJJ_FUNC, #ifndef JNI64 @@ -988,6 +989,11 @@ objc_1msgSend_1bool__JJJLorg_eclipse_swt_internal_cocoa_NSSize_2Z_FUNC, #endif #ifndef JNI64 + objc_1msgSend_1bool__IIIZ_FUNC, +#else + objc_1msgSend_1bool__JJJZ_FUNC, +#endif +#ifndef JNI64 objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC, #else objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC, Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras,v retrieving revision 1.192 diff -u -r1.192 AppKitFull.bridgesupport.extras --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras 17 Nov 2009 17:40:56 -0000 1.192 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras 30 Nov 2009 21:28:06 -0000 @@ -151,6 +151,7 @@ + @@ -521,6 +522,10 @@ + + + + @@ -2254,6 +2259,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -3314,7 +3343,7 @@ - + @@ -3382,7 +3411,7 @@ - + @@ -3410,7 +3439,7 @@ - + @@ -3477,7 +3506,7 @@ - + @@ -3485,12 +3514,12 @@ - + - + @@ -4022,7 +4051,7 @@ - + @@ -4537,41 +4566,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4610,243 +4609,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - + - - - - - - + + + - - - + - - + - - - - - + + + + - + - - - - - - - - - + + - - + - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + - + + + + + + + + + - - + + + - - - + - - - - - - - - - + + + + - - - - + + + + - - - - - + + + + + + + + + + + - - - + + + - + + + - + - + - - - + - + - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - - - - - + + + - - + + - - - + - + @@ -4856,50 +4813,122 @@ - + - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + - - - - - + + + + - - + + + + - - - - + + + + + - - + + + + + + + + + + + + + + + + + + + Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppleEventDelegate.java =================================================================== RCS file: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppleEventDelegate.java diff -N Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppleEventDelegate.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppleEventDelegate.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,16 @@ +package org.eclipse.swt.internal.cocoa; + +public class AppleEventDelegate extends NSObject { + + public AppleEventDelegate() { + } + + public AppleEventDelegate(int id) { + super(id); + } + + public AppleEventDelegate(id id) { + super(id); + } + +} Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras,v retrieving revision 1.33 diff -u -r1.33 CoreGraphicsFull.bridgesupport.extras --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras 19 Aug 2009 21:39:16 -0000 1.33 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras 30 Nov 2009 21:28:07 -0000 @@ -57,16 +57,16 @@ - + - + - + @@ -115,12 +115,12 @@ - + - - + + @@ -145,7 +145,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -235,8 +235,8 @@ - - + + @@ -245,7 +245,7 @@ - + Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras,v retrieving revision 1.51 diff -u -r1.51 FoundationFull.bridgesupport.extras --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras 17 Nov 2009 14:57:44 -0000 1.51 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras 30 Nov 2009 21:28:07 -0000 @@ -68,6 +68,18 @@ + + + + + + + + + + + + Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java =================================================================== RCS file: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java diff -N Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 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 + *******************************************************************************/ +package org.eclipse.swt.internal.cocoa; + +public class NSAppleEventManager extends NSObject { + +public NSAppleEventManager() { + super(); +} + +public NSAppleEventManager(int /*long*/ id) { + super(id); +} + +public NSAppleEventManager(id id) { + super(id); +} + +public void setEventHandler(id handler, int /*long*/ handleEventSelector, int eventClass, int eventID) { + OS.objc_msgSend(this.id, OS.sel_setEventHandler_andSelector_forEventClass_andEventID_, handler != null ? handler.id : 0, handleEventSelector, eventClass, eventID); +} + +public static NSAppleEventManager sharedAppleEventManager() { + int /*long*/ result = OS.objc_msgSend(OS.class_NSAppleEventManager, OS.sel_sharedAppleEventManager); + return result != 0 ? new NSAppleEventManager(result) : null; +} + +} Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java,v retrieving revision 1.16 diff -u -r1.16 NSApplication.java --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java 1 Jul 2009 14:49:13 -0000 1.16 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java 30 Nov 2009 21:28:07 -0000 @@ -89,6 +89,10 @@ OS.objc_msgSend(this.id, OS.sel_postEvent_atStart_, event != null ? event.id : 0, flag); } +public void replyToOpenOrPrint(int /*long*/ reply) { + OS.objc_msgSend(this.id, OS.sel_replyToOpenOrPrint_, reply); +} + public void run() { OS.objc_msgSend(this.id, OS.sel_run); } Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java,v retrieving revision 1.29 diff -u -r1.29 NSObject.java --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java 1 Jul 2009 14:49:07 -0000 1.29 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java 30 Nov 2009 21:28:07 -0000 @@ -38,6 +38,26 @@ return OS.objc_msgSend_bool(this.id, OS.sel_accessibilitySetOverrideValue_forAttribute_, value != null ? value.id : 0, attribute != null ? attribute.id : 0); } +public boolean application(NSApplication sender, NSString filename) { + return OS.objc_msgSend_bool(this.id, OS.sel_application_openFile_, sender != null ? sender.id : 0, filename != null ? filename.id : 0); +} + +public boolean application(id sender, NSString filename) { + return OS.objc_msgSend_bool(this.id, OS.sel_application_openFileWithoutUI_, sender != null ? sender.id : 0, filename != null ? filename.id : 0); +} + +public void application(NSApplication sender, NSArray filenames) { + OS.objc_msgSend(this.id, OS.sel_application_openFiles_, sender != null ? sender.id : 0, filenames != null ? filenames.id : 0); +} + +public boolean applicationOpenUntitledFile(NSApplication sender) { + return OS.objc_msgSend_bool(this.id, OS.sel_applicationOpenUntitledFile_, sender != null ? sender.id : 0); +} + +public boolean applicationShouldHandleReopen(NSApplication sender, boolean flag) { + return OS.objc_msgSend_bool(this.id, OS.sel_applicationShouldHandleReopen_hasVisibleWindows_, sender != null ? sender.id : 0, flag); +} + public void draggedImage(NSImage image, NSPoint screenPoint, int /*long*/ operation) { OS.objc_msgSend(this.id, OS.sel_draggedImage_endedAt_operation_, image != null ? image.id : 0, screenPoint, operation); } Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java,v retrieving revision 1.28 diff -u -r1.28 NSTableView.java --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java 24 Aug 2009 20:44:42 -0000 1.28 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java 30 Nov 2009 21:28:07 -0000 @@ -24,8 +24,8 @@ super(id); } -public void addTableColumn(NSTableColumn column) { - OS.objc_msgSend(this.id, OS.sel_addTableColumn_, column != null ? column.id : 0); +public void addTableColumn(NSTableColumn tableColumn) { + OS.objc_msgSend(this.id, OS.sel_addTableColumn_, tableColumn != null ? tableColumn.id : 0); } public boolean allowsColumnReordering() { @@ -99,8 +99,8 @@ return OS.objc_msgSend_bool(this.id, OS.sel_isRowSelected_, row); } -public void moveColumn(int /*long*/ column, int /*long*/ newIndex) { - OS.objc_msgSend(this.id, OS.sel_moveColumn_toColumn_, column, newIndex); +public void moveColumn(int /*long*/ oldIndex, int /*long*/ newIndex) { + OS.objc_msgSend(this.id, OS.sel_moveColumn_toColumn_, oldIndex, newIndex); } public void noteNumberOfRowsChanged() { @@ -135,8 +135,8 @@ OS.objc_msgSend(this.id, OS.sel_reloadData); } -public void removeTableColumn(NSTableColumn column) { - OS.objc_msgSend(this.id, OS.sel_removeTableColumn_, column != null ? column.id : 0); +public void removeTableColumn(NSTableColumn tableColumn) { + OS.objc_msgSend(this.id, OS.sel_removeTableColumn_, tableColumn != null ? tableColumn.id : 0); } public int /*long*/ rowAtPoint(NSPoint point) { @@ -206,20 +206,20 @@ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_, aSelector); } -public void setDropRow(int /*long*/ row, int /*long*/ op) { - OS.objc_msgSend(this.id, OS.sel_setDropRow_dropOperation_, row, op); +public void setDropRow(int /*long*/ row, int /*long*/ dropOperation) { + OS.objc_msgSend(this.id, OS.sel_setDropRow_dropOperation_, row, dropOperation); } public void setHeaderView(NSTableHeaderView headerView) { OS.objc_msgSend(this.id, OS.sel_setHeaderView_, headerView != null ? headerView.id : 0); } -public void setHighlightedTableColumn(NSTableColumn tc) { - OS.objc_msgSend(this.id, OS.sel_setHighlightedTableColumn_, tc != null ? tc.id : 0); +public void setHighlightedTableColumn(NSTableColumn tableColumn) { + OS.objc_msgSend(this.id, OS.sel_setHighlightedTableColumn_, tableColumn != null ? tableColumn.id : 0); } -public void setIndicatorImage(NSImage anImage, NSTableColumn tc) { - OS.objc_msgSend(this.id, OS.sel_setIndicatorImage_inTableColumn_, anImage != null ? anImage.id : 0, tc != null ? tc.id : 0); +public void setIndicatorImage(NSImage anImage, NSTableColumn tableColumn) { + OS.objc_msgSend(this.id, OS.sel_setIndicatorImage_inTableColumn_, anImage != null ? anImage.id : 0, tableColumn != null ? tableColumn.id : 0); } public void setIntercellSpacing(NSSize aSize) { Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java,v retrieving revision 1.29 diff -u -r1.29 NSView.java --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java 3 Nov 2009 20:37:15 -0000 1.29 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java 30 Nov 2009 21:28:07 -0000 @@ -150,8 +150,8 @@ OS.objc_msgSend(this.id, OS.sel_dragImage_at_offset_event_pasteboard_source_slideBack_, anImage != null ? anImage.id : 0, viewLocation, initialOffset, event != null ? event.id : 0, pboard != null ? pboard.id : 0, sourceObj != null ? sourceObj.id : 0, slideFlag); } -public void drawRect(NSRect rect) { - OS.objc_msgSend(this.id, OS.sel_drawRect_, rect); +public void drawRect(NSRect dirtyRect) { + OS.objc_msgSend(this.id, OS.sel_drawRect_, dirtyRect); } public void endDocument() { Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java,v retrieving revision 1.299 diff -u -r1.299 OS.java --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java 17 Nov 2009 17:40:55 -0000 1.299 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java 30 Nov 2009 21:28:08 -0000 @@ -462,6 +462,7 @@ public static final int /*long*/ class_NSAffineTransform = objc_getClass("NSAffineTransform"); public static final int /*long*/ class_NSAlert = objc_getClass("NSAlert"); public static final int /*long*/ class_NSAppleEventDescriptor = objc_getClass("NSAppleEventDescriptor"); +public static final int /*long*/ class_NSAppleEventManager = objc_getClass("NSAppleEventManager"); public static final int /*long*/ class_NSApplication = objc_getClass("NSApplication"); public static final int /*long*/ class_NSArray = objc_getClass("NSArray"); public static final int /*long*/ class_NSAssertionHandler = objc_getClass("NSAssertionHandler"); @@ -704,9 +705,14 @@ public static final int /*long*/ sel_appendBezierPathWithRect_ = sel_registerName("appendBezierPathWithRect:"); public static final int /*long*/ sel_appendBezierPathWithRoundedRect_xRadius_yRadius_ = sel_registerName("appendBezierPathWithRoundedRect:xRadius:yRadius:"); public static final int /*long*/ sel_appendString_ = sel_registerName("appendString:"); +public static final int /*long*/ sel_application_openFile_ = sel_registerName("application:openFile:"); +public static final int /*long*/ sel_application_openFileWithoutUI_ = sel_registerName("application:openFileWithoutUI:"); +public static final int /*long*/ sel_application_openFiles_ = sel_registerName("application:openFiles:"); public static final int /*long*/ sel_applicationDidBecomeActive_ = sel_registerName("applicationDidBecomeActive:"); public static final int /*long*/ sel_applicationDidFinishLaunching_ = sel_registerName("applicationDidFinishLaunching:"); public static final int /*long*/ sel_applicationDidResignActive_ = sel_registerName("applicationDidResignActive:"); +public static final int /*long*/ sel_applicationOpenUntitledFile_ = sel_registerName("applicationOpenUntitledFile:"); +public static final int /*long*/ sel_applicationShouldHandleReopen_hasVisibleWindows_ = sel_registerName("applicationShouldHandleReopen:hasVisibleWindows:"); public static final int /*long*/ sel_applicationShouldTerminate_ = sel_registerName("applicationShouldTerminate:"); public static final int /*long*/ sel_applicationWillFinishLaunching_ = sel_registerName("applicationWillFinishLaunching:"); public static final int /*long*/ sel_applicationWillTerminate_ = sel_registerName("applicationWillTerminate:"); @@ -1365,6 +1371,7 @@ public static final int /*long*/ sel_removeTemporaryAttribute_forCharacterRange_ = sel_registerName("removeTemporaryAttribute:forCharacterRange:"); public static final int /*long*/ sel_removeTrackingArea_ = sel_registerName("removeTrackingArea:"); public static final int /*long*/ sel_replaceCharactersInRange_withString_ = sel_registerName("replaceCharactersInRange:withString:"); +public static final int /*long*/ sel_replyToOpenOrPrint_ = sel_registerName("replyToOpenOrPrint:"); public static final int /*long*/ sel_representation = sel_registerName("representation"); public static final int /*long*/ sel_representations = sel_registerName("representations"); public static final int /*long*/ sel_request = sel_registerName("request"); @@ -1523,6 +1530,7 @@ public static final int /*long*/ sel_setEditable_ = sel_registerName("setEditable:"); public static final int /*long*/ sel_setEnabled_ = sel_registerName("setEnabled:"); public static final int /*long*/ sel_setEnabled_forSegment_ = sel_registerName("setEnabled:forSegment:"); +public static final int /*long*/ sel_setEventHandler_andSelector_forEventClass_andEventID_ = sel_registerName("setEventHandler:andSelector:forEventClass:andEventID:"); public static final int /*long*/ sel_setFill = sel_registerName("setFill"); public static final int /*long*/ sel_setFillColor_ = sel_registerName("setFillColor:"); public static final int /*long*/ sel_setFireDate_ = sel_registerName("setFireDate:"); @@ -1683,6 +1691,7 @@ public static final int /*long*/ sel_setWindingRule_ = sel_registerName("setWindingRule:"); public static final int /*long*/ sel_setWorksWhenModal_ = sel_registerName("setWorksWhenModal:"); public static final int /*long*/ sel_setWraps_ = sel_registerName("setWraps:"); +public static final int /*long*/ sel_sharedAppleEventManager = sel_registerName("sharedAppleEventManager"); public static final int /*long*/ sel_sharedApplication = sel_registerName("sharedApplication"); public static final int /*long*/ sel_sharedColorPanel = sel_registerName("sharedColorPanel"); public static final int /*long*/ sel_sharedFontManager = sel_registerName("sharedFontManager"); @@ -1894,6 +1903,7 @@ public static final int NSAlphaNonpremultipliedBitmapFormat = 2; public static final int NSAlternateKeyMask = 524288; public static final int NSApplicationDefined = 15; +public static final int NSApplicationDelegateReplySuccess = 0; public static final int NSAtTop = 2; public static final int NSBackingStoreBuffered = 2; public static final int NSBackspaceCharacter = 8; @@ -2684,18 +2694,18 @@ * @param height cast=(size_t) * @param bitsPerComponent cast=(size_t) * @param bytesPerRow cast=(size_t) - * @param colorspace cast=(CGColorSpaceRef) + * @param space cast=(CGColorSpaceRef) * @param bitmapInfo cast=(CGBitmapInfo) */ -public static final native int /*long*/ CGBitmapContextCreate(int /*long*/ data, int /*long*/ width, int /*long*/ height, int /*long*/ bitsPerComponent, int /*long*/ bytesPerRow, int /*long*/ colorspace, int bitmapInfo); +public static final native int /*long*/ CGBitmapContextCreate(int /*long*/ data, int /*long*/ width, int /*long*/ height, int /*long*/ bitsPerComponent, int /*long*/ bytesPerRow, int /*long*/ space, int bitmapInfo); /** - * @param c cast=(CGContextRef) + * @param context cast=(CGContextRef) */ -public static final native int /*long*/ CGBitmapContextCreateImage(int /*long*/ c); +public static final native int /*long*/ CGBitmapContextCreateImage(int /*long*/ context); /** - * @param c cast=(CGContextRef) + * @param context cast=(CGContextRef) */ -public static final native int /*long*/ CGBitmapContextGetData(int /*long*/ c); +public static final native int /*long*/ CGBitmapContextGetData(int /*long*/ context); /** * @param space cast=(CGColorSpaceRef) * @param components cast=(CGFloat*) @@ -2750,15 +2760,15 @@ */ public static final native void CGContextSetBlendMode(int /*long*/ context, int mode); /** - * @param c cast=(CGContextRef) + * @param context cast=(CGContextRef) * @param components cast=(CGFloat*) */ -public static final native void CGContextSetFillColor(int /*long*/ c, float[] /*double[]*/ components); +public static final native void CGContextSetFillColor(int /*long*/ context, float[] /*double[]*/ components); /** - * @param c cast=(CGContextRef) - * @param colorspace cast=(CGColorSpaceRef) + * @param context cast=(CGContextRef) + * @param space cast=(CGColorSpaceRef) */ -public static final native void CGContextSetFillColorSpace(int /*long*/ c, int /*long*/ colorspace); +public static final native void CGContextSetFillColorSpace(int /*long*/ context, int /*long*/ space); /** * @param c cast=(CGContextRef) * @param cap cast=(CGLineCap) @@ -2787,10 +2797,10 @@ */ public static final native void CGContextSetMiterLimit(int /*long*/ c, float /*double*/ limit); /** - * @param c cast=(CGContextRef) + * @param context cast=(CGContextRef) * @param shouldAntialias cast=(_Bool) */ -public static final native void CGContextSetShouldAntialias(int /*long*/ c, boolean shouldAntialias); +public static final native void CGContextSetShouldAntialias(int /*long*/ context, boolean shouldAntialias); /** * @param c cast=(CGContextRef) * @param mode cast=(CGTextDrawingMode) @@ -2853,9 +2863,9 @@ */ public static final native int /*long*/ CGDisplayPixelsWide(int display); /** - * @param doCombineState cast=(boolean_t) + * @param combineState cast=(boolean_t) */ -public static final native int CGEnableEventStateCombining(int doCombineState); +public static final native int CGEnableEventStateCombining(int combineState); /** * @param source cast=(CGEventSourceRef) * @param virtualKey cast=(CGKeyCode) @@ -2880,25 +2890,25 @@ public static final native void CGEventPost(int tap, int /*long*/ event); /** * @param rect flags=struct - * @param maxDisplays cast=(CGDisplayCount) - * @param dspys cast=(CGDirectDisplayID*) - * @param dspyCnt cast=(CGDisplayCount*) + * @param maxDisplays cast=(uint32_t) + * @param displays cast=(CGDirectDisplayID*) + * @param matchingDisplayCount cast=(uint32_t*) */ -public static final native int CGGetDisplaysWithRect(CGRect rect, int maxDisplays, int /*long*/ dspys, int /*long*/ dspyCnt); +public static final native int CGGetDisplaysWithRect(CGRect rect, int maxDisplays, int /*long*/ displays, int /*long*/ matchingDisplayCount); /** * @param width cast=(size_t) * @param height cast=(size_t) * @param bitsPerComponent cast=(size_t) * @param bitsPerPixel cast=(size_t) * @param bytesPerRow cast=(size_t) - * @param colorspace cast=(CGColorSpaceRef) + * @param space cast=(CGColorSpaceRef) * @param bitmapInfo cast=(CGBitmapInfo) * @param provider cast=(CGDataProviderRef) * @param decode cast=(CGFloat*) * @param shouldInterpolate cast=(_Bool) * @param intent cast=(CGColorRenderingIntent) */ -public static final native int /*long*/ CGImageCreate(int /*long*/ width, int /*long*/ height, int /*long*/ bitsPerComponent, int /*long*/ bitsPerPixel, int /*long*/ bytesPerRow, int /*long*/ colorspace, int bitmapInfo, int /*long*/ provider, int /*long*/ decode, boolean shouldInterpolate, int intent); +public static final native int /*long*/ CGImageCreate(int /*long*/ width, int /*long*/ height, int /*long*/ bitsPerComponent, int /*long*/ bitsPerPixel, int /*long*/ bytesPerRow, int /*long*/ space, int bitmapInfo, int /*long*/ provider, int /*long*/ decode, boolean shouldInterpolate, int intent); /** * @param image cast=(CGImageRef) */ @@ -3176,6 +3186,8 @@ */ public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, NSSize arg1, boolean arg2); /** @method flags=cast */ +public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, boolean arg1); +/** @method flags=cast */ public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, int /*long*/ arg1); /** @method flags=cast */ public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2); @@ -3457,6 +3469,8 @@ /** @method flags=cast */ public static final native long objc_msgSend(long id, long sel, int[] arg0); /** @method flags=cast */ +public static final native long objc_msgSend(long id, long sel, long arg0, long arg1, int arg2, int arg3); +/** @method flags=cast */ public static final native long objc_msgSend(long id, long sel, long[] arg0, long arg1, long arg2); /** @method flags=cast */ public static final native void objc_msgSend_stret(NSAffineTransformStruct result, int /*long*/ id, int /*long*/ sel); Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras,v retrieving revision 1.25 diff -u -r1.25 WebKitFull.bridgesupport.extras --- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras 3 Nov 2009 20:37:15 -0000 1.25 +++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport.extras 30 Nov 2009 21:28:08 -0000 @@ -413,17 +413,17 @@ + + + - - - + - Index: Eclipse SWT PI/gtk/library/os.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c,v retrieving revision 1.285 diff -u -r1.285 os.c --- Eclipse SWT PI/gtk/library/os.c 20 Nov 2009 22:22:09 -0000 1.285 +++ Eclipse SWT PI/gtk/library/os.c 30 Nov 2009 21:28:09 -0000 @@ -567,6 +567,18 @@ } #endif +#ifndef NO_GdkEventProperty_1sizeof +JNIEXPORT jint JNICALL OS_NATIVE(GdkEventProperty_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, GdkEventProperty_1sizeof_FUNC); + rc = (jint)GdkEventProperty_sizeof(); + OS_NATIVE_EXIT(env, that, GdkEventProperty_1sizeof_FUNC); + return rc; +} +#endif + #ifndef NO_GdkEventScroll_1sizeof JNIEXPORT jint JNICALL OS_NATIVE(GdkEventScroll_1sizeof) (JNIEnv *env, jclass that) @@ -1795,6 +1807,34 @@ } #endif +#ifndef NO__1XGetWindowProperty +JNIEXPORT jintLong JNICALL OS_NATIVE(_1XGetWindowProperty) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jlong arg3, jlong arg4, jboolean arg5, jintLong arg6, jintLongArray arg7, jintLongArray arg8, jlongArray arg9, jlongArray arg10, jintLongArray arg11) +{ + jintLong *lparg7=NULL; + jintLong *lparg8=NULL; + jlong *lparg9=NULL; + jlong *lparg10=NULL; + jintLong *lparg11=NULL; + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1XGetWindowProperty_FUNC); + if (arg7) if ((lparg7 = (*env)->GetIntLongArrayElements(env, arg7, NULL)) == NULL) goto fail; + if (arg8) if ((lparg8 = (*env)->GetIntLongArrayElements(env, arg8, NULL)) == NULL) goto fail; + if (arg9) if ((lparg9 = (*env)->GetLongArrayElements(env, arg9, NULL)) == NULL) goto fail; + if (arg10) if ((lparg10 = (*env)->GetLongArrayElements(env, arg10, NULL)) == NULL) goto fail; + if (arg11) if ((lparg11 = (*env)->GetIntLongArrayElements(env, arg11, NULL)) == NULL) goto fail; + rc = (jintLong)XGetWindowProperty((Display *)arg0, (Window)arg1, (Atom)arg2, arg3, arg4, arg5, (Atom)arg6, (Atom*)lparg7, (int *)lparg8, (unsigned long *)lparg9, (unsigned long *)lparg10, (unsigned char **)lparg11); +fail: + if (arg11 && lparg11) (*env)->ReleaseIntLongArrayElements(env, arg11, lparg11, 0); + if (arg10 && lparg10) (*env)->ReleaseLongArrayElements(env, arg10, lparg10, 0); + if (arg9 && lparg9) (*env)->ReleaseLongArrayElements(env, arg9, lparg9, 0); + if (arg8 && lparg8) (*env)->ReleaseIntLongArrayElements(env, arg8, lparg8, 0); + if (arg7 && lparg7) (*env)->ReleaseIntLongArrayElements(env, arg7, lparg7, 0); + OS_NATIVE_EXIT(env, that, _1XGetWindowProperty_FUNC); + return rc; +} +#endif + #ifndef NO__1XInternAtom JNIEXPORT jintLong JNICALL OS_NATIVE(_1XInternAtom) (JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jboolean arg2) @@ -2158,6 +2198,18 @@ } #endif +#ifndef NO__1XSetSelectionOwner +JNIEXPORT jintLong JNICALL OS_NATIVE(_1XSetSelectionOwner) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jint arg3) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1XSetSelectionOwner_FUNC); + rc = (jintLong)XSetSelectionOwner((Display *)arg0, (Atom)arg1, arg2, (Time)arg3); + OS_NATIVE_EXIT(env, that, _1XSetSelectionOwner_FUNC); + return rc; +} +#endif + #ifndef NO__1XSetTransientForHint JNIEXPORT jint JNICALL OS_NATIVE(_1XSetTransientForHint) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2) @@ -18463,6 +18515,27 @@ } #endif +#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2J) && defined(JNI64)) +#ifndef JNI64 +JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) +#else +JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2J)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) +#endif +{ +#ifndef JNI64 + OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2I_FUNC); +#else + OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2J_FUNC); +#endif + if (arg0) setGdkEventPropertyFields(env, arg0, (GdkEventProperty *)arg1); +#ifndef JNI64 + OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2I_FUNC); +#else + OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2J_FUNC); +#endif +} +#endif + #if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2JJ) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2) Index: Eclipse SWT PI/gtk/library/os_stats.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c,v retrieving revision 1.193 diff -u -r1.193 os_stats.c --- Eclipse SWT PI/gtk/library/os_stats.c 20 Nov 2009 22:22:09 -0000 1.193 +++ Eclipse SWT PI/gtk/library/os_stats.c 30 Nov 2009 21:28:10 -0000 @@ -18,8 +18,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1328; -int OS_nativeFunctionCallCount[1328]; +int OS_nativeFunctionCount = 1332; +int OS_nativeFunctionCallCount[1332]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -75,6 +75,7 @@ "GdkEventFocus_1sizeof", "GdkEventKey_1sizeof", "GdkEventMotion_1sizeof", + "GdkEventProperty_1sizeof", "GdkEventScroll_1sizeof", "GdkEventVisibility_1sizeof", "GdkEventWindowState_1sizeof", @@ -177,6 +178,7 @@ "_1XFlush", "_1XFree", "_1XGetSelectionOwner", + "_1XGetWindowProperty", "_1XInternAtom", "_1XKeysymToKeycode", "_1XListProperties", @@ -196,6 +198,7 @@ "_1XSetErrorHandler", "_1XSetIOErrorHandler", "_1XSetInputFocus", + "_1XSetSelectionOwner", "_1XSetTransientForHint", "_1XSynchronize", "_1XTestFakeButtonEvent", @@ -1565,6 +1568,11 @@ "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventMotion_2JJ", #endif #ifndef JNI64 + "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2I", +#else + "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2J", +#endif +#ifndef JNI64 "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2II", #else "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2JJ", Index: Eclipse SWT PI/gtk/library/os_stats.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h,v retrieving revision 1.193 diff -u -r1.193 os_stats.h --- Eclipse SWT PI/gtk/library/os_stats.h 20 Nov 2009 22:22:09 -0000 1.193 +++ Eclipse SWT PI/gtk/library/os_stats.h 30 Nov 2009 21:28:10 -0000 @@ -83,6 +83,7 @@ GdkEventFocus_1sizeof_FUNC, GdkEventKey_1sizeof_FUNC, GdkEventMotion_1sizeof_FUNC, + GdkEventProperty_1sizeof_FUNC, GdkEventScroll_1sizeof_FUNC, GdkEventVisibility_1sizeof_FUNC, GdkEventWindowState_1sizeof_FUNC, @@ -185,6 +186,7 @@ _1XFlush_FUNC, _1XFree_FUNC, _1XGetSelectionOwner_FUNC, + _1XGetWindowProperty_FUNC, _1XInternAtom_FUNC, _1XKeysymToKeycode_FUNC, _1XListProperties_FUNC, @@ -204,6 +206,7 @@ _1XSetErrorHandler_FUNC, _1XSetIOErrorHandler_FUNC, _1XSetInputFocus_FUNC, + _1XSetSelectionOwner_FUNC, _1XSetTransientForHint_FUNC, _1XSynchronize_FUNC, _1XTestFakeButtonEvent_FUNC, @@ -1573,6 +1576,11 @@ memmove__Lorg_eclipse_swt_internal_gtk_GdkEventMotion_2JJ_FUNC, #endif #ifndef JNI64 + memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2I_FUNC, +#else + memmove__Lorg_eclipse_swt_internal_gtk_GdkEventProperty_2J_FUNC, +#endif +#ifndef JNI64 memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2II_FUNC, #else memmove__Lorg_eclipse_swt_internal_gtk_GdkEventScroll_2JJ_FUNC, Index: Eclipse SWT PI/gtk/library/os_structs.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c,v retrieving revision 1.42 diff -u -r1.42 os_structs.c --- Eclipse SWT PI/gtk/library/os_structs.c 9 Sep 2009 13:47:00 -0000 1.42 +++ Eclipse SWT PI/gtk/library/os_structs.c 30 Nov 2009 21:28:10 -0000 @@ -711,6 +711,52 @@ } #endif +#ifndef NO_GdkEventProperty +typedef struct GdkEventProperty_FID_CACHE { + int cached; + jclass clazz; + jfieldID window, send_event, atom, time, state; +} GdkEventProperty_FID_CACHE; + +GdkEventProperty_FID_CACHE GdkEventPropertyFc; + +void cacheGdkEventPropertyFields(JNIEnv *env, jobject lpObject) +{ + if (GdkEventPropertyFc.cached) return; + cacheGdkEventFields(env, lpObject); + GdkEventPropertyFc.clazz = (*env)->GetObjectClass(env, lpObject); + GdkEventPropertyFc.window = (*env)->GetFieldID(env, GdkEventPropertyFc.clazz, "window", I_J); + GdkEventPropertyFc.send_event = (*env)->GetFieldID(env, GdkEventPropertyFc.clazz, "send_event", "B"); + GdkEventPropertyFc.atom = (*env)->GetFieldID(env, GdkEventPropertyFc.clazz, "atom", I_J); + GdkEventPropertyFc.time = (*env)->GetFieldID(env, GdkEventPropertyFc.clazz, "time", "I"); + GdkEventPropertyFc.state = (*env)->GetFieldID(env, GdkEventPropertyFc.clazz, "state", "I"); + GdkEventPropertyFc.cached = 1; +} + +GdkEventProperty *getGdkEventPropertyFields(JNIEnv *env, jobject lpObject, GdkEventProperty *lpStruct) +{ + if (!GdkEventPropertyFc.cached) cacheGdkEventPropertyFields(env, lpObject); + getGdkEventFields(env, lpObject, (GdkEvent *)lpStruct); + lpStruct->window = (GdkWindow *)(*env)->GetIntLongField(env, lpObject, GdkEventPropertyFc.window); + lpStruct->send_event = (gint8)(*env)->GetByteField(env, lpObject, GdkEventPropertyFc.send_event); + lpStruct->atom = (GdkAtom)(*env)->GetIntLongField(env, lpObject, GdkEventPropertyFc.atom); + lpStruct->time = (guint32)(*env)->GetIntField(env, lpObject, GdkEventPropertyFc.time); + lpStruct->state = (guint)(*env)->GetIntField(env, lpObject, GdkEventPropertyFc.state); + return lpStruct; +} + +void setGdkEventPropertyFields(JNIEnv *env, jobject lpObject, GdkEventProperty *lpStruct) +{ + if (!GdkEventPropertyFc.cached) cacheGdkEventPropertyFields(env, lpObject); + setGdkEventFields(env, lpObject, (GdkEvent *)lpStruct); + (*env)->SetIntLongField(env, lpObject, GdkEventPropertyFc.window, (jintLong)lpStruct->window); + (*env)->SetByteField(env, lpObject, GdkEventPropertyFc.send_event, (jbyte)lpStruct->send_event); + (*env)->SetIntLongField(env, lpObject, GdkEventPropertyFc.atom, (jintLong)lpStruct->atom); + (*env)->SetIntField(env, lpObject, GdkEventPropertyFc.time, (jint)lpStruct->time); + (*env)->SetIntField(env, lpObject, GdkEventPropertyFc.state, (jint)lpStruct->state); +} +#endif + #ifndef NO_GdkEventScroll typedef struct GdkEventScroll_FID_CACHE { int cached; Index: Eclipse SWT PI/gtk/library/os_structs.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h,v retrieving revision 1.38 diff -u -r1.38 os_structs.h --- Eclipse SWT PI/gtk/library/os_structs.h 9 Sep 2009 13:47:00 -0000 1.38 +++ Eclipse SWT PI/gtk/library/os_structs.h 30 Nov 2009 21:28:11 -0000 @@ -183,6 +183,18 @@ #define GdkEventMotion_sizeof() 0 #endif +#ifndef NO_GdkEventProperty +void cacheGdkEventPropertyFields(JNIEnv *env, jobject lpObject); +GdkEventProperty *getGdkEventPropertyFields(JNIEnv *env, jobject lpObject, GdkEventProperty *lpStruct); +void setGdkEventPropertyFields(JNIEnv *env, jobject lpObject, GdkEventProperty *lpStruct); +#define GdkEventProperty_sizeof() sizeof(GdkEventProperty) +#else +#define cacheGdkEventPropertyFields(a,b) +#define getGdkEventPropertyFields(a,b,c) NULL +#define setGdkEventPropertyFields(a,b,c) +#define GdkEventProperty_sizeof() 0 +#endif + #ifndef NO_GdkEventScroll void cacheGdkEventScrollFields(JNIEnv *env, jobject lpObject); GdkEventScroll *getGdkEventScrollFields(JNIEnv *env, jobject lpObject, GdkEventScroll *lpStruct); Index: Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventProperty.java =================================================================== RCS file: Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventProperty.java diff -N Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventProperty.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventProperty.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2009 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 + *******************************************************************************/ +package org.eclipse.swt.internal.gtk; + +public class GdkEventProperty extends GdkEvent { + /** @field cast=(GdkWindow *) */ + public int /*long*/ window; + /** @field cast=(gint8) */ + public byte send_event; + /** @field cast=(GdkAtom) */ + public int /*long*/ atom; + /** @field cast=(guint32) */ + public int time; + /** @field cast=(guint) */ + public int state; + public static final int sizeof = OS.GdkEventProperty_sizeof(); +} Index: Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java,v retrieving revision 1.542 diff -u -r1.542 OS.java --- Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java 20 Nov 2009 22:22:09 -0000 1.542 +++ Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java 30 Nov 2009 21:28:14 -0000 @@ -38,6 +38,7 @@ } /** Constants */ + public static final int /*long*/ AnyPropertyType = 0; public static final int ATK_RELATION_LABELLED_BY = 4; public static final int G_SIGNAL_MATCH_DATA = 1 << 4; public static final int G_SIGNAL_MATCH_ID = 1 << 0; @@ -200,6 +201,7 @@ public static final int GDK_POINTER_MOTION_HINT_MASK = 0x8; public static final int GDK_POINTER_MOTION_MASK = 0x4; public static final int GDK_PROPERTY_NOTIFY = 16; + public static final int GDK_PROPERTY_CHANGE_MASK = 1 << 16; public static final int GDK_Page_Down = 0xff56; public static final int GDK_Page_Up = 0xff55; public static final int GDK_Pause = 0xff13; @@ -471,6 +473,7 @@ public static final byte[] popup_menu = ascii("popup-menu"); public static final byte[] populate_popup = ascii("populate-popup"); public static final byte[] preedit_changed = ascii("preedit-changed"); + public static final byte[] property_notify_event = ascii("property-notify-event"); public static final byte[] realize = ascii("realize"); public static final byte[] row_activated = ascii("row-activated"); public static final byte[] row_changed = ascii("row-changed"); @@ -560,6 +563,7 @@ public static final native int GdkEventFocus_sizeof(); public static final native int GdkEventKey_sizeof(); public static final native int GdkEventMotion_sizeof(); +public static final native int GdkEventProperty_sizeof(); public static final native int GdkEventScroll_sizeof(); public static final native int GdkEventVisibility_sizeof(); public static final native int GdkEventWindowState_sizeof(); @@ -838,6 +842,21 @@ /** * @param display cast=(Display *) * @param selection cast=(Atom) + * @param owner cast=(Window) + * @param time cast=(Time) + */ +public static final native int /*long*/ _XSetSelectionOwner(int /*long*/ display, int /*long*/ selection, int /*long*/ window, int time); +public static final int /*long*/ XSetSelectionOwner(int /*long*/ display, int /*long*/ selection, int /*long*/ window, int time) { + lock.lock(); + try { + return _XSetSelectionOwner(display, selection, window, time); + } finally { + lock.unlock(); + } +} +/** + * @param display cast=(Display *) + * @param selection cast=(Atom) */ public static final native int /*long*/ _XGetSelectionOwner(int /*long*/ display, int /*long*/ selection); public static final int /*long*/ XGetSelectionOwner(int /*long*/ display, int /*long*/ selection) { @@ -848,6 +867,31 @@ lock.unlock(); } } + +/** + * @param display cast=(Display *) + * @param window cast=(Window) + * @param property cast=(Atom) + * @param req_type cast=(Atom) + * @param actual_type_return cast=(Atom*) + * @param actual_format_return cast=(Atom*) + * @param actual_format_return cast=(int *) + * @param nitems_return cast=(unsigned long *) + * @param bytes_after_return cast=(unsigned long *) + * @param prop_return cast=(unsigned char **) + */ +public static final native int /*long*/ _XGetWindowProperty(int /*long*/ display, int /*long*/ window, int /*long*/ property, long offset, long length, boolean delete, int /*long*/ req_type, int /*long*/ [] actual_type_return, int /*long*/ [] actual_format_return , long[] nitems_return, long[] bytes_after_return, int /*long*/ [] prop_return); +public static final int /*long*/ XGetWindowProperty( + int /*long*/ display, int /*long*/ window, int /*long*/ property, long offset, long length, boolean delete, int /*long*/ req_type, int /*long*/ [] actual_type_return, int /*long*/ [] actual_format_return, long[] nitems_return, long[] bytes_after_return, int /*long*/ [] prop_return) { + lock.lock(); + try { + return _XGetWindowProperty(display, window, property, offset, length, delete, req_type, actual_type_return, actual_format_return , nitems_return, bytes_after_return, prop_return); + } finally { + lock.unlock(); + } +} + + /** * @param display cast=(Display *) * @param name cast=(char *) @@ -13422,6 +13466,11 @@ /** * @param dest cast=(void *),flags=no_in * @param src cast=(const void *) + */ +public static final native void memmove(GdkEventProperty dest, int /*long*/ src); +/** + * @param dest cast=(void *),flags=no_in + * @param src cast=(const void *) * @param size cast=(size_t) */ public static final native void memmove(GdkDragContext dest, int /*long*/ src, int /*long*/ size); Index: Eclipse SWT PI/win32/library/make_win32.mak =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak,v retrieving revision 1.55 diff -u -r1.55 make_win32.mak --- Eclipse SWT PI/win32/library/make_win32.mak 1 Jul 2009 14:49:45 -0000 1.55 +++ Eclipse SWT PI/win32/library/make_win32.mak 30 Nov 2009 21:28:14 -0000 @@ -68,7 +68,7 @@ /I"$(JAVA_HOME)\include" /I"$(JAVA_HOME)\include\win32" /I. RCFLAGS = $(rcflags) $(rcvars) $(RCFLAGS) -DSWT_FILE_VERSION=\"$(maj_ver).$(min_ver)\" -DSWT_COMMA_VERSION=$(comma_ver) -all: make_swt make_awt make_gdip make_wgl $(XULRUNNER_MAKE) +all: make_swt xpcom_custom.obj: xpcom_custom.cpp cl $(MOZILLACFLAGS) xpcom_custom.cpp Index: Eclipse SWT PI/win32/library/os.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c,v retrieving revision 1.173 diff -u -r1.173 os.c --- Eclipse SWT PI/win32/library/os.c 12 Nov 2009 20:13:57 -0000 1.173 +++ Eclipse SWT PI/win32/library/os.c 30 Nov 2009 21:28:15 -0000 @@ -2418,6 +2418,22 @@ } #endif +#ifndef NO_DuplicateHandle +JNIEXPORT jboolean JNICALL OS_NATIVE(DuplicateHandle) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLongArray arg3, jint arg4, jboolean arg5, jint arg6) +{ + jintLong *lparg3=NULL; + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, DuplicateHandle_FUNC); + if (arg3) if ((lparg3 = (*env)->GetIntLongArrayElements(env, arg3, NULL)) == NULL) goto fail; + rc = (jboolean)DuplicateHandle((HANDLE)arg0, (HANDLE)arg1, (HANDLE)arg2, (LPHANDLE)lparg3, (DWORD)arg4, arg5, (DWORD)arg6); +fail: + if (arg3 && lparg3) (*env)->ReleaseIntLongArrayElements(env, arg3, lparg3, 0); + OS_NATIVE_EXIT(env, that, DuplicateHandle_FUNC); + return rc; +} +#endif + #ifndef NO_DwmEnableBlurBehindWindow JNIEXPORT jint JNICALL OS_NATIVE(DwmEnableBlurBehindWindow) (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) @@ -3710,6 +3726,18 @@ } #endif +#ifndef NO_GetCurrentProcess +JNIEXPORT jintLong JNICALL OS_NATIVE(GetCurrentProcess) + (JNIEnv *env, jclass that) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, GetCurrentProcess_FUNC); + rc = (jintLong)GetCurrentProcess(); + OS_NATIVE_EXIT(env, that, GetCurrentProcess_FUNC); + return rc; +} +#endif + #ifndef NO_GetCurrentProcessId JNIEXPORT jint JNICALL OS_NATIVE(GetCurrentProcessId) (JNIEnv *env, jclass that) @@ -8191,6 +8219,18 @@ } #endif +#ifndef NO_MapViewOfFile +JNIEXPORT jintLong JNICALL OS_NATIVE(MapViewOfFile) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3, jint arg4) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, MapViewOfFile_FUNC); + rc = (jintLong)MapViewOfFile((HANDLE)arg0, (DWORD)arg1, (DWORD)arg2, (DWORD)arg3, arg4); + OS_NATIVE_EXIT(env, that, MapViewOfFile_FUNC); + return rc; +} +#endif + #ifndef NO_MapVirtualKeyA JNIEXPORT jint JNICALL OS_NATIVE(MapVirtualKeyA) (JNIEnv *env, jclass that, jint arg0, jint arg1) @@ -11510,6 +11550,18 @@ } #endif +#ifndef NO_OpenProcess +JNIEXPORT jintLong JNICALL OS_NATIVE(OpenProcess) + (JNIEnv *env, jclass that, jint arg0, jboolean arg1, jint arg2) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, OpenProcess_FUNC); + rc = (jintLong)OpenProcess((DWORD)arg0, arg1, (DWORD)arg2); + OS_NATIVE_EXIT(env, that, OpenProcess_FUNC); + return rc; +} +#endif + #ifndef NO_OpenThemeData JNIEXPORT jintLong JNICALL OS_NATIVE(OpenThemeData) (JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1) @@ -16790,6 +16842,18 @@ } #endif +#ifndef NO_UnmapViewOfFile +JNIEXPORT jboolean JNICALL OS_NATIVE(UnmapViewOfFile) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, UnmapViewOfFile_FUNC); + rc = (jboolean)UnmapViewOfFile((LPCVOID)arg0); + OS_NATIVE_EXIT(env, that, UnmapViewOfFile_FUNC); + return rc; +} +#endif + #ifndef NO_UnregisterClassA JNIEXPORT jboolean JNICALL OS_NATIVE(UnregisterClassA) (JNIEnv *env, jclass that, jbyteArray arg0, jintLong arg1) Index: Eclipse SWT PI/win32/library/os_stats.c =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c,v retrieving revision 1.127 diff -u -r1.127 os_stats.c --- Eclipse SWT PI/win32/library/os_stats.c 12 Nov 2009 20:13:57 -0000 1.127 +++ Eclipse SWT PI/win32/library/os_stats.c 30 Nov 2009 21:28:15 -0000 @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 979; -int OS_nativeFunctionCallCount[979]; +int OS_nativeFunctionCount = 984; +int OS_nativeFunctionCallCount[984]; char * OS_nativeFunctionNames[] = { "ACCEL_1sizeof", "ACTCTX_1sizeof", @@ -181,6 +181,7 @@ "DrawThemeIcon", "DrawThemeParentBackground", "DrawThemeText", + "DuplicateHandle", "DwmEnableBlurBehindWindow", "DwmExtendFrameIntoClientArea", "EMREXTCREATEFONTINDIRECTW_1sizeof", @@ -257,6 +258,7 @@ "GetClipboardFormatNameW", "GetComboBoxInfo", "GetCurrentObject", + "GetCurrentProcess", "GetCurrentProcessId", "GetCurrentThreadId", "GetCursor", @@ -630,6 +632,7 @@ "MONITORINFO_1sizeof", "MOUSEINPUT_1sizeof", "MSG_1sizeof", + "MapViewOfFile", "MapVirtualKeyA", "MapVirtualKeyW", #ifndef JNI64 @@ -1154,6 +1157,7 @@ "OleInitialize", "OleUninitialize", "OpenClipboard", + "OpenProcess", "OpenThemeData", "PAINTSTRUCT_1sizeof", "PANOSE_1sizeof", @@ -1734,6 +1738,7 @@ "TreeView_1GetItemRect", "UDACCEL_1sizeof", "UnhookWindowsHookEx", + "UnmapViewOfFile", "UnregisterClassA", "UnregisterClassW", "UpdateLayeredWindow", Index: Eclipse SWT PI/win32/library/os_stats.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h,v retrieving revision 1.127 diff -u -r1.127 os_stats.h --- Eclipse SWT PI/win32/library/os_stats.h 12 Nov 2009 20:13:57 -0000 1.127 +++ Eclipse SWT PI/win32/library/os_stats.h 30 Nov 2009 21:28:15 -0000 @@ -189,6 +189,7 @@ DrawThemeIcon_FUNC, DrawThemeParentBackground_FUNC, DrawThemeText_FUNC, + DuplicateHandle_FUNC, DwmEnableBlurBehindWindow_FUNC, DwmExtendFrameIntoClientArea_FUNC, EMREXTCREATEFONTINDIRECTW_1sizeof_FUNC, @@ -265,6 +266,7 @@ GetClipboardFormatNameW_FUNC, GetComboBoxInfo_FUNC, GetCurrentObject_FUNC, + GetCurrentProcess_FUNC, GetCurrentProcessId_FUNC, GetCurrentThreadId_FUNC, GetCursor_FUNC, @@ -638,6 +640,7 @@ MONITORINFO_1sizeof_FUNC, MOUSEINPUT_1sizeof_FUNC, MSG_1sizeof_FUNC, + MapViewOfFile_FUNC, MapVirtualKeyA_FUNC, MapVirtualKeyW_FUNC, #ifndef JNI64 @@ -1162,6 +1165,7 @@ OleInitialize_FUNC, OleUninitialize_FUNC, OpenClipboard_FUNC, + OpenProcess_FUNC, OpenThemeData_FUNC, PAINTSTRUCT_1sizeof_FUNC, PANOSE_1sizeof_FUNC, @@ -1742,6 +1746,7 @@ TreeView_1GetItemRect_FUNC, UDACCEL_1sizeof_FUNC, UnhookWindowsHookEx_FUNC, + UnmapViewOfFile_FUNC, UnregisterClassA_FUNC, UnregisterClassW_FUNC, UpdateLayeredWindow_FUNC, Index: Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java,v retrieving revision 1.426 diff -u -r1.426 OS.java --- Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java 12 Nov 2009 20:13:57 -0000 1.426 +++ Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java 30 Nov 2009 21:28:16 -0000 @@ -670,7 +670,8 @@ public static final int FCONTROL = 0x8; public static final int FE_FONTSMOOTHINGCLEARTYPE = 0x0002; public static final int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21; - public static final int FILE_ATTRIBUTE_NORMAL = 0x00000080; + public static final int FILE_ATTRIBUTE_NORMAL = 0x00000080; + public static final int FILE_MAP_READ = 4; public static final int FNERR_INVALIDFILENAME = 0x3002; public static final int FNERR_BUFFERTOOSMALL = 0x3003; public static final int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100; @@ -6612,4 +6613,37 @@ public static final native int /*long*/ WindowFromPoint (POINT lpPoint); /** @param string cast=(const wchar_t *) */ public static final native int wcslen (int /*long*/ string); + +/** @param hFileMappingObject cast=(HANDLE) + * @param dwDesiredAccess cast=(DWORD) + * @param dwFileOffsetHigh cast=(DWORD) + * @param dwFileOffsetLow cast=(DWORD) + */ +public static final native int /*long*/ MapViewOfFile(int /*long*/ hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap); +/** @param lpBaseAddress cast=(LPCVOID) */ +public static final native boolean UnmapViewOfFile(int /*long*/ lpBaseAddress); + +public static final int PROCESS_DUP_HANDLE = 0x0040; +public static final int PROCESS_VM_READ = 0x0010; +public static final int DUPLICATE_SAME_ACCESS = 2; + +/** + * @param dwDesiredAccess cast=(DWORD) + * @param dwProcessId cast=(DWORD) + */ +public static final native int /*long*/ OpenProcess(int dwDesiredAccess, boolean bInheritHandle, int dwProcessId); + +public static final native int /*long*/ GetCurrentProcess(); + +/** + * @param hSourceProcessHandle cast=(HANDLE) + * @param hSourceHandle cast=(HANDLE) + * @param hTargetProcessHandle cast=(HANDLE) + * @param lpTargetHandle cast=(LPHANDLE) + * @param dwDesiredAccess cast=(DWORD) + * @param dwOptions cast=(DWORD) + */ +public static final native boolean DuplicateHandle(int /*long*/ hSourceProcessHandle, int /*long*/ hSourceHandle, int /*long*/ hTargetProcessHandle, + int /*long*/ [] lpTargetHandle, int dwDesiredAccess, boolean b, int dwOptions); + } Index: Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java,v retrieving revision 1.332 diff -u -r1.332 Display.java --- Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java 12 Nov 2009 19:24:19 -0000 1.332 +++ Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java 30 Nov 2009 21:28:17 -0000 @@ -22,6 +22,7 @@ import org.eclipse.swt.internal.carbon.HICommand; import org.eclipse.swt.internal.carbon.Rect; import org.eclipse.swt.internal.carbon.RGBColor; +import org.eclipse.swt.internal.carbon.AEDesc; import org.eclipse.swt.internal.cocoa.*; import org.eclipse.swt.*; @@ -106,16 +107,20 @@ * @noextend This class is not intended to be subclassed by clients. */ public class Display extends Device { - + final static int SWT_CLASS = 'S' << 24 | 'W' << 16 | 'T' << 8 | '-'; + final static int SWT_OPEN_FILE_KIND = 1; + final static int SWT_OPEN_FILE_PARAM = 'o' << 24 | 'd' << 16 | 'o' << 8 | 'c'; + /* Windows and Events */ Event [] eventQueue; Callback actionCallback, appleEventCallback, clockCallback, commandCallback, controlCallback, accessibilityCallback, appearanceCallback; Callback drawItemCallback, itemDataCallback, itemNotificationCallback, itemCompareCallback, searchCallback, trayItemCallback; Callback hitTestCallback, keyboardCallback, menuCallback, mouseHoverCallback, helpCallback, observerCallback, sourceCallback; - Callback mouseCallback, trackingCallback, windowCallback, colorCallback, textInputCallback, releaseCallback, coreEventCallback, pollingCallback; + Callback mouseCallback, trackingCallback, windowCallback, colorCallback, textInputCallback, releaseCallback, coreEventCallback; + Callback pollingCallback, launcherCallback; int actionProc, appleEventProc, clockProc, commandProc, controlProc, appearanceProc, accessibilityProc; int drawItemProc, itemDataProc, itemNotificationProc, itemCompareProc, helpProc, searchProc, trayItemProc; - int hitTestProc, keyboardProc, menuProc, mouseHoverProc, observerProc, sourceProc; + int hitTestProc, keyboardProc, menuProc, mouseHoverProc, observerProc, sourceProc, launcherProc; int mouseProc, trackingProc, windowProc, colorProc, textInputProc, releaseProc, coreEventProc, pollingProc; EventTable eventTable, filterTable; int queue, runLoop, runLoopSource, runLoopObserver, lastModifiers, lastState, lastX, lastY; @@ -900,21 +905,60 @@ } int coreEventProc (int theAppleEvent, int reply, int handlerRefcon) { - if (!disposing) { - Event event = new Event (); - sendEvent (SWT.Close, event); - if (event.doit) { - dispose (); - /* - * When the application is closing, no SWT program can continue - * to run. In order to avoid running code after the display has - * been disposed, exit from Java. - */ - /* This code is intentionally commented */ -// System.exit (0); - } else { - return OS.userCanceledErr; - } + switch(handlerRefcon) { + case OS.kAEOpenDocuments: + AEDesc docList = new AEDesc(); + int[] count = new int[1]; + OS.AEGetParamDesc(theAppleEvent, OS.keyDirectObject, OS.typeAEList, docList); + OS.AECountItems(docList, count); + for(int index = 1; index <= count[0]; index++) { + int [] theAEKeyword = new int [1]; + int [] typeCode = new int [1]; + int maximumSize = 80; // size of FSRef + int dataPtr = OS.NewPtr (maximumSize); + int [] actualSize = new int [1]; + int status = OS.AEGetNthPtr (docList, 1, OS.typeFSRef, theAEKeyword, typeCode, dataPtr, maximumSize, actualSize); + if (status == OS.noErr && typeCode [0] == OS.typeFSRef) { + byte [] fsRef = new byte [actualSize [0]]; + OS.memmove (fsRef, dataPtr, actualSize [0]); + int dirUrl = OS.CFURLCreateFromFSRef (OS.kCFAllocatorDefault, fsRef); + int dirString = OS.CFURLCopyFileSystemPath(dirUrl, OS.kCFURLPOSIXPathStyle); + OS.CFRelease (dirUrl); + int length = OS.CFStringGetLength (dirString); + char [] buffer= new char [length]; + CFRange range = new CFRange (); + range.length = length; + OS.CFStringGetCharacters (dirString, range, buffer); + String string = new String(buffer); + + System.out.println("open the document: "+string); + Event event = new Event(); + event.type = SWT.OpenDoc; + event.text = string; + postEvent(event); + } + OS.DisposePtr (dataPtr); + } + OS.AEDisposeDesc(docList); + break; + case OS.kAEQuitApplication: + if (!disposing) { + Event event = new Event (); + sendEvent (SWT.Close, event); + if (event.doit) { + dispose (); + /* + * When the application is closing, no SWT program can continue + * to run. In order to avoid running code after the display has + * been disposed, exit from Java. + */ + /* This code is intentionally commented */ + // System.exit (0); + } else { + return OS.userCanceledErr; + } + } + break; } return OS.noErr; } @@ -2209,6 +2253,9 @@ pollingCallback = new Callback (this, "pollingProc", 2); pollingProc = pollingCallback.getAddress (); if (pollingProc == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); + launcherCallback = new Callback (this, "launcherProc", 3); + launcherProc = launcherCallback.getAddress (); + if (launcherProc == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); /* Install Event Handlers */ int[] mask1 = new int[] { @@ -2231,7 +2278,7 @@ OS.kEventClassAppleEvent, OS.kEventAppleEvent, }; OS.InstallEventHandler (appTarget, appleEventProc, mask3.length / 2, mask3, 0, null); - OS.AEInstallEventHandler(OS.kCoreEventClass, OS.kAEQuitApplication, coreEventProc, 0, false); + OS.AEInstallEventHandler(OS.kCoreEventClass, OS.kAEQuitApplication, coreEventProc, OS.kAEQuitApplication, false); int [] mask4 = new int[] { OS.kEventClassKeyboard, OS.kEventRawKeyDown, @@ -2253,7 +2300,13 @@ OS.AEInstallEventHandler (OS.kAppearanceEventClass, OS.kAESmallSystemFontChanged, appearanceProc, 0, false); OS.AEInstallEventHandler (OS.kAppearanceEventClass, OS.kAESystemFontChanged, appearanceProc, 0, false); OS.AEInstallEventHandler (OS.kAppearanceEventClass, OS.kAEViewsFontChanged, appearanceProc, 0, false); - + + int[] mask6 = new int[] { + SWT_CLASS, SWT_OPEN_FILE_KIND, + }; + OS.InstallEventHandler (appTarget, launcherProc, mask6.length / 2, mask6, 0, null); + OS.AEInstallEventHandler(OS.kCoreEventClass, OS.kAEOpenDocuments, coreEventProc, OS.kAEOpenDocuments, false); + int mode = OS.kCFRunLoopCommonModes (); int activities = OS.kCFRunLoopBeforeWaiting; runLoopObserver = OS.CFRunLoopObserverCreate (OS.kCFAllocatorDefault, activities, true, 0, observerProc, 0); @@ -2477,6 +2530,25 @@ return 0; } +int launcherProc (int nextHandler, int theEvent, int userData) { + int [] stringRef = new int [1]; + OS.GetEventParameter (theEvent, SWT_OPEN_FILE_PARAM, OS.typeCFStringRef, null, 4, null, stringRef); + int length = 0; + if (stringRef [0] != 0) length = OS.CFStringGetLength (stringRef [0]); + char [] buffer= new char [length]; + CFRange range = new CFRange (); + range.length = length; + OS.CFStringGetCharacters (stringRef [0], range, buffer); + String filePath = new String(buffer); + + System.out.println("Posting OpenDoc event for " + filePath); + Event event = new Event(); + event.type = SWT.OpenDoc; + event.text = filePath; + postEvent(event); + + return OS.noErr; +} /** * Generate a low level system event. * Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java,v retrieving revision 1.302 diff -u -r1.302 Display.java --- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java 17 Nov 2009 18:32:18 -0000 1.302 +++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java 30 Nov 2009 21:28:18 -0000 @@ -165,7 +165,7 @@ // the following Callbacks are never freed static Callback windowCallback2, windowCallback3, windowCallback4, windowCallback5, windowCallback6; static Callback dialogCallback3, dialogCallback4, dialogCallback5; - static Callback applicationCallback2, applicationCallback3, applicationCallback6; + static Callback applicationCallback2, applicationCallback3, applicationCallback4, applicationCallback6; /* Display Shutdown */ Runnable [] disposeList; @@ -840,6 +840,9 @@ applicationCallback3 = new Callback(clazz, "applicationProc", 3); int /*long*/ proc3 = applicationCallback3.getAddress(); if (proc3 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); + applicationCallback4 = new Callback(clazz, "applicationProc", 4); + int /*long*/ proc4 = applicationCallback4.getAddress(); + if (proc4 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); applicationCallback6 = new Callback(clazz, "applicationProc", 6); int /*long*/ proc6 = applicationCallback6.getAddress(); if (proc6 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); @@ -857,6 +860,9 @@ int /*long*/ appProc3 = applicationCallback3.getAddress(); if (appProc3 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); + int /*long*/ appProc4 = applicationCallback4.getAddress(); + if (appProc4 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); + cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); OS.class_addMethod(cls, OS.sel_applicationWillFinishLaunching_, appProc3, "@:@"); OS.class_addMethod(cls, OS.sel_terminate_, appProc3, "@:@"); OS.class_addMethod(cls, OS.sel_quitRequested_, appProc3, "@:@"); @@ -866,11 +872,15 @@ OS.class_addMethod(cls, OS.sel_unhideAllApplications_, appProc3, "@:@"); OS.class_addMethod(cls, OS.sel_applicationDidBecomeActive_, appProc3, "@:@"); OS.class_addMethod(cls, OS.sel_applicationDidResignActive_, appProc3, "@:@"); + OS.class_addMethod(cls, OS.sel_application_openFile_, appProc4, "@:@B"); + OS.class_addMethod(cls, OS.sel_application_openFiles_, appProc4, "@:@@"); + OS.class_addMethod(cls, OS.sel_applicationShouldHandleReopen_hasVisibleWindows_, appProc4, "@:@B"); OS.objc_registerClassPair(cls); } if (!isEmbedded) { if (applicationDelegate == null) { applicationDelegate = (SWTApplicationDelegate)new SWTApplicationDelegate().alloc().init(); + System.out.println("delegate set"); application.setDelegate(applicationDelegate); } } @@ -878,8 +888,32 @@ int[] bufferMode = new int[1], bufferOptions = new int[1]; OS.GetSystemUIMode(bufferMode, bufferOptions); systemUIMode = bufferMode[0]; - systemUIOptions = bufferOptions[0]; -} + systemUIOptions = bufferOptions[0]; + + +// Callback openDocCallback = new Callback (this, "handleOpenDocument", 4); //$NON-NLS-1$ +// int /*long*/ openDocProc = openDocCallback.getAddress (); +// if (openDocProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); +// int /*long*/ sel_openDocuments = OS.sel_registerName("handleOpenDocuments:withReplyEvent:"); +// +// className = "AppleEventDelegate"; +// if (OS.objc_lookUpClass (className) == 0) { +// cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); +// OS.class_addMethod(cls, sel_openDocuments, openDocProc, "@:@@"); +// +// } +// +// NSObject appleEventDelegate = new AppleEventDelegate().alloc().init().autorelease(); +// NSAppleEventManager manager = NSAppleEventManager.sharedAppleEventManager(); +// int kCoreEventClass = ('a'<<24) + ('e'<<16) + ('v'<<8) + 't'; +// int kAEOpenDocuments = ('o'<<24) + ('d'<<16) + ('o'<<8) + 'c'; +// manager.setEventHandler(appleEventDelegate, sel_openDocuments, kCoreEventClass, kAEOpenDocuments); +} +// +//int handleOpenDocument(int /*long*/ id, int /*long*/ sel, int /*long*/ event, int /*long*/ replyEvent) { +// System.out.println("ODOCODOCODOCODOCODOCODOCODOCODOCODOCODOCODOCODOCODOC!!!!!"); +// return 0; +//} void createMainMenu () { NSString appName = getAppName(); @@ -4458,6 +4492,7 @@ } void applicationWillFinishLaunching (int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { + System.out.println("application will finish launching"); boolean loaded = false; NSBundle bundle = NSBundle.bundleWithIdentifier(NSString.stringWith("com.apple.JavaVM")); NSDictionary dict = NSDictionary.dictionaryWithObject(applicationDelegate, NSString.stringWith("NSOwner")); @@ -4558,6 +4593,28 @@ return 0; } +static int /*long*/ applicationProc(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0, int /*long*/ arg1) { + if (sel == OS.sel_application_openFile_) { + System.out.println("open file: " + new NSString(arg1).getString()); + return 1; + } + else if (sel == OS.sel_application_openFiles_) { + System.out.println("open files:"); + NSArray files = new NSArray(arg1); + int /*long*/ count = files.count(); + for (int i=0; i + * This event is sent when SWT receives notification that a file + * should be opened. + *

+ */ + public static final int OpenDoc = 46; + /* Event Details */ /** Index: Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java,v retrieving revision 1.329 diff -u -r1.329 Display.java --- Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java 13 Nov 2009 20:45:29 -0000 1.329 +++ Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java 30 Nov 2009 21:28:18 -0000 @@ -235,10 +235,12 @@ Callback allChildrenCallback; /* Settings callbacks */ - int /*long*/ styleSetProc; - Callback styleSetCallback; + int /*long*/ signalProc; + Callback signalCallback; int /*long*/ shellHandle; boolean settingsChanged, runSettings; + static final int STYLE_SET = 1; + static final int PROPERTY_NOTIFY = 2; /* Entry focus behaviour */ boolean entrySelectOnFocus; @@ -988,6 +990,7 @@ if (shellHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES); OS.gtk_widget_realize (shellHandle); + /* Initialize the filter and event callback */ eventCallback = new Callback (this, "eventProc", 2); //$NON-NLS-1$ eventProc = eventCallback.getAddress (); @@ -997,6 +1000,19 @@ filterProc = filterCallback.getAddress (); if (filterProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); OS.gdk_window_add_filter (0, filterProc, 0); + + System.out.println("Creating atom: " + "SWT_Window_"+APP_NAME); + int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid(OS.GTK_WIDGET_WINDOW(shellHandle)); + byte[] atomName = Converter.wcsToMbcs(null, "SWT_Window_" + APP_NAME, true); //$NON-NLS-1$ + int /*long*/ atom = OS.XInternAtom(OS.GDK_DISPLAY(), atomName, false); + OS.XSetSelectionOwner(OS.GDK_DISPLAY(), atom, xWindow, OS.CurrentTime); + OS.XGetSelectionOwner(OS.GDK_DISPLAY(), atom); + + signalCallback = new Callback (this, "signalProc", 3); //$NON-NLS-1$ + signalProc = signalCallback.getAddress (); + if (signalProc == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); + OS.gtk_widget_add_events (shellHandle, OS.GDK_PROPERTY_CHANGE_MASK); + OS.g_signal_connect (shellHandle, OS.property_notify_event, signalProc, PROPERTY_NOTIFY); } Image createImage (String name) { @@ -2566,10 +2582,7 @@ } void initializeSystemSettings () { - styleSetCallback = new Callback (this, "styleSetProc", 3); //$NON-NLS-1$ - styleSetProc = styleSetCallback.getAddress (); - if (styleSetProc == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); - OS.g_signal_connect (shellHandle, OS.style_set, styleSetProc, 0); + OS.g_signal_connect (shellHandle, OS.style_set, signalProc, STYLE_SET); /* * Feature in GTK. Despite the fact that the @@ -3332,8 +3345,8 @@ shellHandle = 0; /* Dispose the settings callback */ - styleSetCallback.dispose(); styleSetCallback = null; - styleSetProc = 0; + signalCallback.dispose(); signalCallback = null; + signalProc = 0; /* Dispose subclass */ if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { @@ -4128,8 +4141,50 @@ return widget.shellMapProc (handle, arg0, user_data); } -int /*long*/ styleSetProc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) { - settingsChanged = true; +int /*long*/ signalProc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) { + switch(user_data) { + case STYLE_SET: + settingsChanged = true; + break; + case PROPERTY_NOTIFY: + GdkEventProperty gdkEvent = new GdkEventProperty(); + OS.memmove(gdkEvent, arg1); + if (gdkEvent.type == OS.GDK_PROPERTY_NOTIFY) { + byte[] name = Converter.wcsToMbcs (null, "org.eclipse.swt.filePath.message", true); //$NON-NLS-1$ + int /*long*/ atom = OS.gdk_x11_atom_to_xatom(OS.gdk_atom_intern (name, true)); + if (atom == OS.gdk_x11_atom_to_xatom(gdkEvent.atom)) { + int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid(OS.GTK_WIDGET_WINDOW(shellHandle)); + int /*long*/ [] type = new int /*long*/ [1]; + int /*long*/ [] format = new int /*long*/ [1]; + long [] nitems = new long [1]; + long [] bytes_after = new long [1]; + int /*long*/ [] data = new int /*long*/ [1]; + OS.XGetWindowProperty(OS.GDK_DISPLAY(), xWindow, atom, 0l, -1l, true, OS.AnyPropertyType, + type, format, nitems, bytes_after, data); + + if (nitems[0] > 0) { + byte[] buffer = new byte[(int)/*64*/nitems[0]]; + OS.memmove(buffer, data[0], buffer.length); + OS.XFree(data[0]); + char[] chars = Converter.mbcsToWcs(null, buffer); + String string = new String(chars); + int lastIndex = 0; + int index = string.indexOf(':'); + while (index != -1) { + String file = string.substring(lastIndex, index); + Event event = new Event(); + event.type = SWT.OpenFile; + event.text = file; + postEvent(event); + lastIndex = index+1; + index = string.indexOf(':', lastIndex); + } + } + } + + } + break; + } return 0; } Index: Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java,v retrieving revision 1.327 diff -u -r1.327 Display.java --- Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java 23 Nov 2009 14:02:30 -0000 1.327 +++ Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java 30 Nov 2009 21:28:19 -0000 @@ -109,13 +109,15 @@ */ public MSG msg = new MSG (); + static String APP_NAME; + /* Windows and Events */ Event [] eventQueue; Callback windowCallback; int /*long*/ windowProc; int threadId; TCHAR windowClass, windowShadowClass, windowOwnDCClass; - static int WindowClassCount; + static int WindowClassCount = 1000; static final String WindowName = "SWT_Window"; //$NON-NLS-1$ static final String WindowShadowName = "SWT_WindowShadow"; //$NON-NLS-1$ static final String WindowOwnDCName = "SWT_WindowOwnDC"; //$NON-NLS-1$ @@ -389,6 +391,7 @@ static int SWT_TASKBARCREATED; static int SWT_RESTORECARET; static int DI_GETDRAGIMAGE; + static int SWT_FILEOPEN; /* Workaround for Adobe Reader 7.0 */ int hitCount; @@ -2569,7 +2572,7 @@ windowShadowClass = new TCHAR (0, WindowShadowName + WindowClassCount, true); windowOwnDCClass = new TCHAR (0, WindowOwnDCName + WindowClassCount, true); WindowClassCount++; - + /* Register the SWT window class */ int /*long*/ hHeap = OS.GetProcessHeap (); int /*long*/ hInstance = OS.GetModuleHandle (null); @@ -2632,6 +2635,8 @@ 0, hInstance, null); + String title = "SWT_Window_"+APP_NAME; + OS.SetWindowText(hwndMessage, new TCHAR(0, title, true)); messageCallback = new Callback (this, "messageProc", 4); //$NON-NLS-1$ messageProc = messageCallback.getAddress (); if (messageProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS); @@ -2657,6 +2662,7 @@ SWT_TASKBARCREATED = OS.RegisterWindowMessage (new TCHAR (0, "TaskbarCreated", true)); //$NON-NLS-1$ SWT_RESTORECARET = OS.RegisterWindowMessage (new TCHAR (0, "SWT_RESTORECARET", true)); //$NON-NLS-1$ DI_GETDRAGIMAGE = OS.RegisterWindowMessage (new TCHAR (0, "ShellGetDragImage", true)); //$NON-NLS-1$ + SWT_FILEOPEN = OS.RegisterWindowMessage(new TCHAR (0, "SWT_FILEOPEN", true)); //$NON-NLS-1$ /* Initialize OLE */ if (!OS.IsWinCE) OS.OleInitialize (0); @@ -3195,11 +3201,45 @@ } } } + if ((int)/*64*/msg == SWT_FILEOPEN) { + String filename = getSharedData((int)/*64*/wParam, (int)/*64*/lParam); + Event event = new Event(); + event.type = SWT.OpenDoc; + event.text = filename; + postEvent(event); + } } } return OS.DefWindowProc (hwnd, (int)/*64*/msg, wParam, lParam); } +String getSharedData(int pid, int handle) { + String id = Integer.toHexString(pid)+"_"+Integer.toHexString(handle); + System.out.println(id); + int /*long*/ [] mapHandle = new int /*long*/ [1]; + if (pid == OS.GetCurrentProcessId()) { + mapHandle[0] = handle; + } else { + int /*long*/ processHandle = OS.OpenProcess(OS.PROCESS_VM_READ|OS.PROCESS_DUP_HANDLE, false, pid); + if (processHandle == 0) return null; + OS.DuplicateHandle(processHandle, handle, OS.GetCurrentProcess(), mapHandle, OS.DUPLICATE_SAME_ACCESS, false, OS.DUPLICATE_SAME_ACCESS); + OS.CloseHandle(processHandle); + } + + int /*long*/ sharedData = OS.MapViewOfFile(mapHandle[0], OS.FILE_MAP_READ, 0, 0, 0); + if (sharedData == 0) return null; + int length = OS.IsUnicode ? OS.wcslen (sharedData) : OS.strlen (sharedData); + TCHAR buffer = new TCHAR (0, length); + int byteCount = buffer.length () * TCHAR.sizeof; + OS.MoveMemory (buffer, sharedData, byteCount); + String result = buffer.toString (0, length); + OS.UnmapViewOfFile(sharedData); + if (handle != mapHandle[0]) { + OS.CloseHandle(mapHandle[0]); + } + return result; +} + int /*long*/ monitorEnumProc (int /*long*/ hmonitor, int /*long*/ hdc, int /*long*/ lprcMonitor, int /*long*/ dwData) { if (monitorCount >= monitors.length) { Monitor[] newMonitors = new Monitor [monitors.length + 4]; @@ -4272,7 +4312,7 @@ * @param name the new app name or null */ public static void setAppName (String name) { - /* Do nothing */ + APP_NAME = name; } void setModalDialog (Dialog modalDailog) {