Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2001-06-27 16:40:11 -0400
committerVeronika Irvine2001-06-27 16:40:11 -0400
commite52ae8cabcab6e0362eee8f614964c07f1378c64 (patch)
treefa636293f7d301d355739396014f48f2499ecbf3
parentea231dac4ac8094caf963b77f8f58c7cf10b1874 (diff)
downloadeclipse.platform.swt-e52ae8cabcab6e0362eee8f614964c07f1378c64.tar.gz
eclipse.platform.swt-e52ae8cabcab6e0362eee8f614964c07f1378c64.tar.xz
eclipse.platform.swt-e52ae8cabcab6e0362eee8f614964c07f1378c64.zip
VI Clipboard hacking
-rwxr-xr-xbundles/org.eclipse.swt/.vcm_meta1
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/ByteArrayTransfer.java11
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java93
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TransferData.java5
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.c147
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.h41
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c270
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/OS.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/PhClipHeader.java19
9 files changed, 584 insertions, 25 deletions
diff --git a/bundles/org.eclipse.swt/.vcm_meta b/bundles/org.eclipse.swt/.vcm_meta
index 67f905f685..0c9e8d8b7a 100755
--- a/bundles/org.eclipse.swt/.vcm_meta
+++ b/bundles/org.eclipse.swt/.vcm_meta
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-description>
- <comment></comment>
<nature id="org.eclipse.jdt.core.javanature"/>
<nature id="org.eclipse.pde.PluginNature"/>
<builder name="org.eclipse.jdt.core.javabuilder">
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/ByteArrayTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/ByteArrayTransfer.java
index 63f1eb6159..278185d4d5 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/ByteArrayTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/ByteArrayTransfer.java
@@ -30,19 +30,18 @@ protected void javaToNative (Object object, TransferData transferData){
return;
}
byte[] buffer = (byte[])object;
-// transferData.pValue = OS.XtMalloc(buffer.length + 1);
-// OS.memmove(transferData.pValue, buffer, buffer.length);
+ transferData.pData = OS.malloc(buffer.length + 1);
+ OS.memmove(transferData.pData, buffer, buffer.length);
transferData.length = buffer.length;
- transferData.format = 8;
transferData.result = 1;
}
protected Object nativeToJava(TransferData transferData){
- if (transferData.pValue == 0 || !(isSupportedType(transferData))) return null;
+ if (transferData.pData == 0 || !(isSupportedType(transferData))) return null;
- int size = transferData.format * transferData.length / 8;
+ int size = transferData.length;
byte[] buffer = new byte[size];
-// OS.memmove(buffer, transferData.pValue, size);
+ OS.memmove(buffer, transferData.pData, size);
return buffer;
}
}
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 bd8b75d483..89e1aea964 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
@@ -19,7 +19,6 @@ public class Clipboard {
private Display display;
private final int MAX_RETRIES = 10;
- private int shellHandle;
public Clipboard(Display display) {
@@ -34,11 +33,6 @@ public Clipboard(Display display) {
SWT.error(SWT.ERROR_THREAD_INVALID_ACCESS);
}
this.display = display;
-
-// int widgetClass = OS.TopLevelShellWidgetClass ();
-// shellHandle = OS.XtAppCreateShell (null, null, widgetClass, display.xDisplay, null, 0);
-// OS.XtSetMappedWhenManaged (shellHandle, false);
-// OS.XtRealizeWidget (shellHandle);
}
protected void checkSubclass () {
String name = getClass().getName ();
@@ -48,15 +42,96 @@ protected void checkSubclass () {
}
}
public void dispose () {
-// if (shellHandle != 0) OS.XtDestroyWidget (shellHandle);
-// shellHandle = 0;
display = null;
}
public Object getContents(Transfer transfer) {
if (display.isDisposed() ) return null;
- return null;
+ int ig = OS.PhInputGroup(0);
+ int cbdata = OS.PhClipboardPasteStart((short)ig);
+ Object result = null;
+ try {
+ String[] types = transfer.getTypeNames();
+ for (int i = 0; i < types.length; i++) {
+ byte[] type = new byte[8];
+ byte[] temp = types[i].getBytes();
+ System.arraycopy(temp, 0, type, 0, Math.min(type.length, temp.length));
+ int pClipHeader = OS.PhClipboardPasteType(cbdata, type);
+ if (pClipHeader != 0) {
+ PhClipHeader clipHeader = new PhClipHeader();
+ OS.memmove(clipHeader, pClipHeader, PhClipHeader.sizeof);
+ byte[] buffer = new byte[clipHeader.length];
+ OS.memmove(buffer, clipHeader.data, buffer.length);
+ OS.free(clipHeader.data);
+ OS.free(pClipHeader);
+ result = buffer;
+ break;
+ }
+ }
+ } finally {
+ OS.PhClipboardPasteFinish(cbdata);
+ }
+ return result;
}
public void setContents(Object[] data, Transfer[] transferAgents){
+
+ if (data == null) {
+ DND.error(SWT.ERROR_NOT_IMPLEMENTED);
+ }
+ if (transferAgents == null || data.length != transferAgents.length) {
+ DND.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+
+ // copy data directly over to System clipboard (not deferred)
+ PhClipHeader[] clip = new PhClipHeader[0];
+ for (int i = 0; i < transferAgents.length; i++) {
+ String[] names = transferAgents[i].getTypeNames();
+ PhClipHeader[] tempClip = new PhClipHeader[names.length];
+ for (int j = 0; j < names.length; j++) {
+ tempClip[j] = new PhClipHeader();
+ byte[] type = new byte[8];
+ byte[] name = names[j].getBytes();
+ System.arraycopy(name, 0, type, 0, Math.min(type.length, name.length));
+ tempClip[j].type_0 = type[0];
+ tempClip[j].type_1 = type[1];
+ tempClip[j].type_2 = type[2];
+ tempClip[j].type_3 = type[3];
+ tempClip[j].type_4 = type[4];
+ tempClip[j].type_5 = type[5];
+ tempClip[j].type_6 = type[6];
+ tempClip[j].type_7 = type[7];
+ TransferData transferData = new TransferData();
+ transferAgents[i].javaToNative(data[i], transferData);
+ tempClip[j].data = transferData.pData;
+ tempClip[j].length = (short)transferData.length;
+ }
+ PhClipHeader[] newClip = new PhClipHeader[clip.length + tempClip.length];
+ System.arraycopy(clip, 0, newClip, 0, clip.length);
+ System.arraycopy(tempClip, 0, newClip, clip.length, tempClip.length);
+ clip = newClip;
+ }
+
+ int pClip = OS.malloc(clip.length * PhClipHeader.sizeof);
+ int status = -1;
+ try {
+ int offset = 0;
+ for (int i = 0; i < clip.length; i++) {
+ OS.memmove(clip[i], pClip + offset, PhClipHeader.sizeof);
+ offset += PhClipHeader.sizeof;
+ }
+
+ int ig = OS.PhInputGroup(0);
+ status = OS.PhClipboardCopy((short)ig, clip.length, pClip);
+ } finally {
+ OS.free(pClip);
+ }
+
+ for (int i = 0; i < clip.length; i++) {
+ int pData = clip[i].data;
+ if (pData != 0) OS.free(pData);
+ }
+
+ if (status != 0)
+ DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
}
/*
* Note: getAvailableTypeNames is a tool for writing a Transfer sub-class only. It should
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TransferData.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TransferData.java
index 50eabd10e9..ae75ee6293 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TransferData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TransferData.java
@@ -9,10 +9,7 @@ public class TransferData {
public int type;
// attributes specific to set/get
+ int pData;
int length;
- int format;
- int pValue;
-
int result;
-
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.c b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.c
index 51f3781910..783bbf9440 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.c
@@ -1201,4 +1201,151 @@ void setPhCursorDef_tFields(JNIEnv *env, jobject lpObject, PhCursorDef_t *lpStru
(*env)->SetShortField(env, lpObject, lpCache->hdr_len, lpStruct->hdr.len);
}
+void cachePgDisplaySettings_tFids(JNIEnv *env, jobject lpObject, PPgDisplaySettings_t_FID_CACHE lpCache)
+{
+ if (lpCache->cached) return;
+ lpCache->clazz = (*env)->GetObjectClass(env, lpObject);
+ lpCache->reserved = (*env)->GetFieldID(env, lpCache->clazz, "reserved", "[I");
+ lpCache->flags = (*env)->GetFieldID(env, lpCache->clazz, "flags", "I");
+ lpCache->refresh = (*env)->GetFieldID(env, lpCache->clazz, "refresh", "I");
+ lpCache->yres = (*env)->GetFieldID(env, lpCache->clazz, "yres", "I");
+ lpCache->xres = (*env)->GetFieldID(env, lpCache->clazz, "xres", "I");
+ lpCache->mode = (*env)->GetFieldID(env, lpCache->clazz, "mode", "I");
+ lpCache->cached = 1;
+}
+void getPgDisplaySettings_tFields(JNIEnv *env, jobject lpObject, PgDisplaySettings_t *lpStruct, PPgDisplaySettings_t_FID_CACHE lpCache)
+{
+ jintArray reserved = (*env)->GetObjectField(env, lpObject, lpCache->reserved);
+ if (reserved) {
+ jint *reserved1 = (*env)->GetIntArrayElements(env, reserved, NULL);
+ memcpy(reserved1, lpStruct->reserved, sizeof (lpStruct->reserved));
+ (*env)->ReleaseIntArrayElements(env, reserved, reserved1, JNI_ABORT);
+ }
+ lpStruct->flags = (*env)->GetIntField(env, lpObject, lpCache->flags);
+ lpStruct->refresh = (*env)->GetIntField(env, lpObject, lpCache->refresh);
+ lpStruct->yres = (*env)->GetIntField(env, lpObject, lpCache->yres);
+ lpStruct->xres = (*env)->GetIntField(env, lpObject, lpCache->xres);
+ lpStruct->mode = (*env)->GetIntField(env, lpObject, lpCache->mode);
+}
+
+void setPgDisplaySettings_tFields(JNIEnv *env, jobject lpObject, PgDisplaySettings_t *lpStruct, PPgDisplaySettings_t_FID_CACHE lpCache)
+{
+ jintArray reserved = (*env)->GetObjectField(env, lpObject, lpCache->reserved);
+ if (reserved) {
+ jint *reserved1 = (*env)->GetIntArrayElements(env, reserved, NULL);
+ memcpy(reserved1, lpStruct->reserved, sizeof (lpStruct->reserved));
+ (*env)->ReleaseIntArrayElements(env, reserved, reserved1, 0);
+ }
+ (*env)->SetIntField(env, lpObject, lpCache->flags, lpStruct->flags);
+ (*env)->SetIntField(env, lpObject, lpCache->refresh, lpStruct->refresh);
+ (*env)->SetIntField(env, lpObject, lpCache->yres, lpStruct->yres);
+ (*env)->SetIntField(env, lpObject, lpCache->xres, lpStruct->xres);
+ (*env)->SetIntField(env, lpObject, lpCache->mode, lpStruct->mode);
+}
+
+void cachePgVideoModeInfo_tFids(JNIEnv *env, jobject lpObject, PPgVideoModeInfo_t_FID_CACHE lpCache)
+{
+ if (lpCache->cached) return;
+ lpCache->clazz = (*env)->GetObjectClass(env, lpObject);
+ lpCache->refresh_rates = (*env)->GetFieldID(env, lpCache->clazz, "refresh_rates", "[B");
+ lpCache->mode_capabilities6 = (*env)->GetFieldID(env, lpCache->clazz, "mode_capabilities6", "I");
+ lpCache->mode_capabilities5 = (*env)->GetFieldID(env, lpCache->clazz, "mode_capabilities5", "I");
+ lpCache->mode_capabilities4 = (*env)->GetFieldID(env, lpCache->clazz, "mode_capabilities4", "I");
+ lpCache->mode_capabilities3 = (*env)->GetFieldID(env, lpCache->clazz, "mode_capabilities3", "I");
+ lpCache->mode_capabilities2 = (*env)->GetFieldID(env, lpCache->clazz, "mode_capabilities2", "I");
+ lpCache->mode_capabilities1 = (*env)->GetFieldID(env, lpCache->clazz, "mode_capabilities1", "I");
+ lpCache->type = (*env)->GetFieldID(env, lpCache->clazz, "type", "I");
+ lpCache->bytes_per_scanline = (*env)->GetFieldID(env, lpCache->clazz, "bytes_per_scanline", "S");
+ lpCache->bits_per_pixel = (*env)->GetFieldID(env, lpCache->clazz, "bits_per_pixel", "S");
+ lpCache->height = (*env)->GetFieldID(env, lpCache->clazz, "height", "S");
+ lpCache->width = (*env)->GetFieldID(env, lpCache->clazz, "width", "S");
+ lpCache->cached = 1;
+}
+
+void getPgVideoModeInfo_tFields(JNIEnv *env, jobject lpObject, PgVideoModeInfo_t *lpStruct, PPgVideoModeInfo_t_FID_CACHE lpCache)
+{
+ jbyteArray refresh_rates = (*env)->GetObjectField(env, lpObject, lpCache->refresh_rates);
+ if (refresh_rates) {
+ jbyte *refresh_rates1 = (*env)->GetByteArrayElements(env, refresh_rates, NULL);
+ memcpy(lpStruct->refresh_rates, refresh_rates1, sizeof(lpStruct->refresh_rates));
+ (*env)->ReleaseByteArrayElements(env, refresh_rates, refresh_rates1, JNI_ABORT);
+ }
+ lpStruct->mode_capabilities6 = (*env)->GetIntField(env, lpObject, lpCache->mode_capabilities6);
+ lpStruct->mode_capabilities5 = (*env)->GetIntField(env, lpObject, lpCache->mode_capabilities5);
+ lpStruct->mode_capabilities4 = (*env)->GetIntField(env, lpObject, lpCache->mode_capabilities4);
+ lpStruct->mode_capabilities3 = (*env)->GetIntField(env, lpObject, lpCache->mode_capabilities3);
+ lpStruct->mode_capabilities2 = (*env)->GetIntField(env, lpObject, lpCache->mode_capabilities2);
+ lpStruct->mode_capabilities1 = (*env)->GetIntField(env, lpObject, lpCache->mode_capabilities1);
+ lpStruct->type = (*env)->GetIntField(env, lpObject, lpCache->type);
+ lpStruct->bytes_per_scanline = (*env)->GetShortField(env, lpObject, lpCache->bytes_per_scanline);
+ lpStruct->bits_per_pixel = (*env)->GetShortField(env, lpObject, lpCache->bits_per_pixel);
+ lpStruct->height = (*env)->GetShortField(env, lpObject, lpCache->height);
+ lpStruct->width = (*env)->GetShortField(env, lpObject, lpCache->width);
+}
+
+void setPgVideoModeInfo_tFields(JNIEnv *env, jobject lpObject, PgVideoModeInfo_t *lpStruct, PPgVideoModeInfo_t_FID_CACHE lpCache)
+{
+ jbyteArray refresh_rates = (*env)->GetObjectField(env, lpObject, lpCache->refresh_rates);
+ if (refresh_rates) {
+ jbyte *refresh_rates1 = (*env)->GetByteArrayElements(env, refresh_rates, NULL);
+ memcpy(refresh_rates1, lpStruct->refresh_rates, sizeof(lpStruct->refresh_rates));
+ (*env)->ReleaseByteArrayElements(env, refresh_rates, refresh_rates1, 0);
+ }
+ (*env)->SetIntField(env, lpObject, lpCache->mode_capabilities6, lpStruct->mode_capabilities6);
+ (*env)->SetIntField(env, lpObject, lpCache->mode_capabilities5, lpStruct->mode_capabilities5);
+ (*env)->SetIntField(env, lpObject, lpCache->mode_capabilities4, lpStruct->mode_capabilities4);
+ (*env)->SetIntField(env, lpObject, lpCache->mode_capabilities3, lpStruct->mode_capabilities3);
+ (*env)->SetIntField(env, lpObject, lpCache->mode_capabilities2, lpStruct->mode_capabilities2);
+ (*env)->SetIntField(env, lpObject, lpCache->mode_capabilities1, lpStruct->mode_capabilities1);
+ (*env)->SetIntField(env, lpObject, lpCache->type, lpStruct->type);
+ (*env)->SetShortField(env, lpObject, lpCache->bytes_per_scanline, lpStruct->bytes_per_scanline);
+ (*env)->SetShortField(env, lpObject, lpCache->bits_per_pixel, lpStruct->bits_per_pixel);
+ (*env)->SetShortField(env, lpObject, lpCache->height, lpStruct->height);
+ (*env)->SetShortField(env, lpObject, lpCache->width, lpStruct->width);
+}
+
+void cachePhClipHeaderFids(JNIEnv *env, jobject lpObject, PPhClipHeader_FID_CACHE lpCache)
+{
+ if (lpCache->cached) return;
+ lpCache->clazz = (*env)->GetObjectClass(env, lpObject);
+ lpCache->data = (*env)->GetFieldID(env, lpCache->clazz, "data", "I");
+ lpCache->length = (*env)->GetFieldID(env, lpCache->clazz, "length", "S");
+ lpCache->type_7 = (*env)->GetFieldID(env, lpCache->clazz, "type_7", "B");
+ lpCache->type_6 = (*env)->GetFieldID(env, lpCache->clazz, "type_6", "B");
+ lpCache->type_5 = (*env)->GetFieldID(env, lpCache->clazz, "type_5", "B");
+ lpCache->type_4 = (*env)->GetFieldID(env, lpCache->clazz, "type_4", "B");
+ lpCache->type_3 = (*env)->GetFieldID(env, lpCache->clazz, "type_3", "B");
+ lpCache->type_2 = (*env)->GetFieldID(env, lpCache->clazz, "type_2", "B");
+ lpCache->type_1 = (*env)->GetFieldID(env, lpCache->clazz, "type_1", "B");
+ lpCache->type_0 = (*env)->GetFieldID(env, lpCache->clazz, "type_0", "B");
+ lpCache->cached = 1;
+}
+
+void getPhClipHeaderFields(JNIEnv *env, jobject lpObject, PhClipHeader *lpStruct, PPhClipHeader_FID_CACHE lpCache)
+{
+ lpStruct->data = (void *)(*env)->GetIntField(env, lpObject, lpCache->data);
+ lpStruct->length = (*env)->GetShortField(env, lpObject, lpCache->length);
+ lpStruct->type[7] = (*env)->GetByteField(env, lpObject, lpCache->type_7);
+ lpStruct->type[6] = (*env)->GetByteField(env, lpObject, lpCache->type_6);
+ lpStruct->type[5] = (*env)->GetByteField(env, lpObject, lpCache->type_5);
+ lpStruct->type[4] = (*env)->GetByteField(env, lpObject, lpCache->type_4);
+ lpStruct->type[3] = (*env)->GetByteField(env, lpObject, lpCache->type_3);
+ lpStruct->type[2] = (*env)->GetByteField(env, lpObject, lpCache->type_2);
+ lpStruct->type[1] = (*env)->GetByteField(env, lpObject, lpCache->type_1);
+ lpStruct->type[0] = (*env)->GetByteField(env, lpObject, lpCache->type_0);
+}
+
+void setPhClipHeaderFields(JNIEnv *env, jobject lpObject, PhClipHeader *lpStruct, PPhClipHeader_FID_CACHE lpCache)
+{
+ (*env)->SetIntField(env, lpObject, lpCache->data, (jint)lpStruct->data);
+ (*env)->SetShortField(env, lpObject, lpCache->length, lpStruct->length);
+ (*env)->SetByteField(env, lpObject, lpCache->type_7, lpStruct->type[7]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_6, lpStruct->type[6]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_5, lpStruct->type[5]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_4, lpStruct->type[4]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_3, lpStruct->type[3]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_2, lpStruct->type[2]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_1, lpStruct->type[1]);
+ (*env)->SetByteField(env, lpObject, lpCache->type_0, lpStruct->type[0]);
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.h b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.h
index 38be26ebdc..ca1493fe63 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/structs.h
@@ -39,7 +39,10 @@
PtColorSelectInfo_t_FID_CACHE PtColorSelectInfo_tFc; \
PhRegion_t_FID_CACHE PhRegion_tFc; \
PtContainerCallback_t_FID_CACHE PtContainerCallback_tFc; \
- PhCursorDef_t_FID_CACHE PhCursorDef_tFc;
+ PhCursorDef_t_FID_CACHE PhCursorDef_tFc; \
+ PgDisplaySettings_t_FID_CACHE PgDisplaySettings_tFc; \
+ PgVideoModeInfo_t_FID_CACHE PgVideoModeInfo_tFc; \
+ PhClipHeader_FID_CACHE PhClipHeaderFc;
/* PhPoint_t struct */
typedef struct PhPoint_t_FID_CACHE {
@@ -326,4 +329,40 @@ void cachePhCursorDef_tFids(JNIEnv *env, jobject lpObject, PPhCursorDef_t_FID_CA
void getPhCursorDef_tFields(JNIEnv *env, jobject lpObject, PhCursorDef_t *lpStruct, PPhCursorDef_t_FID_CACHE lpCache);
void setPhCursorDef_tFields(JNIEnv *env, jobject lpObject, PhCursorDef_t *lpStruct, PPhCursorDef_t_FID_CACHE lpCache);
+/* PgDisplaySettings_t struct */
+typedef struct PgDisplaySettings_t_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID reserved, flags, refresh, yres, xres, mode;
+} PgDisplaySettings_t_FID_CACHE;
+typedef PgDisplaySettings_t_FID_CACHE *PPgDisplaySettings_t_FID_CACHE;
+
+void cachePgDisplaySettings_tFids(JNIEnv *env, jobject lpObject, PPgDisplaySettings_t_FID_CACHE lpCache);
+void getPgDisplaySettings_tFields(JNIEnv *env, jobject lpObject, PgDisplaySettings_t *lpStruct, PPgDisplaySettings_t_FID_CACHE lpCache);
+void setPgDisplaySettings_tFields(JNIEnv *env, jobject lpObject, PgDisplaySettings_t *lpStruct, PPgDisplaySettings_t_FID_CACHE lpCache);
+
+typedef struct PgVideoModeInfo_t_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID refresh_rates, mode_capabilities6, mode_capabilities5, mode_capabilities4, mode_capabilities3, mode_capabilities2, mode_capabilities1, type, bytes_per_scanline, bits_per_pixel, height, width;
+} PgVideoModeInfo_t_FID_CACHE;
+typedef PgVideoModeInfo_t_FID_CACHE *PPgVideoModeInfo_t_FID_CACHE;
+
+void cachePgVideoModeInfo_tFids(JNIEnv *env, jobject lpObject, PPgVideoModeInfo_t_FID_CACHE lpCache);
+void getPgVideoModeInfo_tFields(JNIEnv *env, jobject lpObject, PgVideoModeInfo_t *lpStruct, PPgVideoModeInfo_t_FID_CACHE lpCache);
+void setPgVideoModeInfo_tFields(JNIEnv *env, jobject lpObject, PgVideoModeInfo_t *lpStruct, PPgVideoModeInfo_t_FID_CACHE lpCache);
+
+/* PhClipHeader struct */
+typedef struct PhClipHeader_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID data, length, type_7, type_6, type_5, type_4, type_3, type_2, type_1, type_0;
+} PhClipHeader_FID_CACHE;
+typedef PhClipHeader_FID_CACHE *PPhClipHeader_FID_CACHE;
+
+void cachePhClipHeaderFids(JNIEnv *env, jobject lpObject, PPhClipHeader_FID_CACHE lpCache);
+void getPhClipHeaderFields(JNIEnv *env, jobject lpObject, PhClipHeader *lpStruct, PPhClipHeader_FID_CACHE lpCache);
+void setPhClipHeaderFields(JNIEnv *env, jobject lpObject, PhClipHeader *lpStruct, PPhClipHeader_FID_CACHE lpCache);
+
+
#endif // INC_structs_H
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 8dbd9a0ed3..4d6a3c050e 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/library/swt.c
@@ -6345,3 +6345,273 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PtInflateBalloon
return result;
}
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: memmove
+ * Signature: (ILorg/eclipse/swt/internal/photon/PgDisplaySettings_t;I)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_memmove__ILorg_eclipse_swt_internal_photon_PgDisplaySettings_1t_2I
+ (JNIEnv *env, jobject that, jint dest, jobject src, jint count)
+{
+ DECL_GLOB(pGlob)
+
+ PgDisplaySettings_t object, *src1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_photon_PgDisplaySettings_1t_2I\n");
+#endif
+
+ if (src) {
+ src1=&object;
+ cachePgDisplaySettings_tFids(env, src, &PGLOB(PgDisplaySettings_tFc));
+ getPgDisplaySettings_tFields(env, src, src1, &PGLOB(PgDisplaySettings_tFc));
+ }
+ memmove((void *)dest, (void *)src1, count);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: memmove
+ * Signature: (Lorg/eclipse/swt/internal/photon/PgDisplaySettings_t;II)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_memmove__Lorg_eclipse_swt_internal_photon_PgDisplaySettings_1t_2II
+ (JNIEnv *env, jobject that, jobject dest, jint src, jint count)
+{
+ DECL_GLOB(pGlob)
+ PgDisplaySettings_t object, *dest1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_photon_PgDisplaySettings_1t_2II\n");
+#endif
+
+ memmove((void *)&object, (void *)src, count);
+ if (dest) {
+ dest1=&object;
+ cachePgDisplaySettings_tFids(env, dest, &PGLOB(PgDisplaySettings_tFc));
+ setPgDisplaySettings_tFields(env, dest, dest1, &PGLOB(PgDisplaySettings_tFc));
+ }
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: memmove
+ * Signature: (ILorg/eclipse/swt/internal/photon/PgVideoModeInfo_t;I)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_memmove__ILorg_eclipse_swt_internal_photon_PgVideoModeInfo_1t_2I
+ (JNIEnv *env, jobject that, jint dest, jobject src, jint count)
+{
+ DECL_GLOB(pGlob)
+
+ PgVideoModeInfo_t object, *src1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_photon_PgVideoModeInfo_1t_2I\n");
+#endif
+
+ if (src) {
+ src1=&object;
+ cachePgVideoModeInfo_tFids(env, src, &PGLOB(PgVideoModeInfo_tFc));
+ getPgVideoModeInfo_tFields(env, src, src1, &PGLOB(PgVideoModeInfo_tFc));
+ }
+ memmove((void *)dest, (void *)src1, count);
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: memmove
+ * Signature: (Lorg/eclipse/swt/internal/photon/PgVideoModeInfo_t;II)V
+ */
+/*
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_memmove__Lorg_eclipse_swt_internal_photon_PgVideoModeInfo_1t_2II
+ (JNIEnv *env, jobject that, jobject dest, jint src, jint count)
+{
+ DECL_GLOB(pGlob)
+ PgVideoModeInfo_t object, *dest1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_photon_PgVideoModeInfo_1t_2II\n");
+#endif
+
+ memmove((void *)&object, (void *)src, count);
+ if (dest) {
+ dest1=&object;
+ cachePgVideoModeInfo_tFids(env, dest, &PGLOB(PgVideoModeInfo_tFc));
+ setPgVideoModeInfo_tFields(env, dest, dest1, &PGLOB(PgVideoModeInfo_tFc));
+ }
+}
+*/
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PgGetVideoMode
+ * Signature: (Lorg/eclipse/swt/internal/photon/PgDisplaySettings_t;)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PgGetVideoMode
+ (JNIEnv *env, jobject that, jobject settings)
+{
+ DECL_GLOB(pGlob)
+ PgDisplaySettings_t settings1, *lpSettings1=NULL;
+ jint result;
+
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PgGetVideoMode\n");
+#endif
+
+ if (settings) {
+ lpSettings1 = &settings1;
+ cachePgDisplaySettings_tFids(env, settings, &PGLOB(PgDisplaySettings_tFc));
+ getPgDisplaySettings_tFields(env, settings, lpSettings1, &PGLOB(PgDisplaySettings_tFc));
+ }
+ result = (jint)PgGetVideoMode(lpSettings1);
+
+ if (settings) {
+ setPgDisplaySettings_tFields(env, settings, lpSettings1, &PGLOB(PgDisplaySettings_tFc));
+ }
+ return result;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PgGetVideoModeInfo
+ * Signature: (ILorg/eclipse/swt/internal/photon/PgVideoModeInfo_t;)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PgGetVideoModeInfo
+ (JNIEnv *env, jobject that, jint mode_number, jobject mode_info)
+{
+ DECL_GLOB(pGlob)
+ PgVideoModeInfo_t mode_info1, *lpmode_info1=NULL;
+ jint result;
+
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PgGetVideoModeInfo\n");
+#endif
+
+ if (mode_info) {
+ lpmode_info1 = &mode_info1;
+ cachePgVideoModeInfo_tFids(env, mode_info, &PGLOB(PgVideoModeInfo_tFc));
+ getPgVideoModeInfo_tFields(env, mode_info, lpmode_info1, &PGLOB(PgVideoModeInfo_tFc));
+ }
+ result = (jint)PgGetVideoModeInfo(mode_number, lpmode_info1);
+
+ if (mode_info) {
+ setPgVideoModeInfo_tFields(env, mode_info, lpmode_info1, &PGLOB(PgVideoModeInfo_tFc));
+ }
+ return result;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PhClipboardCopy
+ * Signature: (SII)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PhClipboardCopy
+ (JNIEnv *env, jclass that, jshort ig, jint n, jint clip)
+{
+
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PhClipboardCopy\n");
+#endif
+
+ return (jint)PhClipboardCopy(ig, n, (void *)clip);
+
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PhClipboardPasteStart
+ * Signature: (S)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PhClipboardPasteStart
+ (JNIEnv *env, jobject that, jshort ig)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PhClipboardPasteStart\n");
+#endif
+
+ return (jint) PhClipboardPasteStart(ig);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PhClipboardPasteType
+ * Signature: (I[B)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PhClipboardPasteType
+ (JNIEnv *env, jobject that, jint cbdata, jbyteArray type)
+{
+ char *type1=NULL;
+
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PhClipboardPasteType\n");
+#endif
+
+ if (type)
+ type1 = (char *)(*env)->GetByteArrayElements(env, type, NULL);
+
+ return (jint) PhClipboardPasteType((void *)cbdata, type1);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PhClipboardPasteFinish
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_PhClipboardPasteFinish
+ (JNIEnv *env, jobject that, jint cbdata)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PhClipboardPasteFinish\n");
+#endif
+
+ PhClipboardPasteFinish((void *)cbdata);
+
+ return;
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: memmove
+ * Signature: (ILorg/eclipse/swt/internal/photon/PhClipHeader;I)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_memmove__ILorg_eclipse_swt_internal_photon_PhClipHeader_2I
+ (JNIEnv *env, jobject that, jint dest, jobject src, jint count)
+{
+ DECL_GLOB(pGlob)
+
+ PhClipHeader object, *src1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_photon_PhClipHeader_2I\n");
+#endif
+
+ if (src) {
+ src1=&object;
+ cachePhClipHeaderFids(env, src, &PGLOB(PhClipHeaderFc));
+ getPhClipHeaderFields(env, src, src1, &PGLOB(PhClipHeaderFc));
+ }
+ memmove((void *)dest, (void *)src1, count);
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: memmove
+ * Signature: (Lorg/eclipse/swt/internal/photon/PhClipHeader;II)V
+ */
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_memmove__Lorg_eclipse_swt_internal_photon_PhClipHeader_2II
+ (JNIEnv *env, jobject that, jobject dest, jint src, jint count)
+{
+ DECL_GLOB(pGlob)
+ PhClipHeader object, *dest1=NULL;
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "memmove__Lorg_eclipse_swt_internal_photon_PhClipHeader_2II\n");
+#endif
+
+ memmove((void *)&object, (void *)src, count);
+ if (dest) {
+ dest1=&object;
+ cachePhClipHeaderFids(env, dest, &PGLOB(PhClipHeaderFc));
+ setPhClipHeaderFields(env, dest, dest1, &PGLOB(PhClipHeaderFc));
+ }
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/OS.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/OS.java
index 2c83686a4f..6e49bcf8f5 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/OS.java
@@ -2710,7 +2710,6 @@ public static final native void PtListGotoPos (int widget, int pos);
public static final native int PtTextModifyText (int widget, int start, int end, int insert_pos, byte [] text, int length);
public static final native int PtTextModifyText (int widget, int start, int end, int insert_pos, int text, int length);
-public static final native int PhClipboardCopyString (short ig, byte [] string);
public static final native int PtTextGetSelection (int widget, int [] start, int [] end);
public static final native int PtTextSetSelection (int widget, int [] start, int [] end);
@@ -2806,9 +2805,6 @@ public static final native void PtWindowToBack (int widget);
public static final native void PtWindowToFront (int widget);
public static final native int PtFindDisjoint (int widget);
-//public static final native int PhClipboardCopyString (short ig, int string);
-public static final native int PhClipboardPasteString (short ig);
-
public static final native int PtBlockAllWindows(int skip, short cursor, int cursor_color);
public static final native void PtUnblockWindows(int bl);
public static final native int PtNextTopLevelWidget(int widget);
@@ -2924,4 +2920,22 @@ public static final native void PgSetFillTransPat (byte [] pat);
public static final native int PtInflateBalloon (int win, int me, int position, byte [] string, byte [] font, int fill, int text_color);
+//public static final native void memmove (PgDisplaySettings_t dest, int src, int size);
+//public static final native void memmove (int dest, PgDisplaySettings_t src, int size);
+
+//public static final native void memmove (PgVideoModeInfo_t dest, int src, int size);
+//public static final native void memmove (int dest, PgVideoModeInfo_t src, int size);
+
+public static final native void PgGetVideoMode (PgDisplaySettings_t settings);
+public static final native void PgGetVideoModeInfo (short mode_number, PgVideoModeInfo_t mode_info);
+
+public static final native void memmove (PhClipHeader dest, int src, int size);
+public static final native void memmove (int dest, PhClipHeader src, int size);
+
+public static final native int PhClipboardCopyString (short ig, byte [] string);
+public static final native int PhClipboardPasteString (short ig);
+public static final native int PhClipboardCopy (short ig, int n, int type);
+public static final native int PhClipboardPasteStart (short ig);
+public static final native int PhClipboardPasteType (int cbdata, byte[] type);
+public static final native void PhClipboardPasteFinish (int cbdata);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/PhClipHeader.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/PhClipHeader.java
new file mode 100644
index 0000000000..45a9a577ea
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/photon/PhClipHeader.java
@@ -0,0 +1,19 @@
+package org.eclipse.swt.internal.photon;
+
+public class PhClipHeader {
+
+ public byte type_0;
+ public byte type_1;
+ public byte type_2;
+ public byte type_3;
+ public byte type_4;
+ public byte type_5;
+ public byte type_6;
+ public byte type_7;
+ public short length;
+ public int data;
+
+ public static final int sizeof = 14;
+
+}
+

Back to the top