[Kde-bindings] KDE/kdebindings

Richard Dale rdale at foton.es
Thu Jul 24 09:24:03 UTC 2008


On Thursday 24 July 2008 00:20:08 Arno Rehn wrote:
> On Wednesday 23 July 2008 16:05:15 Richard Dale wrote:
> > On Wednesday 23 July 2008 14:42:23 Arno Rehn wrote:
> > > SVN commit 837001 by arnorehn:
> > >
> > > * Add a KTextEditor C# binding
> > > * Fix dependencies and references for plasma-sharp
> > > * If a class was nested in a namespace, kalyptus didn't
> > >   recognize correctly if a method is a constructor.
> > > * Remove the KParts classes from KTextEditor smoke lib,
> > >   workaround was needed because of the above kalyptus bug.
> >
> > Good you've fixed that - I wondered what was causing it.
> >
> > Can we call abstract methods in C#? I was thinking we would need to
> > special case the KTextEditor methods to remove the 'p' from the flags so
> > they wouldn't be abstract.
>
> We can't even instantiate a class that contains unimplemented abstract
> methods. That's one of the reasons why I suggested to get rid of the
> abstract stuff in C# completely and make everything simply 'virtual'. The
> other possibility would be to create another class which implements all the
> abstract methods of the original one. In CreateInstance() we would then
> check if the class that is to be instantiated contains any unimplemented
> abstract methods and then just use the one that implements them all.
> But special-casing every single abstract class seems too laborious to me.
Well it's quite easy to just special case every class that starts with 
KTextEditor::, and that's all we need to do. We don't need to instantiate 
KTextEditor classes with new, but CreateInstance has to be able to work.

I changed the smoke code generation so that you can now call pure virtual 
methods. I don't think we should get rid of abstract methods as mostly they 
are actually abstract and we would be losing some meaning from the original 
C++ api. If there are other places where pure virtual methods are being used 
as interfaces like in KTextEditor we can always special case them too, but I 
don't know of any others - maybe KDevelop does that, but I haven't looked 
much yet.

-- Richard




More information about the Kde-bindings mailing list