Re: Windows NT port of GTK+




"Jason M. Felice" <jasonf@baldwingroup.com> writes:

> Hello, I'm a new subscriber.
> 
> I'd like to port GTK+ to Windows 95/NT for a few reasons.
> 1) Promote mozilla to use GTK+ for it's GUI.
> Meaning:
>     a) Possible GNOME port of communicator?  Probably not, but I hope
> so.
>     b) Cross platform mozilla HTML viewing widget.  Cha-ching.
> 2) So I can write a freakin' GUI app and not worry about the hairy Linux
> -> Win32 or
> Win32 -> Linux port.
> 
> I realize there are other alternatives, (wxWidgets), but I'm very fond
> of GTK+.
> 
> If anyone has heard of a Win32 port, I'll go work on that.  If not, I'll
> start submitting patches, starting with glib, pausing to design battle
> plan for gdk, then porting gdk (yes, I realize this is a lot of work).
> 
> My plan is to use the exact same libgtk code, so that new widgets will
> automatically be cross-platform.  A quick skim of the code suggests this
> as possible.

If you aren't using a Windows X Server, probably not. Assuming
you don't care about native L&F (which to get, you'd probably
be better off writing a GTK+ compatible library topdown), a
lot of the drawing code will carry over - because the
primitives will be the same anywhere.

Event handling is quite different between MS-windows and X. You
might be able to translate the windows events into pseudo
X events though. (I think Tk does something like this.)

Things like cut and paste, and DND are not abstracted into
the GDK layer, so you'd pretty much have to write from scratch,
and might even have to change the GTK API's some. Quite 
a few other things visible to the user (Pixmaps, Colormaps,
Fonts) probably don't look much the same way in Windows.

I'd advise taking a very long and hard look at the way Tk, which made
the transition from Unix to cross-platform (and native Windows L&F)
did it. The breakdown of the Tk C code looks something like:
 
 Generic: 100,000 lines
 Unix: 30,000 lines
 Windows: 25,000 lines
 Macintosh: 30,000 lines

So it appears quite a bit of abstraction was managed:

For random comparison.

 glib: 8,000 lines
 gdk: 20,000 lines
 gtk: 90,000 lines
 
> libgdk may be almost a rewrite.  I'm prepared for this, though hoping it
> isn't so.

Since libgdk is pretty much pure X, unless you are using an
X server, it will be. But that seems only expected. In theory,
libgdk is the portability layer - stuff that is not expected
to be portable.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]