Re: GTK+ Portability



Havoc Pennington wrote:

Brad House <brad mainstreetsoftworks com> writes:
I've written many applications that utilize GTK+ and
libglade.  I must say, it is by far the best experience
I've had writing a GUI for any environment.  I've
recently tackled writing a MAC OS X Carbon application
and find it very time-consuming.  I was wondering
if anyone knew of an *active* port of GTK+ to Carbon
and/or Cocoa for OS X.  This would definately help
porting of many software applications from
Linux/Unix to OS X.


There is no active port AFAIK. Maybe a couple people have expressed
interest, but no one has displayed commitment/ability. ;-) At least,
if they have they haven't contacted the list about including it in the
GTK package.



Yeah, I think most started, then dropped it, especially because
of the poor condition of libtool,etc on OS X...



Anyhow, if not, what would be required in doing so?
Would it ONLY be GDK that would have to be modified
for base functionality?


You will probably need to do some minor fixing to GLib for
portability glitches on OS X, and you'll need to figure out a font
backend for Pango (current ones are pangox, pangoxft, pangoft2).
Then you have to hack GDK, yes.


What exactly does Glib do? Not really familiar with it's workings...
Also, I was thinking of starting with 1.2 series of GTK ...  it's
currently what I'm most familiar with, and don't want to get into
the whole PANGO thing right yet (I don't think it will be terribly
hard to port to 1.3.x (2.0) in the future)



If you want to go the extra mile, you can extend the theme system on
the GTK+ (widget) level to be sure a good OS X emulation theme can be
written. That would be a project for once the GDK port is finished.



Yeah, small steps for now, that is if I decide it's worth tackling this.
The only reason I'm considering it is that I've got to port a GTK
application over to OS X, and I was thinking it would probably be
just as hard to port GTK itself over... So what the heck, but I'll
have to get my hands a little bit dirty to make that decision.



Also, what would be a good starting point? Another port project such
as DirectFB or Win32, or the straight code-base?


The DirectFB or Linux-fb ports are probably most straightforward,
since they aren't having to fight the semantics of an existing window
system.


ok, cool, I'll start with one of them....



The "backend interface" for GDK is sort of poorly-defined, so it's
hard to see easily exactly what you have to implement to write a new
backend; if you wanted to clean that up a bit and document it as you
go, you'd be a hero. ;-) But not expected. (Ideally there would just
be a big struct full of function pointers, and a backend would
implement all those functions, or something like that. And of course
ideally the required semantics of each function would be
documented...)

The X backend is the "master backend" that determines what the
semantics of functions should be. So knowing something about X would
help you.


Heh, don't know much about X ... figured if I started with a port
of GTK, I wouldn't need to know that stuff ;)  Truthfully, I'll
be happy if I can get a window to popup with the correct title-bar.


-----------------------------
Brad House
Sr. Developer
Main Street Softworks, Inc.

brad mainstreetsoftworks com
(352) 378-8228
-----------------------------




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