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

List:       kjsembed
Subject:    Re: [kjsembed] kjsembed with non-QObject classes
From:       "Erik L. Bunce" <kde () bunce ! us>
Date:       2006-10-04 14:36:51
Message-ID: 4523C703.9060202 () bunce ! us
[Download RAW message or body]

Andreas Zehender wrote:
> Hi,
> prope
> I toy with the idea to add scripting ability to KPovModeler for a long time now.  \
> Triggered by the latest discussion on kde-core-devel about scripting languages in \
> kde and a new student that wants to implement animations in KPovModeler I searched \
> for solutions for application scripting and found two: QSA and kjsembed 
> I have a main problem with QSA and perhaps kjsembed: No single class that should be \
> scriptable is a QObject and I have many properties in KPovModeler that do not fit \
> into a QVariant (at least not in Qt3), which I believe is a problem. For example \
> povray uses other color objects than qt, or many properties are 2D, 3D or ND \
> vectors. 
> Because of the QVariant limitation of Qt3, there is a separate PMVariant and a self \
> made property system in KPovModeler that works and is used by a rule system to \
> determine which object can be inserted at what point in the scene. There is also a \
> child/parent structure of povray objects, similar to the QObject child/parent \
> structure. 
> So my thought was (without looking at the kjsembed code) to "just" use the \
> parser/interpreter part of kjsembed and adapt that to my own object structure, \
> property system and add support for vectors, vector math, povray colors etc. I \
> don't need signals/slots, and I don't need access to application objects, only the \
> graphical povray objects should be scriptable, which are no QObjects as I wrote \
> above. 
> Would that be possible with kjsembed? Are there already class interfaces to adapt \
> to another property/object system or is kjsembed limited to QObjects like QSA? Or \
> can the bindings be overwritten? 
> Maybe you can point me to the files where the parser/interpreter part is located \
> and where the binding to classes and properties is made. Is there documentation \
> available how to add bindings to other classes? 
> Regards,
> Andreas
> _______________________________________________
> kjsembed mailing list
> kjsembed@kde.org
> https://mail.kde.org/mailman/listinfo/kjsembed
> 
kjsembed provides methods of enabling scripting for pretty much any C++
class or structure.  Depending on the type of object you have you will
probably  derive your binding from the ValueBinding, VariantBinding,
ObjectBinding, or QObjectBinding.  Once you've determined which binding
best matches the use you can have at it.  We are also working on an
autobind tool that will eventually be able to create bindings for you,
but it is not yet ready for prime time. 

For stuff that is unique to your PMVariant take a look at how
VariantBinding (value_binding.{h,cpp}) is implemented.  To see how to
support your "self made" property system, take a look at how
QObjectBinding (qobject_binding.{h,cpp}) is implemented.

If you have specific questions/answers you can stop by the #kjsembed
channel on FreeNode.

Enjoy,
Erik Bunce
kde@bunce.us

_______________________________________________
kjsembed mailing list
kjsembed@kde.org
https://mail.kde.org/mailman/listinfo/kjsembed


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

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