/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#import "sun_lwawt_macosx_CDropTargetContextPeer.h"
#import "CDataTransferer.h"
#import "CDropTarget.h"
#import "DnDUtilities.h"
#import "ThreadUtilities.h"
static void TransferFailed(JNIEnv *env, jobject jthis, jlong jdroptarget, jlong jdroptransfer, jlong jformat) {
}
// Make sure the drop target is of the right kind:
return dropTarget;
}
return nil;
}
/*
* Class: sun_lwawt_macosx_CDropTargetContextPeer
* Method: startTransfer
* Signature: (JJ)J
*/
{
// Currently startTransfer and endTransfer are synchronous since [CDropTarget copyDraggingDataForFormat]
// works off a data copy and doesn't have to go to the native event thread to get the data.
// We can have endTransfer just call startTransfer.
// Get the drop target native object:
if (dropTarget == nil) {
DLog2(@"[CDropTargetContextPeer startTransfer]: GetCDropTarget failed for %d.\n", (NSInteger) jdroptarget);
return result;
}
DLog2(@"[CDropTargetContextPeer startTransfer]: couldn't get newData method for %d.\n", (NSInteger) jdroptarget);
return result;
}
// Get data from drop target:
if (!jdropdata) {
DLog2(@"[CDropTargetContextPeer startTransfer]: copyDraggingDataForFormat failed for %d.\n", (NSInteger) jdroptarget);
return result;
}
// Pass the data to drop target:
@try {
} @catch (NSException *ex) {
DLog2(@"[CDropTargetContextPeer startTransfer]: exception in newData() for %d.\n", (NSInteger) jdroptarget);
return result;
}
// if no error return dropTarget's draggingSequence
return result;
}
/*
* Class: sun_lwawt_macosx_CDropTargetContextPeer
* Method: addTransfer
* Signature: (JJJ)V
*/
{
// Currently startTransfer and endTransfer are synchronous since [CDropTarget copyDraggingDataForFormat]
// works off a data copy and doesn't have to go to the native event thread to get the data.
// We can have endTransfer just call startTransfer.
return;
}
/*
* Class: sun_lwawt_macosx_CDropTargetContextPeer
* Method: dropDone
* Signature: (JJZZI)V
*/
(JNIEnv *env, jobject jthis, jlong jdroptarget, jlong jdroptransfer, jboolean jislocal, jboolean jsuccess, jint jdropaction)
{
// Get the drop target native object:
if (dropTarget == nil) {
DLog2(@"[CDropTargetContextPeer dropDone]: GetCDropTarget failed for %d.\n", (NSInteger) jdroptarget);
return;
}
// Notify drop target Java is all done with this dragging sequence:
return;
}