Xlib Binding or Re-implementation?

From: Ben Atkin (bma3_at_dana.ucc.nau.edu)
Date: 03/16/04


Date: 16 Mar 2004 13:20:25 -0800

I beginning work on creating a text-editor in Xlib using Ada. The
reason I choose to use Xlib, rather than a toolkit, is because I want
to learn to build GUI toolkits because I don't like any of the current
options available in *nix. I also think that Ada has a lot of features
that would come in handy such as having both tagged and untagged
types, polymorphism, and type safety. Most importantly, Ada has
features that support good software engineering practices, which I
plan to use in the development of this program. A guiding principle
behind my project is that when software tries to be clever by doing
something that is what the user wanted 95% of the time, the other 5%
of the time, it only serves to frustrate the user, and makes it not
worth the benefit other 95% of the time. This means, that when you are
programming, the indentation behavior by default, with autoindenting
turned on is as such:

1. When you press enter, unless you are inside a function call, the
indentation is the same as the preceding line. Example (keys in angle
brackets, cursor is '.'):

    procedure Add_N (X : in out Integer, N : in Integer)<ENTER>
    .

2. When you press enter inside a function call, the indentation is
aligned with the first non-whitespace character beyond the last
opening parenthesis in the previous line. Example:

    procedure Add_N ( X : in out Integer,<ENTER>
                        .

This stops the maddening behavior of automatically jumping to the next
space when you want to write "begin" with the 'b' aligned with the 'p'
in procedure. Another thing I hate about other advanced text editors
is when it re-indents on the LINE YOU'RE TYPING ON. This is the way it
is in ObjectAda.

Well, anyway, now that I've introduced myself and my project to the
Ada community, on to the question:

First, do any of you know of any good, free Xlib bindings? I have run
into a lot of dead links.

Second, if I create my own, do you think it would be better to:

A. Write a thin binding to the C Xlib, using pragmas.

B. Write a thick binding to the C Xlib (don't know how I would go
about this).

C. Port Xlib.c, Xlib.h, etc. to Ada, using sockets. Then I could make
some changes that would make it more robust (the same things that the
freedesktop.org people are trying to do with
http://www.freedesktop.org/Software/xcb, but using Ada, which goes
really well with all of their suggestions).

I am thinking about doing it the part C way, but starting with it
working for my text editor. I don't fully understand the security
risks of it, so it may behoove me and the rest of the 'nix community
to keep work to myself and a private group of testers before releasing
it, unless the X server implementation is robust enough to handle
slightly garbled output.

I realize this could be a long project, but I am so dissatisfied with
GTK's approach that I think a new approach is needed. Besides, more
experimental projects are needed on the 'nix desktop. Copying is a
terrible way to develop software.

Thanks for any advice!



Relevant Pages

  • Re: For the AdaOS folks
    ... API that says create/delete an integer? ... >>as an Ada binding, I can do another registry query and get the ... libraries can strengthen the typing of the Ada interface. ...
    (comp.lang.ada)
  • Re: New Ada portable GUI Library?
    ... Do you mean a reimplementation of the OpenStep specification in Ada, ... or an Ada binding to GNUstep? ... AFAIK GNUStep uses only a small message based dynamically ... Objective-C++ are used. ...
    (comp.lang.ada)
  • Re: Thick vs. Thin bindings
    ... >As I continue to evaluate Ada in the role of a game dev language, ... Thin binding then you use only Integer type ... Thick binding you add more layer to the binding so that you can use ... but the binding returns an Ada boolean. ...
    (comp.lang.ada)
  • Re: New Ada portable GUI Library?
    ... Do you mean a reimplementation of the OpenStep specification in Ada, ... or an Ada binding to GNUstep? ... Objective-C++ are used. ... That's unlike Gtk or Qt where we have to write a ...
    (comp.lang.ada)
  • Re: Re-Marketing Ada (was "With and use")
    ... >> I have never had a problem with multi language projects. ... the effort should be to make Ada as capable as ... > to help you get a binding. ... the project management answer will be to ...
    (comp.lang.ada)