[Kde-bindings] Wt ruby bindings

Pau Garcia i Quiles pgquiles at elpauer.org
Mon Aug 18 10:51:58 UTC 2008


Quoting Richard Dale <richard.j.dale at gmail.com>:

For people wondering where this comes from: Koen, Richard Dale (the  
man behind Qt and KDE Ruby, Java, C and C# bindings) and I were at  
aKademy 2008 in Belgium ( http://akademy2008.kde.org ), where Koen had  
a presentation about Wt. Richard was interested in Wt, Koen was  
interested in bindings,  and I acted as a pointer to each other :-)

> Hi Koen
>
> On Tue, Aug 12, 2008 at 1:02 PM, Koen Deforche   
> <koen.deforche at gmail.com>wrote:
>
>> Richard,
>>
>> Geert is the person who is making Python bindings for Wt (and has
>> already progressed very far). So I guess he could certainly help you
>> with specific issues for making Ruby bindings.
>>
>> Geert Verbruggen: verbruggen.geert at gmail.com
>
> Thanks, I'll contact him about his ideas for getting slots/signals working
> in language bindings.
>
> I didn't have time at Akademy, but yesterday I got the code generation
> working for a Wt smoke library for use with Ruby bindings, and it now builds
> and links with 130 or so Wt:: classes. The coverage of the api is pretty
> complete apart from the WSignalBase/WSignal classes and the methods that
> take function pointers, or templated arguments. The next steps would be:
>
> * Get a 'hello world' working by linking to the QtRuby runtime
> * Find out how much interest there would be in a Ruby Wt binding by mailing
> the Wt list
> * Create a WtRuby project be removing all Qt-specific code from QtRuby
> * Write marshallers for the various std::vector and std::map types etc
> * Work out how to do slots/signals in Ruby.
>
> I don't think I should put the code in the KDE svn as it isn't really
> possible to use it with any KDE code. So it could go on the Korundum
> RubyForge project or maybe as another WtRuby project on RubyForge. I'll
> check in the changes needed for the 'kalyptus' code generator as that won't
> do any harm. I've attached a tar ball of the smoke project, and I'll cc this
> mail to the kdebindings list.
>
> Here are the issues that I came across:
>
> * The multiple inclusion guard macro on WPolygonArea was wrong
> * An include was missing from WTableRow for WTableCell (I can special case
> this, but the include should be there I think)
>
> diff -r src/Wt/WPolygonArea src.patched/Wt/WPolygonArea
> 7,8c7,8
> < #ifndef WCIRCLE_AREA_H_
> < #define WCIRCLE_AREA_H_
> ---
>> #ifndef WPOLYGON_AREA_H_
>> #define WPOLYGON_AREA_H_
> 95c95
> < #endif // WIMAGE_AREA_H_
> ---
>> #endif // WPOLYGON_AREA_H_
> diff -r src/Wt/WTableRow src.patched/Wt/WTableRow
> 10a11
>> #include <Wt/WTableCell>
>
> The following methods gave problems with linking, which usually means they
> are declared in the header, but not defined (I haven't checked what went
> wrong, just suppressed the code generation for now):
>
> Wt::RemoveExposedSignal(Wt::EventSignalBase*)
> Wt::AddExposedSignal(Wt::EventSignalBase*)
> Wt::WDate::isLeapYear(int)
> Wt::WDate::isValid(int, int, int)
> Wt::WPainter::drawImage(double, double, Wt::WPainter::Image const&, double,
> double, double, double)
> Wt::WPainterPath::addEllipse(Wt::WRectF const&)
> Wt::WRectF::WRectF(Wt::WPointF const&, Wt::WPointF const&)
> Wt::WSlider::setRange(int, int)
> Wt::WTextEdit::setStyleSheet(std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > const&)
> Wt::WTextEdit::setExtraPlugins(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)
> Wt::WTextEdit::setToolBar(int, std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)

Impressive!

> The FindWt.cmake script is expecting to find the fastcgi Wt lib, which isn't
> built be default.

That's my fault. This patch should fix it:

--- FindWt.cmake.orig   2008-08-18 12:44:29.000000000 +0200
+++ FindWt.cmake        2008-08-18 12:47:07.000000000 +0200
@@ -56,17 +56,25 @@ IF( Wt_INCLUDE_DIR )
          FIND_LIBRARY( Wt_HTTP_DEBUG_LIBRARY NAMES wthttpd PATHS PATH  
PATH_SUFFIXES lib libd lib-debug lib_debug )
          FIND_LIBRARY( Wt_FCGI_DEBUG_LIBRARY NAMES wtfcgid PATHS PATH  
PATH_SUFFIXES lib libd lib-debug lib_debug )

-        IF( Wt_LIBRARY AND Wt_EXT_LIBRARY AND Wt_HTTP_LIBRARY AND  
Wt_FCGI_LIBRARY )
+        IF( Wt_LIBRARY AND Wt_EXT_LIBRARY AND Wt_HTTP_LIBRARY )
                  SET( Wt_FOUND TRUE )
                 SET( Wt_FIND_REQUIRED_Release TRUE )
-                SET( Wt_LIBRARIES ${Wt_LIBRARY} ${Wt_EXT_LIBRARY}  
${Wt_HTTP_LIBRARY} ${Wt_FCGI_LIBRARY} )
-        ENDIF( Wt_LIBRARY AND Wt_EXT_LIBRARY AND Wt_HTTP_LIBRARY AND  
Wt_FCGI_LIBRARY )
+                SET( Wt_LIBRARIES ${Wt_LIBRARY} ${Wt_EXT_LIBRARY}  
${Wt_HTTP_LIBRARY} )
+        ENDIF( Wt_LIBRARY AND Wt_EXT_LIBRARY AND Wt_HTTP_LIBRARY )

-        IF( Wt_DEBUG_LIBRARY AND Wt_EXT_DEBUG_LIBRARY AND  
Wt_HTTP_DEBUG_LIBRARY AND Wt_FCGI_DEBUG_LIBRARY )
+       IF( Wt_FCGI_LIBRARY )
+               SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_FCGI_LIBRARY} )
+       ENDIF( Wt_FCGI_LIBRARY )
+
+        IF( Wt_DEBUG_LIBRARY AND Wt_EXT_DEBUG_LIBRARY AND  
Wt_HTTP_DEBUG_LIBRARY )
                  SET( Wt_DEBUG_FOUND TRUE )
                 SET( Wt_FIND_REQUIRED_Debug TRUE )
-                SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARY}  
${Wt_EXT_DEBUG_LIBRARY} ${Wt_HTTP_DEBUG_LIBRARY}  
${Wt_FCGI_DEBUG_LIBRARY} )
-        ENDIF( Wt_DEBUG_LIBRARY AND Wt_EXT_DEBUG_LIBRARY AND  
Wt_HTTP_DEBUG_LIBRARY AND Wt_FCGI_DEBUG_LIBRARY )
+                SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARY}  
${Wt_EXT_DEBUG_LIBRARY} ${Wt_HTTP_DEBUG_LIBRARY} )
+        ENDIF( Wt_DEBUG_LIBRARY AND Wt_EXT_DEBUG_LIBRARY AND  
Wt_HTTP_DEBUG_LIBRARY )
+
+       IF( Wt_FCGI_DEBUG_LIBRARY )
+               SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARIES}  
${Wt_FCGI_DEBUG_LIBRARY} )
+       ENDIF( Wt_FCGI_DEBUG_LIBRARY )

          IF(Wt_FOUND)
                  IF (NOT Wt_FIND_QUIETLY)

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)




More information about the Kde-bindings mailing list