[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: dcop question
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2005-08-09 14:06:52
Message-ID: 200508091606.59829.boud () valdyas ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Tuesday 09 August 2005 11:37, Luke Sandell wrote:

> > If I get these things done, I promise I'll do a write up -- building &
> > using advanced dcop interfaces. Should be a nice complement to the
> > current set of beginner's tutorials.
>
> All the information is there in the apidocs, but tutorials are always nice.

Thanks -- I had already read the api documentation but I cannot say that it
 helps me much. The api documentation, while extensive for a KDE library,
 seems written for someone with a different type of question. My basic
 goal is not to write a client for a dcop-enabled application, but to 
thoroughly 100% dcop-enable a complex application. 

What I miss is a simple list that tells me what to do if my methods are more
 complex than "int getValueForSomething(QString name)"...

For instance, does the dcopobject apidoc tell me that I should use dcopobject
 to wrap the following

public:

	void addLayer(KisPaintDeviceSP dev);

like this:

k_dcop
	void addLayer(DCOPObject dev);

?

I'm still not sure (and feeling very dim into the bargain :-)).

And about the byte arrays... The methods I need to wrap look like this:


void readBytes(Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);
void writeBytes(const Q_UINT8 * data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);

Do I wrap these as:

QByteArray readBytes(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);
void writeBytes(QByteArray bytes, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);

or does the following work, too:

readBytes(QByteArray & bytes, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);
void writeBytes(QByteArray bytes, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);

And apparently, the python dcop bindings don't know about the third parameter yet... 
Perhaps that explains the curious output of

from pydcop import *

app = ""
for a in apps():
    if (a.startswith("krita")):
        app = anyAppCalled(a)

doc = app.KoApplicationIface.getDocuments()[0]
img=doc.currentImage()
dev=img.activeDevice()
dev.setName("A new name")
print dev.pixelSize()
print dev.nChannels()
print dev.readBytes(10, 10, 1, 1)

boud@talnus:~/prj/krita/koffice/krita/doc> python script.py
The signature is getDocuments()
The method takes 0 parameters
Calling krita-17061 KoApplicationIface getDocuments()
The return type is QValueList<DCOPRef>
The signature is currentImage()
The method takes 0 parameters
Calling krita-17061 Document-0 currentImage()
The return type is DCOPRef
The signature is activeDevice()
The method takes 0 parameters
Calling krita-17061 0x94677c0 activeDevice()
The return type is DCOPRef
The signature is setName(QString)
The method takes 1 parameters
Calling krita-17061 0x9a33950 setName(QString)
The return type is void
The signature is pixelSize()
The method takes 0 parameters
Calling krita-17061 0x9a33950 pixelSize()
The return type is Q_INT32
None
The signature is nChannels()
The method takes 0 parameters
Calling krita-17061 0x9a33950 nChannels()
The return type is Q_INT32
None
Traceback (most recent call last):
  File "script.py", line 14, in ?
    print dev.readBytes(10, 10, 1, 1)
  File "/usr/lib/python2.4/pydcop.py", line 90, in __call__
    return pcop.dcop_call( self.appname, self.objname, self.name, args )
RuntimeError: DCOP: Unknown method.


In short -- without your help I would be even more stumped than I am, but 
I'm still very stumped...
-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi

[Attachment #5 (application/pgp-signature)]

 =

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=
e <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic