Plasma .operations file to JOLIE interface converter and plasma::(dataengine/service) return value typing
Fabrizio Montesi
famontesi at gmail.com
Tue Jan 20 18:37:00 CET 2009
Hi everyone,
today I was chatting with asraniel on #plasma about making an automatic
generator of JOLIE interfaces from Plasma::Service .operations XML files and he
decided to go ahead and start the project.
Such a tool would allow for fast, type-safe JOLIE adapter prototyping
(manually porting such interfaces and parameter types would be ... boring, to
say the least). It is to be made in C++, to take advantage of KDE and plasma's
API for accessing the .operations file.
Current objective is to make a command line tool working like:
plasmaoperations2jolieinterface source.operations dest.iol
Suggestions for a name for this tool or other aspects in general?
You can find an example of a correct conversion in attachment, to make it clear
what we want to achieve.
Moreover, though operation call parameters are typed in .operations files, it
seems there is no mechanism for typing a DataEngine or Service return value.
This is supported by JOLIE (as one can leave the return value of an operation
call untyped), but I was wondering: is there any future plan regarding this?
Bye,
Fabrizio.
PS: another thing for the future will be to make the opposite tool (JOLIE
interface to Plasma .operations file, so to import automagically already defined
JOLIE service interfaces), but that's another story. =)
-------------- next part --------------
--- Plasma .operations file for nowPlaying
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM
"http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfg>
<group name="play"/>
<group name="pause"/>
<group name="stop"/>
<group name="previous"/>
<group name="next"/>
<group name="volume">
<entry name="level" type="Double">
<label>The required volume level, as a real number between 0 and 1.</label>
</entry>
</group>
<group name="seek">
<entry name="seconds" type="Int">
<label>The position to seek to, in seconds. Must be between 0 and the track length.</label>
</entry>
</group>
</kcfg>
--- JOLIE equivalent format
type VolumeRequestType:void {
.level:double
}
type SeekRequestType:void {
.seconds:int
}
interface NowPlayingInterface {
RequestResponse:
play(void)(undefined),
pause(void)(undefined),
stop(void)(undefined),
previous(void)(undefined),
next(void)(undefined),
volume(VolumeRequestType)(undefined),
seek(SeekRequestType)(undefined)
}
More information about the Plasma-devel
mailing list