changeset 6:963d271f7c25

disabled event stuff, to have working example
author Frank Benoit <benoit@tionex.de>
date Sun, 28 Oct 2007 19:35:38 +0100
parents 7c2c75740370
children 6b58a2bf0afd
files dbus-d-javatests/README.txt dbus-d-javatests/dbustest.xml dbus-d-javatests/dsrc/DBusTesting.d dbus-d-javatests/dsrc/DBusTestingGen.d dbus-d-javatests/jsrc/dbustest/DBusTester.java dbus-d-javatests/jsrc/dbustest/DImpl.java dbus-d/dsrc/dsss.conf dbus-d/dsrc/org/freedesktop/dbus/DBus.d dbus-d/dsrc/org/freedesktop/dbus/tool/CreateInterface.d
diffstat 9 files changed, 32 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/dbus-d-javatests/README.txt	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d-javatests/README.txt	Sun Oct 28 19:35:38 2007 +0100
@@ -6,14 +6,16 @@
 1. Build the "createinterface" tool.
    in the dbus-d directory:
    
-     $ cd dbus-d
-     $ dsss build org/freedesktop/dbus/tools/CreateInterface.d
+     $ cd dbus-d/dsrc
+     $ dsss build org/freedesktop/dbus/tool/CreateInterface.d
+     
+   On success, this creates the CreateInterface tool in ../..
    
 2. Goto the directory of your applications source code ,call the CreateInterface tool
    and pipe the output to a file matching your module name.
    
      $ cd ../dbus-d-javatests/dsrc
-     $ ../../dbus-d/CreateInterface ../dbustest.xml DBusTestingGen > DBusTestingGen.d
+     $ ../../CreateInterface ../dbustest.xml DBusTestingGen > DBusTestingGen.d
    
 3. Implement interfaces in D. If the introspection.xml has an interface called "a.b.C"
    you need to implement the interface "DBusInterface.a.b.C" which is part of the generated
--- a/dbus-d-javatests/dbustest.xml	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d-javatests/dbustest.xml	Sun Oct 28 19:35:38 2007 +0100
@@ -71,14 +71,14 @@
             <arg name="o_string" type="s" direction="out"/>
         </method>
 
-        <method name="triggerSignal">
+<!--        <method name="triggerSignal">
             <arg name="count" type="i" direction="in" />
         </method>
 
         <signal name="testSigI">
             <arg name="arg1" type="i" direction="in" />
         </signal>
-        
+-->        
     </interface>
 
 </node>
--- a/dbus-d-javatests/dsrc/DBusTesting.d	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d-javatests/dsrc/DBusTesting.d	Sun Oct 28 19:35:38 2007 +0100
@@ -63,14 +63,14 @@
 		o_double = i_double;
 		o_string = i_string.reverse;
 	}
-
+/+
 	public void triggerSignal( in int count ){
 		checkCall( "triggerSignal" );
 		for( int i = 0; i < count; i++ ){
 			testSigI.opCall( i );
 		}
 	}
-
++/
 }
 
 //mixin( createJavaImplementation( "MyClass", ["DBusInterface.dbustest.DImpl" ] ));
--- a/dbus-d-javatests/dsrc/DBusTestingGen.d	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d-javatests/dsrc/DBusTestingGen.d	Sun Oct 28 19:35:38 2007 +0100
@@ -29,34 +29,16 @@
                 public interface Peer {
                     public void Ping();
                     public char[] GetMachineId();
-                    template _StdJavaImpl(){
-                    }
-                    template _StdDImpl(){
-                        void _init(){
-                        }
-                    }
                 }
                 // org.freedesktop.DBus.Introspectable
                 public interface Introspectable {
                     public char[] Introspect();
-                    template _StdJavaImpl(){
-                    }
-                    template _StdDImpl(){
-                        void _init(){
-                        }
-                    }
                 }
                 // org.freedesktop.DBus.Properties
                 public interface Properties {
                     public DBusVariant Get( in char[] intf_name, in char[] prop_name );
                     public void Set( in char[] intf_name, in char[] prop_name, in DBusVariant prop );
                     public DBusVariant[ char[] ] GetAll( in char[] intf_name );
-                    template _StdJavaImpl(){
-                    }
-                    template _StdDImpl(){
-                        void _init(){
-                        }
-                    }
                 }
             }
         }
@@ -66,62 +48,26 @@
         // dbustest.OtherInterface
         public interface OtherInterface {
             public void dummy( in char[] arg1 );
-            template _StdJavaImpl(){
-            }
-            template _StdDImpl(){
-                void _init(){
-                }
-            }
         }
         // dbustest.TestControl
         public interface TestControl {
             public char[][] getCalledTests();
             public void activateExceptions( in bool enable );
-            template _StdJavaImpl(){
-            }
-            template _StdDImpl(){
-                void _init(){
-                }
-            }
         }
         // dbustest.TestListener
         public interface TestListener {
             public char[] getName();
-            template _StdJavaImpl(){
-            }
-            template _StdDImpl(){
-                void _init(){
-                }
-            }
         }
         // dbustest.JavaImpl
         public interface JavaImpl {
             public void testV_V();
             public int testI_I( in int arg1 );
-            template _StdJavaImpl(){
-            }
-            template _StdDImpl(){
-                void _init(){
-                }
-            }
         }
         // dbustest.DImpl
         public interface DImpl {
             public void testV_V();
             public int testI_I( in int arg1 );
             public void testParamAllSimpleTyes( in bool i_bool, out bool o_bool, in byte i_byte, out byte o_byte, in short i_short, out short o_short, in ushort i_ushort, out ushort o_ushort, in int i_int, out int o_int, in uint i_uint, out uint o_uint, in long i_long, out long o_long, in ulong i_ulong, out ulong o_ulong, in double i_double, out double o_double, in char[] i_string, out char[] o_string );
-            public void triggerSignal( in int count );
-            public tango.core.Signal.Signal!( int )* testSigI();
-            template _StdJavaImpl(){
-            }
-            template _StdDImpl(){
-                void _init(){
-                }
-                protected tango.core.Signal.Signal!( int ) _testSigI;
-                public tango.core.Signal.Signal!( int )* testSigI(){
-                    return &_testSigI;
-                }
-            }
         }
     }
 }
@@ -246,9 +192,6 @@
             "    <arg  name=\"i_string\" type=\"s\" direction=\"in\" />\\n"
             "    <arg  name=\"o_string\" type=\"s\" direction=\"out\" />\\n"
             "  </method>\\n"
-            "  <method name=\"triggerSignal\">\\n"
-            "    <arg  name=\"count\" type=\"i\" direction=\"in\" />\\n"
-            "  </method>\\n"
             "</interface>\\n");
 }
 private DBusHandlerResult intfHandler__org_freedesktop_DBus_Peer( DBusConnection* conn, DBusMessage* message, void* user_data ){
@@ -492,19 +435,6 @@
                 sendReplyData!( bool, byte, short, ushort, int, uint, long, ulong, double, char[] )( conn, message, po );
             }
             break;
-        case "triggerSignal|i":
-            {
-                Struct!( int ) pi = getCallValues!( int )( message );
-                o.triggerSignal( pi.t[0] );
-                sendReply( conn, message );
-            }
-            break;
-        case "testSigI>i":
-            {
-                Struct!( int ) pi = getCallValues!( int )( message );
-                o.testSigI().opCall( pi.t[0] );
-            }
-            break;
         default:
             return DBusHandlerResult.DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
         }
--- a/dbus-d-javatests/jsrc/dbustest/DBusTester.java	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d-javatests/jsrc/dbustest/DBusTester.java	Sun Oct 28 19:35:38 2007 +0100
@@ -1,16 +1,11 @@
 package dbustest;
 
-import java.util.Collections;
-import java.util.List;
-
-import org.freedesktop.dbus.DBusSigHandler;
 import org.freedesktop.dbus.DirectConnection;
 import org.freedesktop.dbus.UInt16;
 import org.freedesktop.dbus.UInt32;
 import org.freedesktop.dbus.UInt64;
 
 import dbus_d_javahelper.DBusDLoader;
-import dbustest.DImpl.testSigI;
 
 public class DBusTester {
 
@@ -21,13 +16,14 @@
 			throw new RuntimeException( msg );
 		}
 	}
-	private static void ensureEqualLists( List<String> list1, String[] list2 ){
-		Collections.sort(list1);
-		ensure( list1.size() == list2.length, "List sizes are not equal" );
-		for( int i = 0; i < list1.size(); i++ ){
-			ensure( list1.get(i).equals(list2[i]), "List content is not equal" );
-		}
-	}
+
+//	private static void ensureEqualLists( List<String> list1, String[] list2 ){
+//		Collections.sort(list1);
+//		ensure( list1.size() == list2.length, "List sizes are not equal" );
+//		for( int i = 0; i < list1.size(); i++ ){
+//			ensure( list1.get(i).equals(list2[i]), "List content is not equal" );
+//		}
+//	}
 	
 	public static void main(String[] args) {
 
@@ -83,16 +79,16 @@
 				ensure( res.i == 1.0, "double" );
 				ensure( res.j.equals( "cbaCBA" ), "string" );
 			}
-			
-			// 4. cause the test object to generate signal
-			DBusSigHandler<testSigI> handler = new DBusSigHandler<DImpl.testSigI>(){
-				public void handle(testSigI s) {
-					handledCounter++;
-				}
-			};
-			dc.addSigHandler( DImpl.testSigI.class, handler );
-			
-			rem.triggerSignal( 10 );
+
+//			// 4. cause the test object to generate signal
+//			DBusSigHandler<testSigI> handler = new DBusSigHandler<DImpl.testSigI>(){
+//				public void handle(testSigI s) {
+//					handledCounter++;
+//				}
+//			};
+//			dc.addSigHandler( DImpl.testSigI.class, handler );
+//			
+//			rem.triggerSignal( 10 );
 
 			Thread.sleep(100);
 			System.out.printf( "HandledCounter: %d\n", handledCounter );
--- a/dbus-d-javatests/jsrc/dbustest/DImpl.java	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d-javatests/jsrc/dbustest/DImpl.java	Sun Oct 28 19:35:38 2007 +0100
@@ -1,27 +1,15 @@
 package dbustest;
 import org.dsource.dbus.d.Returns;
 import org.freedesktop.dbus.DBusInterface;
-import org.freedesktop.dbus.DBusSignal;
 import org.freedesktop.dbus.UInt16;
 import org.freedesktop.dbus.UInt32;
 import org.freedesktop.dbus.UInt64;
-import org.freedesktop.dbus.exceptions.DBusException;
 public interface DImpl extends DBusInterface
 {
-   public static class testSigI extends DBusSignal
-   {
-      public final int arg1;
-      public testSigI(String path, int arg1) throws DBusException
-      {
-         super(path, arg1);
-         this.arg1 = arg1;
-      }
-   }
 
   public void testV_V();
   @Returns("res")
   public int testI_I(int arg1);
   public NTuple10<Boolean, Byte, Short, UInt16, Integer, UInt32, Long, UInt64, Double, String> testParamAllSimpleTyes(boolean i_bool, byte i_byte, short i_short, UInt16 i_ushort, int i_int, UInt32 i_uint, long i_long, UInt64 i_ulong, double i_double, String i_string);
-  public void triggerSignal(int count);
 
 }
--- a/dbus-d/dsrc/dsss.conf	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d/dsrc/dsss.conf	Sun Oct 28 19:35:38 2007 +0100
@@ -1,18 +1,10 @@
 [test/client/DClient.d]
-version(linux){
     buildflags+=-I~/tango
     buildflags+=-L-ldbus-1
-}
-version(Windows){
-    buildflags+=-S..\libs
-    buildflags+=-ll"libdbus-1"
-    buildflags+=-L/SUBSYSTEM:console:5
-}
 target=DClient.exe
 
 [org/freedesktop/dbus/tool/CreateInterface.d]
-target=../CreateInterface
-buildflags+=$LIB_PREFIX/libSDD-tango-*.a
+target=../../CreateInterface
 
 
 
--- a/dbus-d/dsrc/org/freedesktop/dbus/DBus.d	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d/dsrc/org/freedesktop/dbus/DBus.d	Sun Oct 28 19:35:38 2007 +0100
@@ -1151,6 +1151,7 @@
        	res ~= intf;
     }
 	res ~= " {\n";
+	/+
     foreach( intf; interfaces ){
     	res ~= "  mixin "~intf~"._StdDImpl!() _StdDImpl_"~ctfeReplace( intf, '.', '_' )~";\n";
     }
@@ -1159,6 +1160,7 @@
     	res ~= "    _StdDImpl_"~ ctfeReplace( intf, '.', '_' ) ~"._init();\n";
     }
 	res ~= "  }\n";
+	+/
 	res ~= "}\n";
 	return res;
 }
--- a/dbus-d/dsrc/org/freedesktop/dbus/tool/CreateInterface.d	Sun Oct 21 19:22:41 2007 +0200
+++ b/dbus-d/dsrc/org/freedesktop/dbus/tool/CreateInterface.d	Sun Oct 28 19:35:38 2007 +0100
@@ -676,6 +676,7 @@
         foreach( sign; intf.mSignals ){
             writeInterfaceSignal( p, sign, indent+1 );
         }
+        /+
         p.formatln( "{}template _StdJavaImpl(){{", getIndent(indent+1) );
         p.formatln( "{}}", getIndent(indent+1) );
         p.formatln( "{}template _StdDImpl(){{", getIndent(indent+1) );
@@ -685,6 +686,7 @@
 	            writeInterfaceSignalDImpl( p, sign, indent+2 );
 	        }
         p.formatln( "{}}", getIndent(indent+1) );
+        +/
     }
     foreach( child; intfTree.getChildNames( name ) ){
         writeInterface( p, child, indent +1 );