[Kde-bindings] making smoke/korundum generate bindings for other things?

Gábor Lehel illissius at gmail.com
Thu Jun 23 18:34:10 UTC 2005


Agh.

kdebindings $ grep '$headerSubdirectories =' kalyptus/kalyptusCxxToSmoke.pm
$headerSubdirectories =
"kcanvas/device/|kcanvas/|kio/|kdevelop/|kinterfacedesigner/|kontact/|kate/|kparts/|dom/|kabc/|ksettings/|kjs/|ktexteditor/|kdeprint/|kdesu/|knewstuff/"

kdebindings $ grep LIBADD smoke/kde/Makefile.am
libsmokekde_la_LIBADD   = $(LIB_KHTML) -lkjs -lfontconfig $(LIB_KMDI)
$(LIB_KNS) $(LIB_KSPELL) $(LIB_KUTILS) $(LIB_KDEPRINT) $(GLLIB)
$(LIB_KDECORE) -lkcanvas -lkcanvasdevice

kdebindings $ cat smoke/kde/kde_header_list
...snip...
KCanvasTypes.h
KCanvasCreator.h
KCanvasResourceListener.h
KCanvasContainer.h
KCanvas.h
KCanvasImage.h
KCanvasItem.h
KCanvasPath.h
KCanvasResources.h
KCanvasMatrix.h
device/agg/KCanvasClipperAgg.h
device/agg/KCanvasContainerAgg.h
device/agg/KRenderingPaintServerSolidAgg.h
device/agg/KCanvasFilterAgg.h
device/agg/KRenderingPaintServerGradientAgg.h
device/agg/KRenderingPaintServerPatternAgg.h
device/agg/KCanvasAggHelper.h
device/agg/KRenderingPaintServerImageAgg.h
device/agg/KCanvasItemAgg.h
device/agg/KRenderingPaintServerAgg.h
device/agg/KRenderingDeviceFactoryAgg.h
device/agg/KRenderingDeviceAgg.h
device/KRenderingPaintServer.h
device/KRenderingDeviceFactory.h
device/KRenderingStrokePainter.h
device/KRenderingPaintServerImage.h
device/KRenderingFillPainter.h
device/KRenderingPaintServerPattern.h
device/KRenderingDevice.h
device/KRenderingPaintServerGradient.h
device/KRenderingStyle.h
device/KRenderingPaintServerSolid.h
KCanvasView.h
KCanvasRegistry.h
x11support/X11Platform.h
x11support/my_agg_color_conv.h
x11support/my_agg_color_conv_rgb8.h
x11support/my_agg_rendering_buffer.h
KCanvasFilters.h
KCanvasImageBuffer.h
kcanvas/KCanvasTypes.h
kcanvas/KCanvasCreator.h
kcanvas/KCanvasResourceListener.h
kcanvas/KCanvasContainer.h
kcanvas/KCanvas.h
kcanvas/KCanvasImage.h
kcanvas/KCanvasItem.h
kcanvas/KCanvasPath.h
kcanvas/KCanvasResources.h
kcanvas/KCanvasMatrix.h
kcanvas/device/agg/KCanvasClipperAgg.h
kcanvas/device/agg/KCanvasContainerAgg.h
kcanvas/device/agg/KRenderingPaintServerSolidAgg.h
kcanvas/device/agg/KCanvasFilterAgg.h
kcanvas/device/agg/KRenderingPaintServerGradientAgg.h
kcanvas/device/agg/KRenderingPaintServerPatternAgg.h
kcanvas/device/agg/KCanvasAggHelper.h
kcanvas/device/agg/KRenderingPaintServerImageAgg.h
kcanvas/device/agg/KCanvasItemAgg.h
kcanvas/device/agg/KRenderingPaintServerAgg.h
kcanvas/device/agg/KRenderingDeviceFactoryAgg.h
kcanvas/device/agg/KRenderingDeviceAgg.h
kcanvas/device/KRenderingPaintServer.h
kcanvas/device/KRenderingDeviceFactory.h
kcanvas/device/KRenderingStrokePainter.h
kcanvas/device/KRenderingPaintServerImage.h
kcanvas/device/KRenderingFillPainter.h
kcanvas/device/KRenderingPaintServerPattern.h
kcanvas/device/KRenderingDevice.h
kcanvas/device/KRenderingPaintServerGradient.h
kcanvas/device/KRenderingStyle.h
kcanvas/device/KRenderingPaintServerSolid.h
kcanvas/KCanvasView.h
kcanvas/KCanvasRegistry.h
kcanvas/x11support/X11Platform.h
kcanvas/x11support/my_agg_color_conv.h
kcanvas/x11support/my_agg_color_conv_rgb8.h
kcanvas/x11support/my_agg_rendering_buffer.h
kcanvas/KCanvasFilters.h
kcanvas/KCanvasImageBuffer.h
agg/KCanvasClipperAgg.h
agg/KCanvasContainerAgg.h
agg/KRenderingPaintServerSolidAgg.h
agg/KCanvasFilterAgg.h
agg/KRenderingPaintServerGradientAgg.h
agg/KRenderingPaintServerPatternAgg.h
agg/KCanvasAggHelper.h
agg/KRenderingPaintServerImageAgg.h
agg/KCanvasItemAgg.h
agg/KRenderingPaintServerAgg.h
agg/KRenderingDeviceFactoryAgg.h
agg/KRenderingDeviceAgg.h
KRenderingPaintServer.h
KRenderingDeviceFactory.h
KRenderingStrokePainter.h
KRenderingPaintServerImage.h
KRenderingFillPainter.h
KRenderingPaintServerPattern.h
KRenderingDevice.h
KRenderingPaintServerGradient.h
KRenderingStyle.h
KRenderingPaintServerSolid.h
(I realize a whole lot of those are duplicated and/or likely
unnecessary, just to be paranoid about it.)

It builds now, but:

illissius at lenti kdebindings $ grep -ri kcanvas
/opt/kde/build/KDE/kdebindings/smoke/kde/x_*
illissius at lenti kdebindings $

$ ruby -e 'require "Korundum"; puts KDE.constants.sort' | grep -i canvas
IconCanvas

What am I doing wrong?
(I removed the symlink and just straight copied the dir into kdelibs,
again to be paranoid about it, but apparently that wasn't the problem.
(And before you ask  (and I most certainly would ask, as it's not
unlikely I'm doing something similarly stupid ;), I'm not forgetting
to recompile korundum after changing stuff in smoke, nor to make
install.))

On 6/23/05, Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> On Thursday 23 June 2005 00:32, Gábor Lehel wrote:
> > On 6/22/05, Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> > > On Wednesday 22 June 2005 20:07, Gábor Lehel wrote:
> > > > Hi,
> > > > how hardwired is smoke/korundum to the existing kdelibs? eg, if I
> > > > wanted to make it generate bindings for kdenonbeta/kcanvas, how hard
> > > > would it be? (and how would I go about it?)
> > > > I tried doing it the 'dumb way' (eg, without trying to figure out how
> > > > any of it actually works) by making a symlink for kdenonbeta/kcanvas
> > > > at kdelibs/kcanvas, and adding all the headers to
> > > > smoke/kde/kde_headers_list, lines for all the classes to
> > > > kalyptus/kalyptusDataDict.pm, and finally adding -lkcanvas to
> > > > smoke/kde/Makefile.am, and it even compiled, but it doesn't seem to
> > > > have actually had any effect (eg, no classes called KDE::Canvas*).
> > > > the reason i want to do this is that kcanvas looks cool and I want to
> > > > play around with it, and playing around is much funner in ruby =).
> > >
> > > You don't need to add the classes to kalyptus/kalyptusDataDict.pm, but
> > > other than that what you did should have worked. Is KCanvas in a
> > > namespace, is that the problem?
> >
> > No, it's not in a namespace. It seems the problem was actually that I
> > included the leading kcanvas/ in the path for all the headers in
> > kde_headers_list. Removing them seems to have had some effect, namely
> > that it now fails to compile: (tried making clean and all that)
> >
> > make[1]: Entering directory `/opt/kde/build/KDE/kdebindings/korundum/bin'
> > /bin/sh ../../libtool --silent --mode=link --tag=CXX g++
> > -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500
> > -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W
> > -Wpointer-arith -Wno-non-virtual-dtor -g3 -fno-inline
> > -Wformat-security -Wmissing-format-attribute -fno-exceptions
> > -fno-check-new -fno-common    -o krubyinit -module -L/opt/kde/dest/lib
> > -L/usr/qt/3/lib -L/usr/lib    -version-info 0:0:0
> > -L/opt/kde/src/KDE/kdebindings/smoke/kde/ -L/usr/lib krubyinit.o
> > -Wl,-R -Wl,/usr/lib -L/usr/lib -L. -lruby18
> > ../../smoke/kde/libsmokekde.la
> > ../../qtruby/rubylib/qtruby/libqtrubyinternal.la
> > libtool: link: warning: `-version-info' is ignored for programs
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDevice::pushContext(KRenderingDeviceContext*)'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDevice::popContext()'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDeviceContext::setStyle(KRenderingStyle*)'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingFillPainter::paintServer() const'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDevice::setCurrentPath(void*)'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingStrokePainter::paintServer() const'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDeviceContext::setCanvas(KCanvas*)'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDevice::currentPath() const'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDevice::currentContext()'
> > /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> > `KRenderingDeviceContext::setPath(void*)'
> > collect2: ld returned 1 exit status
> > make[1]: *** [krubyinit] Error 1
> > make[1]: Leaving directory `/opt/kde/build/KDE/kdebindings/korundum/bin'
> > make: *** [all-recursive] Error 1
> >
> > I'm completely ignorant with regards to how the whole linking thing
> > works... any idea what the problem could be? Thanks for the help.
> I've checked out kdenonbeta and built libkcanvas now. It looks like you need
> to link against libkcanvasdevice and libkdecore too. And I think you will
> need to include the header for KRendingDevice from kcanvas/device as it is
> used in the KCanvas constructor.
> 
> You may need to add custom marshallers for converting C++ lists to ruby ones
> and back too.
> 
> In kalyptus/kalyptusCXXtoSmoke.pm there is this line which defines the header
> subdirectories (it shouldn't really be hard coded like this):
> 
> $headerSubdirectories =
> "kio/|kdevelop/|kinterfacedesigner/|kontact/|kate/|kparts/|dom/|kabc/|ksettings/|kjs/|ktexteditor/|kdeprint/|kdesu/|knewstuff/"
> 
> You could add 'kcanvas/device|kcanvas|' to the front of that, so you don't
> need to add '-I' include paths for them in the Makefile.am.
> 
> -- Richard
> 


-- 
Work is punishment for failing to procrastinate effectively.



More information about the Kde-bindings mailing list