comp.lang.ada
 help / color / mirror / Atom feed
From: bma3@dana.ucc.nau.edu (Ben Atkin)
Subject: Xlib Binding or Re-implementation?
Date: 16 Mar 2004 13:20:25 -0800
Date: 2004-03-16T13:20:25-08:00	[thread overview]
Message-ID: <985cbdf6.0403161320.7d1e090c@posting.google.com> (raw)

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!



             reply	other threads:[~2004-03-16 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 21:20 Ben Atkin [this message]
2004-03-17  9:46 ` Xlib Binding or Re-implementation? Preben Randhol
2004-03-17 23:11   ` Ben Atkin
2004-03-18  0:19     ` Ludovic Brenta
2004-03-20 22:48       ` Ben Atkin
2004-03-21  8:34         ` Preben Randhol
2004-03-18 10:00     ` Preben Randhol
2004-03-18 10:09       ` Peter Hermann
2004-03-18 20:36         ` Randy Brukardt
2004-03-31  7:36       ` David Starner
2004-03-17 10:34 ` Ludovic Brenta
replies disabled

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