[sldev] [VWR] Creating Linux viewer on GTK

Alissa Sabre alissa_sabre at yahoo.co.jp
Wed Oct 31 04:36:28 PDT 2007


Thank you for the comments.

> > - Use GtkGLExt (http://www.k-3d.org/gtkglext/Main_Page) to access
> >   OpenGL instead.
> 
> Hmmm, that page claims that gtkglext is unmaintained. But it also links
> to a Gnome bug that seems to have some recent activity.

GtkGLExt was first released around 2002, and has been used in various
projects.  The latest release was out on June 2006.  The primary
maintainer quitted on last winter.

There are still users of GtkGLExt for now.  The communitty is there.
It is looking for another person who can take the maintainance roll.

This is my understanding.

It works fine with the latest stable releases of GTK and the
development (next generation) versions now.  Nobody knows what happens
in a future, if it is being unmaintained.

> Is it really a
> good idea to avoid SDL entirely?

I don't know.  That's one of the reason I started this discussion.

There is another thing we need to know when discussing this issue.

The current SDL 1.2.12 is said to be the *last* release in 1.2
series.  The next SDL release will be 1.3.1.  1.3 series is not
planned to be binary/source compatible with 1.2 series.  So, if we
want well-maintained library, we need to rewrite the veiwer code for
SDL 1.3 in a near future.

# Yes, the difference between SDL 1.2 and 1.3 should be far smaller
  than that between SDL 1.2 and GtkGLExt, of course...

> How well do SDL and GTK interact? If

Poorly.

Current Linux viewer uses several _outrageous_ tricks to make SDL
window and (purely GTK based) mozilla browser core in one program.

> I'm understanding things, what you really need from GTK is the input
> layer, right?

Yes.  That's my motivation.  Clean pure-GTK something is a bonus, if
possible.

However, _input_ here is not just keyboard.  We need to take care of
more than key press/release events to use GTK immodule.  GTK immodule
is a dynamic loadable plug-in, and it can access to all
GTK/GDK/GOBJECT/... interfaces internally.  Some third-party immodule
takes mouse events, and some other tries to connect signals to
application widgets, for example.

I made several experiments, but I couldn't find a way to run SDL under
GTK event engine.  If you examine indra/llwindow/llwindowsdl.cpp, you
will find the current viewer has two event engines (GTK's and SDL's)
and pass control alternately.  GTK and SDL have their own Display (a
communication channel between X server), so GTK part and SDL part
appear as two separate programs to the X server.  What I need to do
(and what I can't do this moment) is let GTK envent engine handle all
events on SDL window.

I love to hear any idea how we can achieve this, as an alternative to
GtkGLExt.

> Hmmm, the thing I'd like to see is more code sharing between platforms.

I have no objection to the point in general, but

> SDL can do that.

I strongly object to the idea to use SDL on Windows or MacOS.  SDL's
input method (IME) support on WIndows is worse than on Linux/X11...  I
also don't like to use GTK on Windows or MacOS.  I'm in favor of the
current LL approach; defines a set of common interface that just
suitable for SL viewer, and uses native OS interfaces to implement it.

I think this is another issue that requires separate debates...
--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/



More information about the SLDev mailing list