Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-13 Thread Richard Dale
On Fri, Nov 13, 2009 at 7:32 AM, Pekka Reijula reij...@gmail.com wrote:
 On Monday 09 November 2009, Ian Monroe wrote:
 I suspect the answer to the subject is no since I haven't found a
 mention of a method to do it. But I also haven't found comprehensive
 QtScript API docs. :)
 QtScript apidocs are generated in Qt labs project qtscriptgenerator.

 My situation is that I want to write a full chat solution in a
 qtscript plasmoid using the QtScript Telepathy bindings I wrote. (I'm
 guessing a dataengine or service for buddy presence and chatting would
 be pretty crazy right?)

 We have created couple of soulutions where this kind of importing bindings
 is possible, so I'm more than a willing to start a discussion how to proceed
 with this kind of ideas in plasma.

 Our idea allows creation of plasmoids that have qtscript inside to your own
 plama desktop environment. We can extend plasma in a way that allows user to
 write own script with for example Kate or download it from http url. The
 basic idea is that only text is read and script is evaluated. All that you
 need for this is the qtscript-bindings that for example amarok uses.

 What this could offer, would be pretty much the same that the Qt-lively
 project offers in here: http://lively.cs.tut.fi/qt/videos.html
 All the widgets can be run also in our system.
 What do you deveopers think? Should plasma be able add these kind of
 widgets. Or should it be better to just create plasmoid that enables
 importing this kind of functionality inside. I could upload the plasmoid
 sources to kde, but I'm not yet a plasma developer.
The QtScript bindings based on the language indpendent Smoke libraries
are going well, and I'm not far short of being able to wrap the Plasma
apis.

http://gitorious.org/qtscript-smoke/qtscript-smoke

The following items need to be implemented:before we can start on
Plasma support:

* Add a thread to periodically sweep the hash of C++ pointers to
QtScript instances, and delete any entries where 'isValid()' is no
longer true

* Split the bindings up so that there is one QtScript plugin per smoke library

* Rename the project 'JSmoke'  (well that's my suggestion for a more
catchy name anyway)

The smoke bindings have a much lower memory footprint and are faster
than the Qt Labs ones. The api is very similar with only minor
differences. Nearly all the Qt Labs QtScript examples now run fine
under the Smoke based version.

I think these bindings would be the most suitable for Ian's telepathy
client, although we would need to implement support for writing
plugins in QtScript.

-- Richard
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-13 Thread Richard Dale
On Fri, Nov 13, 2009 at 12:16 PM, Artur Souza (MoRpHeUz)
morph...@openbossa.org wrote:
 Hey Richard!

 On Friday 13 November 2009, 07:44 Richard Dale wrote:
 The QtScript bindings based on the language indpendent Smoke libraries
 are going well, and I'm not far short of being able to wrap the Plasma
 apis.

 Just one question: when this is done, we'll be able to drop the bindings we
 currently have on kdebase/runtime/plasma/scriptengine/javascript/ ?
No I don't thnk so, I think we want a simple javascript api as well as
a full C++-like api, and possible another security oriented/sandboxed
javascript api too sometime.

 And this
 bindings are just for KDE stuff or you plan to use them for Qt stuff too ?
They will work fine for any apis that have smoke libs - so both Qt and
KDE apis. I don't think they are aimied at scripting C++ apps though,
like the Qt Labs bindings can as they use the standard QtScript
mechanism for wrapping QObjects. The Smoke based bindings wrap
QObjects differently.

-- Richard
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-13 Thread Artur Souza (MoRpHeUz)
Hi Pekka,

On Friday 13 November 2009, 04:32 Pekka Reijula wrote:
 Our idea allows creation of plasmoids that have qtscript inside to your own
 plama desktop environment. We can extend plasma in a way that allows user
  to write own script with for example Kate or download it from http url.
  The basic idea is that only text is read and script is evaluated. All that
  you need for this is the qtscript-bindings that for example amarok uses.

Maybe I'm not getting what you meant: this is already possible. Plasma supports 
javascript/qtscript plasmoids. If you put them somewhere like kde-apps.org you 
will also be able to download them. So, what exactly is your point about 
enabling plasma to run script plasmoids ? So, maybe I just didn't get what 
you mean :) Can you explain a little bit more ?

 What this could offer, would be pretty much the same that the Qt-lively
 project offers in here: http://lively.cs.tut.fi/qt/videos.html
 All the widgets can be run also in our system.

If you mean running qt lively scripts on plasma, then we have two options: if 
they are pure javascript or qtscript ones it should work out of the box of 
even just need some really small work. If they are special in any way, then we 
should just create a qt lively scriptengine and it will work perfectly (just 
like we did with google gadgets, edje and OSX).

 What do you deveopers think? Should plasma be able add these kind of
 widgets. Or should it be better to just create plasmoid that enables
 importing this kind of functionality inside. I could upload the plasmoid
 sources to kde, but I'm not yet a plasma developer.

Well, it should be pretty easy to be a plasma/kde developer ;P. But anyway I 
think that we are closer than you think to support qt lively widgets on plasma. 
Maybe it already works with just a little amount of work. And as I'm on my 
creative Friday, maybe I can end the day making this thing work ;) But first I 
need to understand what I asked above and have access to this widgets.

Cheers!

--
Artur Duque de Souza
openBossa
INdT - Instituto Nokia de Tecnologia
--
Blog: http://blog.morpheuz.cc
PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net
--


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-13 Thread Artur Souza (MoRpHeUz)
Hey Richard!

On Friday 13 November 2009, 07:44 Richard Dale wrote:
 The QtScript bindings based on the language indpendent Smoke libraries
 are going well, and I'm not far short of being able to wrap the Plasma
 apis.

Just one question: when this is done, we'll be able to drop the bindings we 
currently have on kdebase/runtime/plasma/scriptengine/javascript/ ? And this 
bindings are just for KDE stuff or you plan to use them for Qt stuff too ?

Cheers!

--
Artur Duque de Souza
openBossa
INdT - Instituto Nokia de Tecnologia
--
Blog: http://blog.morpheuz.cc
PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net
--


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-13 Thread Aaron J. Seigo
On November 12, 2009, Pekka Reijula wrote:
 Our idea allows creation of plasmoids that have qtscript inside to your own
 plama desktop environment. We can extend plasma in a way that allows user
  to write own script with for example Kate or download it from http url.
  The basic idea is that only text is read and script is evaluated. All that
  you need for this is the qtscript-bindings that for example amarok uses.

the question is this:

do these plasmoids need the full Qt API?

if so, then they are inherently untrustable from a security perspective, 
though that's not necessarily a bad thing. it just means that you don't want 
to be loading these things from people and places you don't implicitly trust. 
it would also mean that you are looking for Smoke bindings that Richard 
mentioned.

if there is specific API in addition to the 'standard' Simplified JavaScript 
API currently provided in the javascript AppletScriptEngine, then if that 
specific API is offered as a QScriptEngine extension, it can be loaded given 
enough permission/trust is bestowed on that plasmoid (e.g. by a valid gpg 
signature that is trusted by the user).

the other day i added support for two properties in the .desktop metadata file 
of a plasmoid:

X-Plasma-RequiredExtensions and X-Plasma-OptionalExtensions

these are both string lists and can be used to load QScriptEngine extensions 
upon request. a security sandbox is being established around this mechanism, 
so it should be reasonably safe.

 I could upload the plasmoid
 sources to kde, but I'm not yet a plasma developer.

if you get a kde svn account you can upload them to playground quite easily:

http://techbase.kde.org/Contribute/Get_a_SVN_Account

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-12 Thread Ian Monroe
On Tue, Nov 10, 2009 at 2:56 PM, Aaron J. Seigo ase...@kde.org wrote:
 On November 10, 2009, Ian Monroe wrote:
 Ok from talking more in IRC, it sounds like the idea is to have GPG
 signing of qtscript plasmoids, and then allow them to use the features
 they ask for. Unlike with C++, it can really be enforced that they
 only use the features they declare they need.

 right; which is one of the big benefits imho of using scripting.

 Amarok just added GPG signing for its scripts, I don't think its a big
 deal to add this.

 is this something that could be put into Plasma::Package and used by Amarok
 from there? would be great to share this code.

Amarok scripts don't have much to do with plasmoids, so no not really.
If we wanted to share code it would have to be in the form of some
sort of kdelibs package signing library. But I'm not sure it makes
sense to abstract QCA, it doesn't take much code.

Ian
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


can qtscript plasmoids load C++ qtscript plugins

2009-11-12 Thread Pekka Reijula
On Monday 09 November 2009, Ian Monroe wrote:
 I suspect the answer to the subject is no since I haven't found a
 mention of a method to do it. But I also haven't found comprehensive
 QtScript API docs. :)
QtScript apidocs are generated in Qt labs project qtscriptgenerator.

 My situation is that I want to write a full chat solution in a
 qtscript plasmoid using the QtScript Telepathy bindings I wrote. (I'm
 guessing a dataengine or service for buddy presence and chatting would
 be pretty crazy right?)

We have created couple of soulutions where this kind of importing bindings
is possible, so I'm more than a willing to start a discussion how to proceed
with this kind of ideas in plasma.

Our idea allows creation of plasmoids that have qtscript inside to your own
plama desktop environment. We can extend plasma in a way that allows user to
write own script with for example Kate or download it from http url. The
basic idea is that only text is read and script is evaluated. All that you
need for this is the qtscript-bindings that for example amarok uses.

What this could offer, would be pretty much the same that the Qt-lively
project offers in here: http://lively.cs.tut.fi/qt/videos.html
All the widgets can be run also in our system.
What do you deveopers think? Should plasma be able add these kind of
widgets. Or should it be better to just create plasmoid that enables
importing this kind of functionality inside. I could upload the plasmoid
sources to kde, but I'm not yet a plasma developer.
-- 
   -- Pekka Reijula
   -- reij...@gmail.com
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-10 Thread Ian Monroe
On Mon, Nov 9, 2009 at 2:49 PM, Aaron J. Seigo ase...@kde.org wrote:
 On November 9, 2009, Ian Monroe wrote:
 I suspect the answer to the subject is no since I haven't found a
 mention of a method to do it.

 no is correct.

 But I also haven't found comprehensive
 QtScript API docs. :)

 kdebase/workspace/plasma/design/javascript has a growing body of information.

 My situation is that I want to write a full chat solution in a
 qtscript plasmoid using the QtScript Telepathy bindings I wrote. (I'm
 guessing a dataengine or service for buddy presence and chatting would
 be pretty crazy right?)

 a datanengine/service would make it really easy for any widget to access them,
 but i don't know how well Telepathy would map to that API?

 It would take a 3 line function to add a loadScriptPlugin. However
 if you wanted to sandbox QtScript plugins then adding such a function
 would undo that, since anyone with the qt bindings installed could
 write files etc. I'm not sure if thats a security goal you have or
 not.

 yes, it is a security goal, and yes, such a function would completely destroy
 any sandboxing.

 the current idea is to allow sandbox erosion through trust and permission so
 that such a method could be open to trusted / permitted widgets.

 this has not been implemented yet as the interest in working on these bindings
 is low. what is needed is a way for a widget to say here's what i want access
 to and then, if the script engine deems it appropriate, to add those pieces
 of API at runtime to the engine.

Ok from talking more in IRC, it sounds like the idea is to have GPG
signing of qtscript plasmoids, and then allow them to use the features
they ask for. Unlike with C++, it can really be enforced that they
only use the features they declare they need.

Amarok just added GPG signing for its scripts, I don't think its a big
deal to add this. Chani already has the .desktop feature declaration
in-place for the screensaver plasmoids. I'll checkout kdelibs etc and
research this more.

Ian
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-10 Thread Aaron J. Seigo
On November 10, 2009, Ian Monroe wrote:
 Ok from talking more in IRC, it sounds like the idea is to have GPG
 signing of qtscript plasmoids, and then allow them to use the features
 they ask for. Unlike with C++, it can really be enforced that they
 only use the features they declare they need.

right; which is one of the big benefits imho of using scripting.
 
 Amarok just added GPG signing for its scripts, I don't think its a big
 deal to add this.

is this something that could be put into Plasma::Package and used by Amarok 
from there? would be great to share this code.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


can qtscript plasmoids load C++ qtscript plugins

2009-11-09 Thread Ian Monroe
I suspect the answer to the subject is no since I haven't found a
mention of a method to do it. But I also haven't found comprehensive
QtScript API docs. :)

My situation is that I want to write a full chat solution in a
qtscript plasmoid using the QtScript Telepathy bindings I wrote. (I'm
guessing a dataengine or service for buddy presence and chatting would
be pretty crazy right?)

It would take a 3 line function to add a loadScriptPlugin. However
if you wanted to sandbox QtScript plugins then adding such a function
would undo that, since anyone with the qt bindings installed could
write files etc. I'm not sure if thats a security goal you have or
not.

Thanks,
Ian
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-09 Thread Marco Martin
On Monday 09 November 2009, Ian Monroe wrote:
 I suspect the answer to the subject is no since I haven't found a
 mention of a method to do it. But I also haven't found comprehensive
 QtScript API docs. :)

well, the current bindings are limited and hand written, just have bindings 
to the principal (and safest) Applet methods, dataengines, layouts and te 
widgets in libplasma..
i don't know if it would be even desired to load random plugins, since we want 
them to be secure (at least attempting to be) but yeah, complete bindings 
would be needed as a completely separate script engine :)

 My situation is that I want to write a full chat solution in a
 qtscript plasmoid using the QtScript Telepathy bindings I wrote. (I'm
 guessing a dataengine or service for buddy presence and chatting would
 be pretty crazy right?)

and that would be a good use case for those fantomatic bindings, even wicked 
cool :D

Cheers, 
Marco Martin
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-09 Thread Ian Monroe
On Mon, Nov 9, 2009 at 1:36 PM, Marco Martin notm...@gmail.com wrote:
 On Monday 09 November 2009, Ian Monroe wrote:
 I suspect the answer to the subject is no since I haven't found a
 mention of a method to do it. But I also haven't found comprehensive
 QtScript API docs. :)

 well, the current bindings are limited and hand written, just have bindings
 to the principal (and safest) Applet methods, dataengines, layouts and te
 widgets in libplasma..
 i don't know if it would be even desired to load random plugins, since we want
 them to be secure (at least attempting to be) but yeah, complete bindings
 would be needed as a completely separate script engine :)

I don't want complete bindings, I just want my Telepathy binding + the
hand written bindings (though I suppose its possible that my opinion
will change). :)

Any suggestions for how I should proceed then? I'm a big C++ fan so
that could work.

Ian
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: can qtscript plasmoids load C++ qtscript plugins

2009-11-09 Thread Aaron J. Seigo
On November 9, 2009, Ian Monroe wrote:
 I suspect the answer to the subject is no since I haven't found a
 mention of a method to do it.

no is correct.

 But I also haven't found comprehensive
 QtScript API docs. :)

kdebase/workspace/plasma/design/javascript has a growing body of information.

 My situation is that I want to write a full chat solution in a
 qtscript plasmoid using the QtScript Telepathy bindings I wrote. (I'm
 guessing a dataengine or service for buddy presence and chatting would
 be pretty crazy right?)

a datanengine/service would make it really easy for any widget to access them, 
but i don't know how well Telepathy would map to that API?

 It would take a 3 line function to add a loadScriptPlugin. However
 if you wanted to sandbox QtScript plugins then adding such a function
 would undo that, since anyone with the qt bindings installed could
 write files etc. I'm not sure if thats a security goal you have or
 not.

yes, it is a security goal, and yes, such a function would completely destroy 
any sandboxing.

the current idea is to allow sandbox erosion through trust and permission so 
that such a method could be open to trusted / permitted widgets.

this has not been implemented yet as the interest in working on these bindings 
is low. what is needed is a way for a widget to say here's what i want access 
to and then, if the script engine deems it appropriate, to add those pieces 
of API at runtime to the engine.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel