From 636f509299122d02087c6fd62e1e4a46dbd22026 Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Wed, 8 Jan 2014 20:06:00 +0100 Subject: Rename many classes to avoid conflicts with KDE --- dcopjava/binding/Makefile.am | 10 +- dcopjava/binding/client.cpp | 28 +-- dcopjava/binding/org/Makefile.am | 2 +- dcopjava/binding/org/kde/DCOP/Client.java | 63 ------- dcopjava/binding/org/kde/DCOP/DCOPRef.java | 30 ---- dcopjava/binding/org/kde/DCOP/Makefile.am | 9 - dcopjava/binding/org/kde/DCOP/Response.java | 9 - dcopjava/binding/org/kde/DCOP/Stub.java | 193 --------------------- dcopjava/binding/org/kde/Makefile.am | 1 - .../binding/org/trinitydesktop/DCOP/Client.java | 63 +++++++ .../binding/org/trinitydesktop/DCOP/DCOPRef.java | 30 ++++ .../binding/org/trinitydesktop/DCOP/Makefile.am | 9 + .../binding/org/trinitydesktop/DCOP/Response.java | 9 + dcopjava/binding/org/trinitydesktop/DCOP/Stub.java | 193 +++++++++++++++++++++ dcopjava/binding/org/trinitydesktop/Makefile.am | 1 + 15 files changed, 325 insertions(+), 325 deletions(-) delete mode 100644 dcopjava/binding/org/kde/DCOP/Client.java delete mode 100644 dcopjava/binding/org/kde/DCOP/DCOPRef.java delete mode 100644 dcopjava/binding/org/kde/DCOP/Makefile.am delete mode 100644 dcopjava/binding/org/kde/DCOP/Response.java delete mode 100644 dcopjava/binding/org/kde/DCOP/Stub.java delete mode 100644 dcopjava/binding/org/kde/Makefile.am create mode 100644 dcopjava/binding/org/trinitydesktop/DCOP/Client.java create mode 100644 dcopjava/binding/org/trinitydesktop/DCOP/DCOPRef.java create mode 100644 dcopjava/binding/org/trinitydesktop/DCOP/Makefile.am create mode 100644 dcopjava/binding/org/trinitydesktop/DCOP/Response.java create mode 100644 dcopjava/binding/org/trinitydesktop/DCOP/Stub.java create mode 100644 dcopjava/binding/org/trinitydesktop/Makefile.am (limited to 'dcopjava/binding') diff --git a/dcopjava/binding/Makefile.am b/dcopjava/binding/Makefile.am index 8baebffb..d5ad26ac 100644 --- a/dcopjava/binding/Makefile.am +++ b/dcopjava/binding/Makefile.am @@ -6,14 +6,14 @@ libjavadcop_la_LIBADD = $(LIB_TDECORE) INCLUDES = $(jni_includes) $(all_includes) -client.$(OBJEXT): org_kde_DCOP_Client.h +client.$(OBJEXT): org_trinitydesktop_DCOP_Client.h -client.lo: org_kde_DCOP_Client.h +client.lo: org_trinitydesktop_DCOP_Client.h -org_kde_DCOP_Client.h: +org_trinitydesktop_DCOP_Client.h: $(MAKE) -C org - $(JAVAH) -classpath .:$(srcdir) -jni org.kde.DCOP.Client + $(JAVAH) -classpath .:$(srcdir) -jni org.trinitydesktop.DCOP.Client SUBDIRS = org -CLEANFILES = org_kde_DCOP_Client.h +CLEANFILES = org_trinitydesktop_DCOP_Client.h diff --git a/dcopjava/binding/client.cpp b/dcopjava/binding/client.cpp index e60fe2ac..f19af5e1 100644 --- a/dcopjava/binding/client.cpp +++ b/dcopjava/binding/client.cpp @@ -6,7 +6,7 @@ #include -#include "org_kde_DCOP_Client.h" +#include "org_trinitydesktop_DCOP_Client.h" class client @@ -34,7 +34,7 @@ DCOPClient *client::instance() } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_attach(JNIEnv *, jobject) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_attach(JNIEnv *, jobject) { kdDebug() << "javadcop::attach() called" << endl; @@ -42,7 +42,7 @@ JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_attach(JNIEnv *, jobject) } -JNIEXPORT jstring JNICALL Java_org_kde_DCOP_Client_registerAs(JNIEnv *env, jobject, jstring appName) +JNIEXPORT jstring JNICALL Java_org_trinitydesktop_DCOP_Client_registerAs(JNIEnv *env, jobject, jstring appName) { TQString name(env->GetStringUTFChars(appName, 0)); @@ -54,7 +54,7 @@ JNIEXPORT jstring JNICALL Java_org_kde_DCOP_Client_registerAs(JNIEnv *env, jobje } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_isAttached(JNIEnv *, jobject) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_isAttached(JNIEnv *, jobject) { kdDebug() << "javadcop::isAttached() called" << endl; @@ -62,7 +62,7 @@ JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_isAttached(JNIEnv *, jobject } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_detach(JNIEnv *, jobject) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_detach(JNIEnv *, jobject) { kdDebug() << "javadcop::detach() called" << endl; @@ -70,7 +70,7 @@ JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_detach(JNIEnv *, jobject) } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_send__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject, jstring remApp, jstring remObj, jstring remFun, jstring data) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_send__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject, jstring remApp, jstring remObj, jstring remFun, jstring data) { TQString _remApp(env->GetStringUTFChars(remApp, 0)); TQString _remObj(env->GetStringUTFChars(remObj, 0)); @@ -94,7 +94,7 @@ TQByteArray byteArray(JNIEnv *env, jbyteArray a) } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_send__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3B(JNIEnv *env, jobject, jstring remApp, jstring remObj, jstring remFun, jbyteArray data) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_send__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2_3B(JNIEnv *env, jobject, jstring remApp, jstring remObj, jstring remFun, jbyteArray data) { TQString _remApp(env->GetStringUTFChars(remApp, 0)); TQString _remObj(env->GetStringUTFChars(remObj, 0)); @@ -109,7 +109,7 @@ JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_send__Ljava_lang_String_2Lja } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_isRegistered(JNIEnv *, jobject) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_isRegistered(JNIEnv *, jobject) { kdDebug() << "javadcop::isRegistered() called" << endl; @@ -117,7 +117,7 @@ JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_isRegistered(JNIEnv *, jobje } -JNIEXPORT jstring JNICALL Java_org_kde_DCOP_Client_appId(JNIEnv *env, jobject) +JNIEXPORT jstring JNICALL Java_org_trinitydesktop_DCOP_Client_appId(JNIEnv *env, jobject) { kdDebug() << "javadcop::appId called" << endl; @@ -125,7 +125,7 @@ JNIEXPORT jstring JNICALL Java_org_kde_DCOP_Client_appId(JNIEnv *env, jobject) } -JNIEXPORT void JNICALL Java_org_kde_DCOP_Client_suspend(JNIEnv *, jobject) +JNIEXPORT void JNICALL Java_org_trinitydesktop_DCOP_Client_suspend(JNIEnv *, jobject) { kdDebug() << "javadcop::suspend() called" << endl; @@ -133,7 +133,7 @@ JNIEXPORT void JNICALL Java_org_kde_DCOP_Client_suspend(JNIEnv *, jobject) } -JNIEXPORT void JNICALL Java_org_kde_DCOP_Client_resume(JNIEnv *, jobject) +JNIEXPORT void JNICALL Java_org_trinitydesktop_DCOP_Client_resume(JNIEnv *, jobject) { kdDebug() << "javadcop::resume() called" << endl; @@ -141,7 +141,7 @@ JNIEXPORT void JNICALL Java_org_kde_DCOP_Client_resume(JNIEnv *, jobject) } -JNIEXPORT jobject JNICALL Java_org_kde_DCOP_Client_call(JNIEnv *env, jobject, jstring remApp, jstring remObj, jstring remFun, jbyteArray data, jboolean eventLoop) +JNIEXPORT jobject JNICALL Java_org_trinitydesktop_DCOP_Client_call(JNIEnv *env, jobject, jstring remApp, jstring remObj, jstring remFun, jbyteArray data, jboolean eventLoop) { TQString _remApp(env->GetStringUTFChars(remApp, 0)); TQString _remObj(env->GetStringUTFChars(remObj, 0)); @@ -167,7 +167,7 @@ JNIEXPORT jobject JNICALL Java_org_kde_DCOP_Client_call(JNIEnv *env, jobject, js jobject response; jfieldID jfid; - jcls = env->FindClass("Lorg/kde/DCOP/Response;"); + jcls = env->FindClass("Lorg/trinitydesktop/DCOP/Response;"); if (!jcls) return NULL; @@ -201,7 +201,7 @@ JNIEXPORT jobject JNICALL Java_org_kde_DCOP_Client_call(JNIEnv *env, jobject, js return response; } -JNIEXPORT jboolean JNICALL Java_org_kde_DCOP_Client_isApplicationRegistered(JNIEnv *env, jobject, jstring remApp) +JNIEXPORT jboolean JNICALL Java_org_trinitydesktop_DCOP_Client_isApplicationRegistered(JNIEnv *env, jobject, jstring remApp) { const TQCString _remApp(env->GetStringUTFChars(remApp, 0)); diff --git a/dcopjava/binding/org/Makefile.am b/dcopjava/binding/org/Makefile.am index 800b92ea..8279b890 100644 --- a/dcopjava/binding/org/Makefile.am +++ b/dcopjava/binding/org/Makefile.am @@ -1 +1 @@ -SUBDIRS = kde +SUBDIRS = trinitydesktop diff --git a/dcopjava/binding/org/kde/DCOP/Client.java b/dcopjava/binding/org/kde/DCOP/Client.java deleted file mode 100644 index 55ba943e..00000000 --- a/dcopjava/binding/org/kde/DCOP/Client.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.kde.DCOP; - - -public class Client -{ - // attach to DCOP server as 'anonymous' - public native boolean attach(); - - // attach to DCOP server using appName as key - public native String registerAs(String appName); - - // report if we are registered at the server - public native boolean isRegistered(); - - // return the registered application id - public native String appId(); - - // suspend DCOP processing - public native void suspend(); - - // resume DCOP processing - public native void resume(); - - // detach from the DCOP server - public native boolean detach(); - - // report if we are attached to DCOP server - public native boolean isAttached(); - - // send a command to the server - public native boolean send(String remApp, String remObj, String remFun, byte[] data); - - // send a command string to the server - public native boolean send(String remApp, String remObj, String remFun, String data); - - // call a function and get the result - public native Response call(String remApp, String remObj, String remFun, byte[] data, boolean eventLoop); - - // Checks whether remApp is registered with the DCOP server. - public native boolean isApplicationRegistered ( String remApp); - - public static void main(String[] args) - { - Client client = new Client(); - - System.out.println("Registering as: " + client.registerAs("Java-App")); - if (client.isAttached()) - System.out.println("Attached!"); - - client.send("kdesktop", "KDesktopIface", "selectAll()", ""); - - java.io.ByteArrayOutputStream bs = new java.io.ByteArrayOutputStream(); - Response res = client.call("kdesktop", "KDesktopIface", "selectedURLs()", bs.toByteArray(), false); - System.out.println("Result type: " + res.returnType); - } - - static - { - System.loadLibrary("javadcop"); - } - -} - diff --git a/dcopjava/binding/org/kde/DCOP/DCOPRef.java b/dcopjava/binding/org/kde/DCOP/DCOPRef.java deleted file mode 100644 index 29d37efd..00000000 --- a/dcopjava/binding/org/kde/DCOP/DCOPRef.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.kde.DCOP; - - -public class DCOPRef -{ - private String _app, _obj, _type; - - public DCOPRef(String app, String obj, String type) - { - _app = app; - _obj = obj; - _type = type; - } - - public String app() - { - return _app; - } - - public String object() - { - return _obj; - } - - public String type() - { - return _type; - } - -} diff --git a/dcopjava/binding/org/kde/DCOP/Makefile.am b/dcopjava/binding/org/kde/DCOP/Makefile.am deleted file mode 100644 index 2019d20a..00000000 --- a/dcopjava/binding/org/kde/DCOP/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -class_DATA = DCOPRef.class Response.class Client.class Stub.class -classdir = $(kde_libraries)/java/org/kde/DCOP - -SUFFIXES = .java .class - -.java.class: - CLASSPATH=$(top_srcdir)/dcopjava/binding $(JAVAC) -d ../../../ -cp ../../../ $(top_srcdir)/dcopjava/binding/org/kde/DCOP/$*.java - -CLEANFILES = $(class_DATA) diff --git a/dcopjava/binding/org/kde/DCOP/Response.java b/dcopjava/binding/org/kde/DCOP/Response.java deleted file mode 100644 index 5df99427..00000000 --- a/dcopjava/binding/org/kde/DCOP/Response.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.kde.DCOP; - - -public class Response -{ - public boolean returnValue; - public String returnType; - public byte[] returnData; -} diff --git a/dcopjava/binding/org/kde/DCOP/Stub.java b/dcopjava/binding/org/kde/DCOP/Stub.java deleted file mode 100644 index e9267fa5..00000000 --- a/dcopjava/binding/org/kde/DCOP/Stub.java +++ /dev/null @@ -1,193 +0,0 @@ -package org.kde.DCOP; - - -import java.io.*; - - -public class Stub -{ - private String _app, _obj; - private int _status; - private Client _client; - - public Stub(String app, String obj) - { - _app = app; - _obj = obj; - _status = 0; - - // TODO: The client should be shared between stubs. - _client = new Client(); - _client.attach(); - } - - public String app() - { - return _app; - } - - public String obj() - { - return _obj; - } - - - public Client client() - { - return _client; - } - - - public final static int CallFailed = 0; - public final static int CallSucceeded = 1; - - public int status() - { - return _status; - } - - public void setStatus(int status) - { - _status = status; - } - - public boolean ok() - { - return _status == CallSucceeded; - } - - public void callFailed() - { - _status = CallFailed; - } - - - // accessor methods for the datatypes used --------------------------- - - protected boolean read_bool(DataInputStream is) throws IOException - { - return is.readBoolean(); - } - - protected void write_bool(DataOutputStream os, boolean val) throws IOException - { - os.writeBoolean(val); - } - - protected short read_short_int(DataInputStream is) throws IOException - { - return is.readShort(); - } - - protected void write_short_int(DataOutputStream os, short val) throws IOException - { - os.writeShort(val); - } - - protected int read_int(DataInputStream is) throws IOException - { - return is.readInt(); - } - - protected void write_int(DataOutputStream os, int val) throws IOException - { - os.writeInt(val); - } - - protected int read_long_int(DataInputStream is) throws IOException - { - return is.readInt(); - } - - protected void write_long_int(DataOutputStream os, int val) throws IOException - { - os.writeInt(val); - } - - protected float read_float(DataInputStream is) throws IOException - { - return is.readFloat(); - } - - protected void write_float(DataOutputStream os, float val) throws IOException - { - os.writeFloat(val); - } - - protected double read_double(DataInputStream is) throws IOException - { - return is.readDouble(); - } - - protected void write_double(DataOutputStream os, double val) throws IOException - { - os.writeDouble(val); - } - - protected String read_QString(DataInputStream is) throws IOException - { - int len = is.readInt(); - if (len == 0xffffffff) - return new String(); - else - { - StringBuffer b = new StringBuffer(); - for (int i=0; i