src/macosx/native/sun/awt/CDragSource.m

Print this page

        

*** 95,105 **** dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount timeStamp:(jlong)timeStamp ! dragImage:(jobject)jDragImage dragImageOffsetX:(jint)jDragImageOffsetX dragImageOffsetY:(jint)jDragImageOffsetY sourceActions:(jint)jSourceActions formats:(jlongArray)jFormats formatMap:(jobject)jFormatMap --- 95,105 ---- dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount timeStamp:(jlong)timeStamp ! dragImage:(jlong)nsDragImagePtr dragImageOffsetX:(jint)jDragImageOffsetX dragImageOffsetY:(jint)jDragImageOffsetY sourceActions:(jint)jSourceActions formats:(jlongArray)jFormats formatMap:(jobject)jFormatMap
*** 110,139 **** fView = nil; fComponent = nil; // Construct the object if we have a valid model for it: if (control != nil) { ! JNIEnv *env = [ThreadUtilities getJNIEnv]; ! fComponent = JNFNewGlobalRef(env, jComponent); ! fDragSourceContextPeer = JNFNewGlobalRef(env, jDragSourceContextPeer); ! ! fTransferable = JNFNewGlobalRef(env, jTransferable); ! fTriggerEvent = JNFNewGlobalRef(env, jTrigger); ! ! if (jDragImage) { ! JNF_MEMBER_CACHE(nsImagePtr, CImageClass, "ptr", "J"); ! jlong imgPtr = JNFGetLongField(env, jDragImage, nsImagePtr); ! fDragImage = (NSImage*) jlong_to_ptr(imgPtr); // Double-casting prevents compiler 'd$|// [fDragImage retain]; } fDragImageOffset = NSMakePoint(jDragImageOffsetX, jDragImageOffsetY); fSourceActions = jSourceActions; ! fFormats = JNFNewGlobalRef(env, jFormats); ! fFormatMap = JNFNewGlobalRef(env, jFormatMap); fTriggerEventTimeStamp = timeStamp; fDragPos = NSMakePoint(dragPosX, dragPosY); fClickCount = clickCount; fModifiers = extModifiers; --- 110,134 ---- fView = nil; fComponent = nil; // Construct the object if we have a valid model for it: if (control != nil) { ! fComponent = jComponent; ! fDragSourceContextPeer = jDragSourceContextPeer; ! fTransferable = jTransferable; ! fTriggerEvent = jTrigger; + if (nsDragImagePtr) { + fDragImage = (NSImage*) jlong_to_ptr(nsDragImagePtr); // Double-casting prevents compiler 'd$|// [fDragImage retain]; } fDragImageOffset = NSMakePoint(jDragImageOffsetX, jDragImageOffsetY); fSourceActions = jSourceActions; ! fFormats = jFormats; ! fFormatMap = jFormatMap; fTriggerEventTimeStamp = timeStamp; fDragPos = NSMakePoint(dragPosX, dragPosY); fClickCount = clickCount; fModifiers = extModifiers;