[Mono-dev] idea summary: Swing in Mono?...
BGB
cr88192 at hotmail.com
Sun Feb 8 00:23:08 EST 2009
----- Original Message -----
From: "Jerry Maine" <crashfourit at gmail.com>
To: <mono-devel-list at lists.ximian.com>
Sent: Sunday, February 08, 2009 2:29 PM
Subject: Re: [Mono-dev] idea summary: Swing in Mono?...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Well, I have seen SWT and opengl work together. It is possible. And
> SWT uses native widgets to do its bidding.
>
interesting...
so, you can put buttons on 3D rendered surfaces?...
> In addition with P/Invoke and the ability call api on mono/.net to
> find the underlying system, the new .net gui library can load the
> needed drivers on demand giving the ability to keep it as one unified
> library that one can move with the application. Makes a better
> solution than SWT in java, no?
>
I was digging around in GNU ClassPath's implementation of Swing and AWT, and
am a little less confident...
it looks like a bit of a tangled mess, and it looks like it is typically
built to direct its output to a built-in backend (apparently x-peer,
gtk-peer, or qt-peer, ...). it looks like all of this is intended to be
controlled by the central configure script, for which I am unable to get to
work...
my idea would likely require a custom implementation, such as:
there is a special Canvas object, which is a pure interface implementing a
subject of OpenGL (maybe a subset of OpenGL 1.0 or 1.1, plus any extensions
for handling getting input backto the framework).
interface BaseGL {
...
const GL_TEXTURE_2D ...
...
...
void glBegin(int tag);
...
void glEnd();
...
void glVertex2f(float x, y);
...
void glTexCoord2f(float s, t);
...
}
interface BaseInput {
...
void submitKeys(char[] keys);
void submitMouse(float x, float y, int state);
void update();
void draw();
...
}
class BaseSurface {
...
BaseGL gl;
BaseInput client;
}
so, the GUI API draws via an object implementing BaseGL, and provides an
object implementing BaseInput, and BaseSurface is used to coordinate them...
on top of this, a GUI is built, and in the frontend implements an interface
resembling SWT or Swing...
or, apparently, it may be partly required to rework GNU's implementation to
be closer to that of Sun's, in particular, actually doing the rendering by
sending output to a Canvas, ... rather than offloading/sharing most of the
machinery with AWK...
although, it looks like there is an OpenGL backend in ClassPath, so it may
be possible to strip most of the rest (GTK, QT, ...) out and just use this
as the starting point...
but, I guess the first step would be getting the thing to build (proving to
be a bit of a problem, as the ClassPath source uses generics and both GCJ
and CSCC are refusing to accept generics...).
or such...
More information about the Mono-devel-list
mailing list