xg.c is probably not what you want to change. I looked at http://directfb.org/wiki/index.php/Projects:GTK_on_DirectFB and it looks like you need only fix some includes and the loader/compiler flags in the makefile. If I can find time (probably not today), I'll look into it.