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

Re: [MiNT] porting



Hi,

On Tuesday 09 November 2010, Mark Duckworth wrote:
> On 11/9/10 5:28 AM, Peter Slegg wrote:
> > wrote: I thought you might mean that, I wasn't sure. Presumably the GTK
> > calls could be mapped to GEM through an extra layer.
>
> GTK is literally made to do this.  There is a layer called GDK.  You
> make a new backend which has mapping functions for windows, graphics
> primitives, etc.

Although Gtk & Gdk are ported to Windows, OSX and plain framebuffer, GDK is
modeled after how X11 works (as it was initially written for X).  For
example text widgets handle focus by using a sub window.  I'm not sure
whether that would be an issue for GEM port.


Another thing is whether Gtk v1 or v2 should be ported.

Gtk v1 is unsupported & dead.  AFAIK no programs that are still maintained
support it.

Gtk v2 is much heavier than Gtk v1both memory and performance-wise because
it uses double buffering (to avoid flicker on bg-clear & re-drawing of stuff
on top of that), does drawing as antialiased (using Cairo) and due to it
using freetype & fontconfig.  Additionally it does a huge amount of dynamic
allocations, it seems that whenever it internally passes strings, they're
strdup()ed, but this may be an issue with v1 too...

Gtk v3 comes soon, but shouldn't have radical changes. I think the already
planned v4 will start using OpenGL.


Although quite a lot of programs are done with Gtk, I think some more
lightweight toolkit might be more appropriate, e.g. something that's
designed to be statically linked to the binaries.  For example Fltk used by
Dillo browser:
	http://en.wikipedia.org/wiki/FLTK


Here's a large list of other potential toolkits:
	http://en.wikipedia.org/wiki/List_of_widget_toolkits


	- Eero