26 #include "dcopclient.h"
27 #include "dcopobject.h"
29 #include <tqdatastream.h>
31 #define STR( s ) ( s.data() ? s.data() : "" )
33 bool DCOPReply::typeCheck(
const char* t )
35 return typeCheck( t,
true );
38 bool DCOPReply::typeCheck(
const char* t,
bool warn )
43 || strcmp( t,
"<unknown>" ))
44 tqWarning(
"WARNING: DCOPReply<%s>: cast to '%s' error",
50 DCOPReply DCOPRef::callInternal(
const TQCString& fun,
const TQCString& args,
const TQByteArray& data )
52 return callInternal( fun, args, data, NoEventLoop, -1 );
55 DCOPReply DCOPRef::callInternal(
const TQCString& fun,
const TQCString& args,
const TQByteArray& data,
56 EventLoopFlag useEventLoop,
int timeout )
60 tqWarning(
"DCOPRef: call '%s' on null reference error",
65 if ( fun.find(
'(') == -1 ) {
67 if( args.find(
"<unknown" ) != -1 )
68 tqWarning(
"DCOPRef: unknown type error "
69 "<\"%s\",\"%s\">::call(\"%s\",%s",
70 STR(m_app), STR(m_obj), STR(fun), args.data()+1 );
74 tqWarning(
"DCOPRef::call(): no DCOP client or client not attached error" );
77 dc->
call( m_app, m_obj, sig, data, reply.
type, reply.
data, useEventLoop == UseEventLoop, timeout );
81 bool DCOPRef::sendInternal(
const TQCString& fun,
const TQCString& args,
const TQByteArray& data )
84 tqWarning(
"DCOPRef: send '%s' on null reference error",
90 if ( fun.find(
'(') == -1 ) {
92 if( args.find(
"<unknown" ) != -1 )
93 tqWarning(
"DCOPRef: unknown type error "
94 "<\"%s\",\"%s\">::send(\"%s\",%s",
95 STR(m_app), STR(m_obj), STR(fun), args.data()+1 );
99 tqWarning(
"DCOPRef::send(): no DCOP client or client not attached error" );
102 return dc->
send( m_app, m_obj, sig, data );
120 m_obj( o->objId() ), m_type( o->interfaces().last() ), d(0)
126 : m_app( _app ), m_obj( obj ), d(0)
131 : m_app( _app ), m_obj( _obj ), m_type( _type ), d(0)
137 return ( m_app.isNull() || m_obj.isNull() );
163 d = (DCOPRefPrivate*) dc;
187 void DCOPRef::setRef(
const TQCString& _app,
const TQCString& _obj,
const TQCString& _type )
210 TQDataStream& operator>>( TQDataStream& str,
DCOPRef& ref )