comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Claude Mahieux" <jeanclaude.mahieux@topgraphx.com>
Subject: Re: X11 binding with FSF version of gnat
Date: Fri, 7 Feb 2003 17:50:36 +0100
Date: 2003-02-07T16:46:08+00:00	[thread overview]
Message-ID: <b20nsg$mf5$1@news-reader11.wanadoo.fr> (raw)
In-Reply-To: 060220032349197450%hopperj@macconnect.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3609 bytes --]

Why not use a full Ada implementation ? :)
We plan offering our XInAda Xlib under GPL, but need to allocate some time
to do it.
The entire XInAda library set includes Toolkit and 1.2 Motif widget set 100%
Ada95

Jean-Claude MAHIEUX
Top Graph'X Sales Manager
10 All�e de la Mare Jacob
91290 La Norville - FRANCE
Tel : +33 1 69 26 97 88
Fax : +33 1 69 26 97 89
Email : sales@topgraphx.com
URL : http://www.topgraphx.com
German Representative : orbriver-de@topgraphx.com
US Representative : sroliver@topgraphx.com



"jim hopper" <hopperj@macconnect.com> a �crit dans le message de news:
060220032349197450%hopperj@macconnect.com...
> From: james hopper <hopperj@macconnect.com>
>
> I am having a bit of a problem with x11 bindings when compiled for osx
> (the intermetrics bindings updated for linux). I was hoping someone
> might have worked with the bindings on os x or have some idea whats
> going on.  This is using the os x version of gnat, so i don't know if
> its a problem with our version of gnat or something that is specif to
> gnat 5x.
>
> problem is this:
>
> there is a type in x-xlib.ads that looks like this:
>
>     type XEvent (Event_Type: X.signed_int := X.LASTEvent + 1) is record
> -- Xlib.h:934
>         serial       : X.unsigned_long;                     --
> Xlib.h:902
>         send_event   : Bool;                                --
> Xlib.h:903
>         display      : XDisplay_access;                     --
> Xlib.h:904
>    case Event_Type is
>        when X.KeyPress | X.KeyRelease =>
>       xkey     : XKeyEvent;                       -- Xlib.h:937
>        when X.ButtonPress | X.ButtonRelease =>
>       xbutton  : XButtonEvent;                    -- Xlib.h:938
> ...
>
> its used in test sample called basicwin.adb where the type is
> instantiated as
>
>     Report             :          aliased X.Xlib.XEvent;
>
> (note its using the default for the descriminant
>
> ok now its used like this:
>
>     loop
>         X.Xlib.XNextEvent(Display, Report'access);
>    ada.text_io.put_line("Here" & X.signed_int'image(Report.Event_Type) &
>       Integer'image(Report'size/8));
>         case  (Report.Event_Type) is
>             when X.Expose =>
>       ada.text_io.put_line("Expose");
>       ...
>             when X.ConfigureNotify =>
>        ada.text_io.put_line("ConfigureNotify");
>       ada.text_io.put_line("width = " &
> integer'image(integer(Report.Xconfigure.Width)));
>       ada.text_io.put_line("height = " &
> X.signed_int'image(Report.Xconfigure.Height));
>       ...
>    when ...
>
> i thought at first the problem was it wasnt being allocated because
> when you use the debugger and stop right after the xnextevent  and do
> "print report"  it shows report as a null record, however if i do
>
> x/20 report'address
>
> i can see that the data is all there and looks correct.
>
> when i try to access the height and width field in x.configurenotify
> version of the variant record, the print statements above it gets a
> constraint error.  if i change x-xlib.ads to use x.xconfignotify as the
> default descriminant then the height and width are fine, but then
> expose variant gets a constraint error when it tries to access internal
> fields of the expose variant.
>
> This looks like either a compiler problem, or something thats changed
> from 3.13 (which i used the bindings for before) that doesnt like the
> variant being changed behind the compilers back.  oh yes and i have to
> use -gnatp or it always blows up when i try to access it with
> constraint error in the descriminant.
>
> Any information on this would help.
>
> thanks jim





  parent reply	other threads:[~2003-02-07 16:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-07  4:49 X11 binding with FSF version of gnat jim hopper
2003-02-07 11:15 ` Jeffrey Creem
2003-02-07 16:50 ` Jean-Claude Mahieux [this message]
2003-02-07 17:02   ` David Botton
2003-02-07 17:06   ` Larry Kilgallen
2003-02-07 18:19     ` Jean-Claude Mahieux
2003-02-08  0:21   ` jim hopper
2003-02-10 10:06     ` Jean-Claude Mahieux
2003-02-11  0:12       ` jim hopper
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox