Slashdot Mirror


Developing Applications with KJSEmbed

Rich writes "Ian Geiser of SourceXtreme has released an interesting HOWTO showing how you can use KDE's embedded JavaScript tool to write quick-and-dirty apps. The apps can use the features of Qt and KDE to pack a lot of punch for a small amount of code. You can find it on his website."

5 of 25 comments (clear)

  1. Re:interface scripting by Rich · · Score: 4, Informative

    It's called DCOP and it's used a lot. Here's one of several tutorial on the subject: IBM tutorial. Note that Ian is planning a tutorial showing how you can use DCOP from KJSEmbed in this series too.

  2. Re:interface scripting by Anonymous Coward · · Score: 3, Informative

    And what's really nifty is that all of that is done via OSA, the Open Scripting Architecture. So if you don't feel like coding in applescript, you can access all those same hooks with any other scripting language that has an OSA implementation (javascript, perl, python, etc...)

  3. Re:KDE has embedded javascript? This explains a lo by stilborne · · Score: 3, Informative

    Javascript is not embedded in KDE. KJSEmbed is a set of Javascript bindings built on top of KDE Javascript implementation. this is no different than, say, Python or Java bindings. where it does deviate is that it is possible for an application to embed the KJS engine and thereby use KJSEmbed internally as a scripting option should it so choose. but it isn't like KJSEmbed is loaded whenever you start up KDE, or even the overwhelming majority of KDE apps for that matter.

    that said, one of the beautiful things about open source / Free software is choice. go crazy with your window manager only set up, and have fun with it! i'm glad you aren't forced to use something that doesn't fit your style and/or needs!

    all the same, it's only fair to be accurate. your viewpoint on "eye candy" derivative code trying to do "what you need" rather than the apps themselves is a rather inaccurate statement on how things work. desktop environments aren't for everyone (you being an example of that), but at least you could get your derision right ;-)

  4. Re:interface scripting by rikkus-x · · Score: 2, Informative
    There is very little documentation about what DCOP interfaces programs like Kate have, and how they can be used for writing small scripts and macros.

    I just figured this out by typing 'dcop kate' and then looking at what was printed.

    $ dcop kate KateDocumentManager openURL /etc/passwd ''
    DCOPRef(kate, KateDocument#3)
    $ dcop kate EditInterface#3 numLines
    61
    $ dcop kate EditInterface#3 insertLine 61 blah
    true

    Wasn't that hard, really. I do know what a DCOPRef is though, so I had a head start. My point is that you don't really need documentation for this sort of thing.

    The existing DCOP interfaces are not designed for the ease of use by scripters/powerusers. They are built directly on top of the C++ implementation.

    Er, what?

    The DCOP interfaces are often not complete enough to make it possible to script everything that can be done via the GUI.

    The only way you're going to get that level of scripting ability is to rewrite all apps in some interpreted language with remote method invocation and, to make life easier, reflection.

    Rik

  5. KDE isnt just a window manager by nurb432 · · Score: 3, Informative

    Its a complete desktop environment, with all the features, libraries, intercommunications, coding standards, and all bells and whistles that go along with an 'environment'.

    If you just want a window manager, then KDE isn't your best choice in the first place...

    Please try to compare apples to apples...

    --
    ---- Booth was a patriot ----