$system.dcop

# $system.dcop Performs a DCOP call
Usage
    $system.dcop(<application>,<objectid>,<function>[,<parameter1>[,<parameter2>[,...]]])
Description
This function allows performing simple DCOP calls without executing an external process. This feature is available ONLY when KDE support is compiled in the executable: this means that this function is absolutely non portable (don't use it in scripts that you're going to distribute). <application> is the name of the application being called, <objectid> is the identifier of the object called, <function> is the function to be executed on the remote object and <parameter1>,<parameter2>,... is the list of parameters to be passed. The <function> name must contain the trailing parenthesis and parameter specification (see examples). The parameters MUST be in the form "type=value" where "type" is the C++ type of the parameter and value is the string rappresentation of the parameter data. Currently KVIrc supports only QString,KviQCString,bool,int and uint data types. The returned value is the string rappresentation of the returned data if the return type is known, otherwise it is the name of the data type returned. If the application name is prefixed with "?" then the call is performed in "remote test" mode: no "remote" errors are printed and the function returns 1 if the call executed succesfully and 0 if the call failed. This can be used with the very first call to programmaticaly test if the remote application is running.
Syntax Specification
    <variant> $system.dcop(<application:string>,<objectid:string>,<function:string>[,<parameter1:string>[,<parameter2:string>[,...]]])
Examples
        echo $system.dcop("kdesktop","KBackgroundIface","currentWallpaper(int)","int=0")
        echo $system.dcop("kdesktop","KScreensaverIface","lock()")
        # we can also ignore the return value in several ways
        %dummy = $system.dcop("kicker","kicker","showKMenu()")
        $system.dcop("kdesktop","KScreensaverIface","save()")
        $system.dcop("kicker","Panel","addBrowserButton(QString)","QString=/")
        # runtime test if a call would work (i.e. , kicker is running at all, parameters are right etc...)
        if($system.dcop("?kicker","kicker","showKMenu()"))echo "Can't make dcop calls to kicker!"

Index, Functions

KVIrc 3.4.0 Documentation
Generated by loris at Mon Mar 17 20:35:38 2008