From: Martin Krischik on
Brian May schrieb:
>>>>>> "Martin" == Martin Krischik <krischik(a)users.sourceforge.net> writes:
>
> Martin> There is just one problem here: Both Gtk+ and QT are OO libraries which
> Martin> are not all that compatible with the Ada's OO way of live and this in
> Martin> turn mean that layer (2) and (3) might not be as tiny as we hope for.
>
> I am curious - in what why are they not compatible?

First of all: all OO systems are incompatible. Sad but true. They use
different name mangler, different class tags (also called virtual
function tables) and so on.

In detail:

Qt: is written in C++. One could use Convention => Cpp to make all those
classes available. But Convention => Cpp is not part if the RM, seldom
used (meaning: badly tested) and difficult to use - but at least the
result behaves like normal tagged types and is pragma Export capable.

Gtk+: Used some OO layer on top of C. Using C make import to Ada easier
- but just importing the functions won't make the tagged type and you
create the tagged types proxys then they won't be pragma Export capable.

Note that I am not only speaking about importing an existing class
library but also about enhancing/inheriting from it and then exporting
the new enhancements back.

Note also: I did not say "totally incompatible". With enough effort it
is possible.

You might have also noticed the OpenStep discussion. With OpenStep one
does not even try make anything compatible - OpenStep approach is to add
a 2nd dynamically typed OO system in parallel - similar to Objective-C++.

Martin

--
mailto://krischik(a)users.sourceforge.net
Ada programming at: http://ada.krischik.com
From: Martin Krischik on
tmoran(a)acm.org schrieb:
>> GWindows is OK - but it is missing Unix support. But maybe WINE could
>> help here.

> IIRC from some years ago, someone used WINE with CLAW successfully.

And WINE is quite fast these days - so that would be an option.

Martin
--
mailto://krischik(a)users.sourceforge.net
Ada programming at: http://ada.krischik.com
From: I. Levashew on
Vadim Godunko �����:
> Both Gtk+/GtkAda and Qt/QtAda are portable. They work on UNIX/Linux,
> MS Windows, Mac OS. So, this is not an advantage.

Qt programs are aliens on Mac OS X. They differ from "normal" programs.
Currently there are two general GUI APIs on Mac OS X: Carbon and Cocoa.
Everybody favors Cocoa over Carbon. And Qt is worse than Carbon. And
GTK+ does not even run on Mac OS X directly, only in X11. X11 in Mac OS
X is even worse than Qt (which is worse than Carbon which is worse than
Cocoa). No drag&drop, no window grouping (Expose). Each X11 window
belong to X11.app. No own main menu. Neither Qt nor GTK+ provide user
experience competeable with Cocoa. Users tend to favor Cocoa
applications over Carbon, etc. based. And there is no Cocoa binding yet.

There is a good news about Cocoa. Apple started BridgeSupport project
easing interfacing Cocoa to other languages.

Thus we have 2 projects: SWIG and BridgeSupport. They cover huge amount
of code. Both ones don't support Ada currently (at least BS). But if
they will...
From: tmoran on
>First of all: all OO systems are incompatible. Sad but true. They use
>different name mangler, different class tags (also called virtual
>function tables) and so on.
If you just want to save the grunt work of writing a lot of
pragma Imports, a program can read a typelib (Windows) and produce
Ada code. I did that for the Google Earth API. David Botton did
that and IIRC his program is available from AdaCore.
But if you want to make something really helpful to an Ada programmer,
you need to create a thick binding design that has classes, tasks,
exceptions, etc that "fits" Ada so you aren't just writing C code in Ada
syntax, and you need to learn about the ins-and-outs-and bugs in the C
code you are going to call, so your Ada binding can be well-specified and
implement what it says it implements. It takes a lot of work, there are
more people creating new C APIs than there are Ada programmers to design
bindings for them, and there's very little market. Why do you suppose
that of the multiple Windows etc Ada thick bindings, so few are still
actively supported?
From: Gautier on
tmoran(a)acm.org wrote:
>> GWindows is OK - but it is missing Unix support. But maybe WINE could
>> help here.
> IIRC from some years ago, someone used WINE with CLAW successfully.

Speaking of CLAW, I tried the demo

http://www.rrsoftware.com/html/prodinf/claw/clawintro.html

with some recent GNAT's (post-3.15p, like GPL 2006 and 2007);
the binder sees an elaboration circularity - do you know if it there is a
solution for GNAT's support in the release version ?
______________________________________________________________
Gautier -- http://www.mysunrise.ch/users/gdm/index.htm
Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!