Forwarding headers for kdelibs

Hamish Rodda rodda at kde.org
Mon Nov 6 07:23:42 GMT 2006


On Thursday 12 October 2006 23:37, Hamish Rodda wrote:
> On Monday 02 October 2006 23:02, Hamish Rodda wrote:
> > Hi,
> >
> > Just wanted to let you know I've started work on creating forwarding
> > headers for kdelibs classes, to support Qt4 style includes on kde
> > classes. This can of course be extended to any other kde library.
> >
> > My generator uses both the build system and a c++ parser (Roberto's
> > kdevelop-pg like c++ parser, which will be in kdevelop4).  This means
> > that the generated headers should be correct, even down to only
> > generating headers for exported classes only.  (There is a problem at the
> > moment because I am not parsing other included headers, and thus macros
> > can get in the way of correct parsing, but I intend to fix this.)

<snip / change...>

> > To try these headers out, includes like the
> > following should work:
> >
> > #include <KConfig>
> >
> > Namespaces are handled with subdirectories, eg:
> >
> > #include <KTextEditor/Cursor>

Ok, I have now committed these files, and patched Kate (in kdebase) to use 
them as proof-of concept.

The last remaining deficiencies that I am aware of are:
- namespaces with exported functions do not have forwarding headers generated 
for them, e.g. KStdAccel, KStdAction etc.
- I have not (yet?) created catchall includes, eg. like with Qt you can do 
#include <QtGui>

For the moment, if small changes are needed you can make them by hand, or ask 
me to regenerate the includes.  Sometime soon hopefully the cmake change will 
get merged and anyone will be able to perform the generation.

Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061106/eca27c55/attachment.sig>


More information about the kde-core-devel mailing list