This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Plugin-Interface

8

Votes
9
1
Tags: kross, kdecore kross, kdecore kross, kdecore
(comma "," separated)
The User
KDE Developer
Posts
647
Karma
0
OS

[Kross,KDECore] Plugin-Interface

Fri Jun 12, 2009 10:02 pm
Hi!
Currently each modular application has to create two plugin-interfaces: For C++ and for Kross. Some applications provide only one interface. Let's look at Konqueror: That's a problem.
So why don't create a common interface?
For C++ you do the following:
Code: Select all
class KDE_EXPORT MyInterface
{
public:
  virtual void func1(int x) = 0;
  virtual int func2(double x) = 0;
  //...
};

// KPluginFactory-Stuff

Then you load it using the KServiceTypeTrader and KService.

I think this could also be possible for Scripts. Maybe there could be something like a moc-plugin creating code to implement the virtual methods with script-calls. (that should be somehow possible, maybe the Qt-guys would like a moc-plugin-system, too) There would be an additional benefit: For some scripting-backends there could be optimizations because of the fixed member-functions. Maybe some modifications in KService would be needed.

For Kross you use Kross::Action. For best consistence there should be a Kross-C++-backend. I'm sure it's possible. A C-backend would be the first step.

Which applications could take benefits?
-For example Konqueror (especially KParts) with its limited scripting-support.
-KOffice could have C++-Plugins.
-All the KDevelop interfaces would be usable with scripts.
-Scripted-Pasma-Wallpapers would be possible. (for stuff like Mandelbrot it would be too slow, but for custom-slideshows it would be very useful)
-I'm sure especially new applications and new interfaces would use the unified system.

I'm waiting for comments. ;)
The User


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar