comp.lang.ada
 help / color / mirror / Atom feed
* X11 binding with FSF version of gnat
@ 2003-02-07  4:49 jim hopper
  2003-02-07 11:15 ` Jeffrey Creem
  2003-02-07 16:50 ` Jean-Claude Mahieux
  0 siblings, 2 replies; 9+ messages in thread
From: jim hopper @ 2003-02-07  4:49 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  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
  1 sibling, 0 replies; 9+ messages in thread
From: Jeffrey Creem @ 2003-02-07 11:15 UTC (permalink / raw)


I have seen the same problem under Solaris as well. Perhaps you should
submit a but report to ACT. (Of course I should have too!).. I still
occasionally think about working on these bindings but allof my new never
finished personal projects that I start for fun are in GtkAda these days.


"jim hopper" <hopperj@macconnect.com> wrote in message
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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  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
  2003-02-07 17:02   ` David Botton
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Jean-Claude Mahieux @ 2003-02-07 16:50 UTC (permalink / raw)


[-- 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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  2003-02-07 16:50 ` Jean-Claude Mahieux
@ 2003-02-07 17:02   ` David Botton
  2003-02-07 17:06   ` Larry Kilgallen
  2003-02-08  0:21   ` jim hopper
  2 siblings, 0 replies; 9+ messages in thread
From: David Botton @ 2003-02-07 17:02 UTC (permalink / raw)
  To: Jean-Claude Mahieux, comp.lang.ada mail to news gateway

Amazing news! I am sure myself or others would be interested in volunteering
to help if that would help make it available sooner.

Will it include the GNAT Modifications to the GPL or regular GPL?
Are you going to make TeleUSE available also?

 (I can dream :-)

David Botton

----- Original Message -----
From: "Jean-Claude Mahieux" <jeanclaude.mahieux@topgraphx.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Friday, February 07, 2003 11:50 AM
Subject: Re: X11 binding with FSF version of gnat


> 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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  2003-02-07 16:50 ` Jean-Claude Mahieux
  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
  2 siblings, 1 reply; 9+ messages in thread
From: Larry Kilgallen @ 2003-02-07 17:06 UTC (permalink / raw)


In article <b20nsg$mf5$1@news-reader11.wanadoo.fr>, "Jean-Claude Mahieux" <jeanclaude.mahieux@topgraphx.com> writes:
> Why not use a full Ada implementation ? :)
> We plan offering our XInAda Xlib under GPL, but need to allocate some time
> to do it.

My understanding is that Jim's purpose is to release the bindings with
the GNAT compiler for OSX.  That may be incompatible with your licensing
model.

> Top Graph'X Sales Manager



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  2003-02-07 17:06   ` Larry Kilgallen
@ 2003-02-07 18:19     ` Jean-Claude Mahieux
  0 siblings, 0 replies; 9+ messages in thread
From: Jean-Claude Mahieux @ 2003-02-07 18:19 UTC (permalink / raw)


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

What we plan is to provide XInAda-Xlib as a set of Ada95 library source
code.
It should be compilable with any Ada95 compiler. We do not plan working in
parallel
to build spcific versions following in particular gnat versions. The Xlib
(including low level required packages)
is about 45K lines

"Larry Kilgallen" <Kilgallen@SpamCop.net> a �crit dans le message de news:
KtNR6R$f9sQ8@eisner.encompasserve.org...
> In article <b20nsg$mf5$1@news-reader11.wanadoo.fr>, "Jean-Claude Mahieux"
<jeanclaude.mahieux@topgraphx.com> writes:
> > Why not use a full Ada implementation ? :)
> > We plan offering our XInAda Xlib under GPL, but need to allocate some
time
> > to do it.
>
> My understanding is that Jim's purpose is to release the bindings with
> the GNAT compiler for OSX.  That may be incompatible with your licensing
> model.
>
> > Top Graph'X Sales Manager





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  2003-02-07 16:50 ` Jean-Claude Mahieux
  2003-02-07 17:02   ` David Botton
  2003-02-07 17:06   ` Larry Kilgallen
@ 2003-02-08  0:21   ` jim hopper
  2003-02-10 10:06     ` Jean-Claude Mahieux
  2 siblings, 1 reply; 9+ messages in thread
From: jim hopper @ 2003-02-08  0:21 UTC (permalink / raw)


'
That would be my prefered approach but like larry said first i want to
release a set of open source bindings that work with os x version of
gnat.  if you are going to open source your source code that would be
super. Like david said i would be glad to support this by getting
things working on os x.

best jim


In article <b20nsg$mf5$1@news-reader11.wanadoo.fr>, Jean-Claude Mahieux
<jeanclaude.mahieux@topgraphx.com> wrote:

> 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
> 
>



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  2003-02-08  0:21   ` jim hopper
@ 2003-02-10 10:06     ` Jean-Claude Mahieux
  2003-02-11  0:12       ` jim hopper
  0 siblings, 1 reply; 9+ messages in thread
From: Jean-Claude Mahieux @ 2003-02-10 10:06 UTC (permalink / raw)


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

jim,

xinada runs on os X. Not because it is ported, but xinada shares part of the
ios with our OrbRiver (CORBA) product. And the orb is supported on os X
because we have customers using it. As the low level packages run fine with
the ORB, I do not expect any problem recompiling the rest of the library
with gnat.

Jean-Claude


"jim hopper" <hopperj@macconnect.com> a �crit dans le message de news:
070220031921421489%hopperj@macconnect.com...
> '
> That would be my prefered approach but like larry said first i want to
> release a set of open source bindings that work with os x version of
> gnat.  if you are going to open source your source code that would be
> super. Like david said i would be glad to support this by getting
> things working on os x.
>
> best jim
>
>
> In article <b20nsg$mf5$1@news-reader11.wanadoo.fr>, Jean-Claude Mahieux
> <jeanclaude.mahieux@topgraphx.com> wrote:
>
> > 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
> >
> >





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X11 binding with FSF version of gnat
  2003-02-10 10:06     ` Jean-Claude Mahieux
@ 2003-02-11  0:12       ` jim hopper
  0 siblings, 0 replies; 9+ messages in thread
From: jim hopper @ 2003-02-11  0:12 UTC (permalink / raw)



Hi,

thanks that sounds really cool and i will look forward to being able to
use it. 

Until then we did find the problem with x bindings with the fsf version
of gnat.  well perhaps not the reason but two patches that seem to
work.  two of us are still discussing which of our patches is the right
way ;-)

one solution changed the xevent system to use unchecked_union and the
other changed the sample programs using the bindings to type coerce the
various types of the xevent variant record to the proper variant before
trying to use it based upon the common type field.  both seem to work
fine on the examples and i am not sure which is the proper fix to
release.

jim

In article <b27t9k$21$1@news-reader10.wanadoo.fr>, Jean-Claude Mahieux
<jeanclaude.mahieux@topgraphx.com> wrote:

> jim,
> 
> xinada runs on os X. Not because it is ported, but xinada shares part of the
> ios with our OrbRiver (CORBA) product. And the orb is supported on os X
> because we have customers using it. As the low level packages run fine with
> the ORB, I do not expect any problem recompiling the rest of the library
> with gnat.
> 
> Jean-Claude
> 
> 
> "jim hopper" <hopperj@macconnect.com> a �crit dans le message de news:
> 070220031921421489%hopperj@macconnect.com...
> > '
> > That would be my prefered approach but like larry said first i want to
> > release a set of open source bindings that work with os x version of
> > gnat.  if you are going to open source your source code that would be
> > super. Like david said i would be glad to support this by getting
> > things working on os x.
> >
> > best jim
> >
> >
> > In article <b20nsg$mf5$1@news-reader11.wanadoo.fr>, Jean-Claude Mahieux
> > <jeanclaude.mahieux@topgraphx.com> wrote:
> >
> > > 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
> > >
> > >
> 
>



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-02-11  0:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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