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

List:       ktexteditor-devel
Subject:    Interfaces
From:       Andras Mantia <amantia () kde ! org>
Date:       2005-05-17 8:27:23
Message-ID: 200505171127.23678.amantia () kde ! org
[Download RAW message or body]

Hi,

The biggeest problem I have with interfaces (and here the KTextEditor 
interface) is that you cannot extend them without introducing new 
interface classes, like it was the case of  the *Ext classes, because 
of BIC issues. I'm trying to find a way to get rid  of this limitation, 
so here is what I have in my mind. Remember this is just pure fiction, 
I haven't tried to implement them yet.
 The main idea would be that the user of the interface could query about 
the available methods that are implemented in the currently selected 
editor. So I can query the KTextEditor::EditInterface and find out if 
it supports a method or not. For example query for editBegin(). If it 
supports the query method will return a structure having the following 
fields:
- pointer to the method
- return type
- arguments expected

If it's not supported it will return and empty structure (or where the 
pointer is null). 

The question is how to call such a method. This can be done like with 
DCOP or using QVariants on the callers side. Inside the interface 
implementation it can use a table to look up for the methods, and 
convert the QVariants to the correct types and call the real method in 
the editor. Return values can be get back as parameters if needed.

I can see that this kind of working will result in a slower function 
calls, so I don't want to get rid of the current way of using pure 
virtual's, but this would help in extending the interface in a binary 
compatible way without needing to introduce a lot of new 
interfaces/classes.

So what do you think about it? 

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
_______________________________________________
Ktexteditor-devel mailing list
Ktexteditor-devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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