Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2001-07-11 09:32:08 -0400
committerVeronika Irvine2001-07-11 09:32:08 -0400
commita59e414fcb2248d84c6d6f8e548fd54e7d1ffa46 (patch)
treebb6ac36aa31dcc353d9199e73372a00f7f52c8ce
parent160b2ac54493b2ae0dd5abbba9e49b8d158b1aea (diff)
downloadeclipse.platform.swt-Photon_DND.tar.gz
eclipse.platform.swt-Photon_DND.tar.xz
eclipse.platform.swt-Photon_DND.zip
*** empty log message ***Photon_DND
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java5
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java49
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c34
3 files changed, 7 insertions, 81 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java
index 8ad4710a57..b17171b027 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java
@@ -83,6 +83,7 @@ public void setContents(Object[] data, Transfer[] transferAgents){
if (OS.PhClipboardCopy((short)ig, 0, null) != 0) {
DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
}
+ return;
}
if (transferAgents == null || data.length != transferAgents.length) {
DND.error(SWT.ERROR_INVALID_ARGUMENT);
@@ -94,10 +95,10 @@ public void setContents(Object[] data, Transfer[] transferAgents){
String[] names = transferAgents[i].getTypeNames();
int[] ids = transferAgents[i].getTypeIds();
for (int j = 0; j < names.length; j++) {
- PhClipHeader clip = new PhClipHeader();
TransferData transferData = new TransferData();
transferData.type = ids[j];
transferAgents[i].javaToNative(data[i], transferData);
+ PhClipHeader clip = new PhClipHeader();
clip.data = transferData.pData;
clip.length = (short)transferData.length;
byte[] temp = Converter.wcsToMbcs(null, names[j], true);
@@ -111,13 +112,13 @@ public void setContents(Object[] data, Transfer[] transferAgents){
clip.type_5 = type[5];
clip.type_6 = type[6];
clip.type_7 = type[7];
- count++;
byte[] buffer = new byte[PhClipHeader.sizeof];
OS.memmove(buffer, clip, PhClipHeader.sizeof);
byte[] newClips = new byte[clips.length + buffer.length];
System.arraycopy(clips, 0, newClips, 0, clips.length);
System.arraycopy(buffer, 0, newClips, clips.length, buffer.length);
clips = newClips;
+ count++;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java
index 6254278446..f311c62182 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java
@@ -16,54 +16,11 @@ public static FileTransfer getInstance () {
return _instance;
}
public void javaToNative(Object object, TransferData transferData) {
-
- if (object == null || !(object instanceof String[])) return;
-
- // build a byte array from data
- String[] files = (String[])object;
-
- // create a string separated by "new lines" to represent list of files
- String nativeFormat = "file:";
- for (int i = 0, length = files.length; i < length; i++){
- nativeFormat += files[i]+"\r";
- }
- nativeFormat += "\0";
- // pass byte array on to super to convert to native
- super.javaToNative(nativeFormat.getBytes(), transferData);
+ DND.error(org.eclipse.swt.SWT.ERROR_NOT_IMPLEMENTED);
}
public Object nativeToJava(TransferData transferData) {
-
-System.out.println("data is "+transferData.pData+" with length "+transferData.length);
- byte[] data = (byte[])super.nativeToJava(transferData);
-System.out.println("data byte[] length is "+data.length);
-for (int i = 0; i < data.length; i++) {
- System.out.println("data["+i+"] = "+(char)data[i]);
-}
- if (data == null) return null;
- char [] unicode = org.eclipse.swt.internal.Converter.mbcsToWcs (null, data);
- String string = new String (unicode);
-System.out.println("nativeToJava string is "+string);
-
- // parse data and convert string to array of files
- int start = string.indexOf("file:");
- if (start == -1) return null;
- start += 5;
- String[] fileNames = new String[0];
- while (start < string.length()) {
- int end = string.indexOf("\r", start);
- if (end == -1) end = string.length() - 1;
-
- String fileName = string.substring(start, end);
- String[] newFileNames = new String[fileNames.length + 1];
- System.arraycopy(fileNames, 0, newFileNames, 0, fileNames.length);
- newFileNames[fileNames.length] = fileName;
- fileNames = newFileNames;
-
- start = string.indexOf("file:", end);
- if (start == -1) break;
- start += 5;
- }
- return fileNames;
+ DND.error(org.eclipse.swt.SWT.ERROR_NOT_IMPLEMENTED);
+ return null;
}
protected String[] getTypeNames(){
return new String[]{TYPENAME};
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c
index 11c852870e..5bb0591a07 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c
@@ -6543,39 +6543,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PhClipboardCopy
return result;
}
-
-/*
- * Class: org_eclipse_swt_internal_photon_OS
- * Method: PhClipboardCopy
- * Signature: (SILorg.eclipse.swt.internal.photon.PhClipHeader;)I
- */
- /*
-JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PhClipboardCopy
- (JNIEnv *env, jclass that, jshort ig, jint n, jobject clip)
-{
- DECL_GLOB(pGlob)
- PhClipHeader clip1, *lpclip1=NULL;
- jint result;
-
-#ifdef DEBUG_CALL_PRINTS
- fprintf(stderr, "PhClipboardCopy\n");
-#endif
-
- if (clip) {
- lpclip1 = &clip1;
- cachePhClipHeaderFids(env, clip, &PGLOB(PhClipHeaderFc));
- getPhClipHeaderFields(env, clip, lpclip1, &PGLOB(PhClipHeaderFc));
- }
- result = (jint)PhClipboardCopy(ig, n, (PhClipHeader const *)lpclip1);
-
-printf("PhClipHeader size of struct is %d\n", sizeof(clip1));
-
- if (clip) {
- setPhClipHeaderFields(env, clip, lpclip1, &PGLOB(PhClipHeaderFc));
- }
- return result;
-}
-*/
+
/*
* Class: org_eclipse_swt_internal_photon_OS
* Method: PhClipboardPasteStart

Back to the top