You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.1 KiB
79 lines
2.1 KiB
import org.kde.DCOP.*;
|
|
|
|
|
|
class test
|
|
{
|
|
|
|
public static void main(String[] argv)
|
|
{
|
|
test_stub test = new test_stub("test-server", "test");
|
|
|
|
System.out.println("Calling server without args:");
|
|
test.noArg();
|
|
System.out.println("");
|
|
|
|
System.out.println("Calling server asynchronously without args:");
|
|
test.asyncNoArg();
|
|
System.out.println("");
|
|
|
|
System.out.println("Calling server with one argument: bool=true:");
|
|
test.oneArg(true);
|
|
System.out.println("");
|
|
|
|
System.out.println("Calling server with one argument: bool=false:");
|
|
test.oneArg(false);
|
|
System.out.println("");
|
|
|
|
System.out.println("Calling server: returnFalse");
|
|
boolean ret = test.returnFalse();
|
|
System.out.print("Returned: ");
|
|
if (ret)
|
|
System.out.println("True");
|
|
else
|
|
System.out.println("False");
|
|
System.out.println();
|
|
|
|
System.out.println("Calling server: returnTrue");
|
|
ret = test.returnTrue();
|
|
System.out.print("Returned: ");
|
|
if (ret)
|
|
System.out.println("True");
|
|
else
|
|
System.out.println("False");
|
|
System.out.println();
|
|
|
|
System.out.println("Calling server: short");
|
|
System.out.println(test.shortArg((short)(51)));
|
|
|
|
System.out.println("Calling server: int");
|
|
System.out.println(test.intArg(512));
|
|
|
|
System.out.println("Calling server: long");
|
|
System.out.println(test.longArg(999999));
|
|
|
|
System.out.println("Calling server: float");
|
|
System.out.println(test.floatArg(5.1212f));
|
|
|
|
System.out.println("Calling server: double");
|
|
System.out.println(test.doubleArg(0.001122));
|
|
|
|
System.out.println("Calling server: String");
|
|
System.out.println(test.stringArg("Hallo Server"));
|
|
|
|
String[] in = { "alpha", "beta", "gamma", "delta" };
|
|
System.out.println("Calling server: String[]");
|
|
String[] out = test.stringListArg(in);
|
|
for (int i=0; i<out.length; ++i)
|
|
System.out.println(out[i]);
|
|
|
|
System.out.println("Calling server: CString");
|
|
System.out.println(test.cstringArg("Hallo Server"));
|
|
|
|
DCOPRef rin = new DCOPRef("app", "obj", "typ");
|
|
System.out.println("Calling server: DCOPRef");
|
|
DCOPRef rout = test.DCOPRefArg(rin);
|
|
System.out.println("Reference: " + rout.app() + ", " +
|
|
rout.object() + ", " + rout.type());
|
|
}
|
|
}
|