On Sunday 12 June 2005 04:08, Ashley Winters wrote: > --- Adam Treat wrote: > > Hey Everyone, I couldn't keep my mouth shut... I just had to let you > > know I > > think we're all barking up the wrong tree with KDE bindings for KDE4. > > Most > > of you have all heard my feelings before, but if not: > > > > http://www.kdedevelopers.org/node/view/1150 > > And I agreed with him in a back-handed way. :) > http://jahqueel.blogspot.com/2005/06/smoke-kde-com-win32.html "Distributed Smoke (aka. DSmoke) would be a relatively simple add-on to the built-in marshalling system. " It already exists! It is called Korundum DCOP support. It uses nested method_missing calls to interface with both Smoke, and a remote DCOP call. From korundum.rb: class DCOPRef < Qt::Base def method_missing(*k) # Enables DCOPRef calls to be made like this: # # dcopRef = DCOPRef.new("dcopslot", "MyWidget") # result = dcopRef.getPoint("Hello from dcopcall") begin # First look for a method in the Smoke runtime. # If not found, then throw an exception and try dcop. super(*k) rescue ... return callExt(method, *dcopArgs) end It dynamically looks up QDataStream '<<' and '>>' operators in the Smoke runtime. From Korundum.cpp: // Look for methods of the form: QDataStream & operator>>(QDataStream&, MyClass&) Smoke::Index meth = t.smoke()->findMethod("QGlobalSpace", "operator>>##"); Smoke::Index ix; if (meth > 0) { ix = t.smoke()->methodMaps[meth].method; ix = -ix; // turn into ambiguousMethodList index while (t.smoke()->ambiguousMethodList[ix]) { Smoke::Method &method = t.smoke()->methods[t.smoke()->ambiguousMethodList[ix]]; QString refType(t.name()); refType += "&"; if ( strcmp( "QDataStream&", t.smoke()->types[t.smoke()->argumentList[method.args+0]].name ) == 0 && strcmp( refType.latin1(), t.smoke()->types[t.smoke()->argumentList[method.args+1]].name ) == 0 ) { Smoke::ClassFn fn = t.smoke()->classes[method.classId].classFn; Smoke::StackItem local_stack[3]; local_stack[1].s_voidp = stream; local_stack[2].s_voidp = stack[i].s_voidp; // Call the QDataStream marshaller read method // on the instance to be marshalled (*fn)(method.method, 0, local_stack); break; } ix++; } } -- Richard _______________________________________________ Kde-bindings mailing list Kde-bindings@kde.org https://mail.kde.org/mailman/listinfo/kde-bindings