Mobile/DFBPorting: Difference between revisions

m (→‎Bugs: note all fixed, suggest search for [dfb])
 
(49 intermediate revisions by 8 users not shown)
Line 1: Line 1:
== Porting Goals ==
== Porting Goals ==


* Firefox running with full functionality (including SVG) on DirectFB based platforms
* Firefox running with full functionality (including SVG) on '''DirectFB''' ([http://www.directfb.org/ web site], [http://en.wikipedia.org/wiki/DirectFB Wikipedia]) -based platforms
* Use GDK as much as possible so that the backend (X, DFB etc) dependencies are abstracted out
* Use GDK as much as possible so that the backend (X, DFB etc) dependencies are abstracted out
* Use DirectFB calls only if absolutely necessary  
* Use DirectFB calls only if absolutely necessary  
** Functionality not mappable to GDK  
** Functionality not mappable to GDK  
** Any other compelling reasons related to performance
** Any other compelling reasons related to performance


== Porting Items ==
== Porting Items ==
Line 105: Line 104:
* [https://bugzilla.mozilla.org/show_bug.cgi?id=357946 bugzilla patch]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=357946 bugzilla patch]


== DirectFB Build and Test Environment setup - Using script ==
== GTK-DFB Package Installation ==


Note: This setup has been tested on Fedora Core 8.
=== Using script ===


=== Installing gtk-dfb packages ===
Note: This has been tested on Fedora Core 8 and a Mandrake 9.1.


* Download and unpack install_gtk.zip [http://wiki.mozilla.org/images/5/57/Install_gtk.zip]
* Download and unpack [https://wiki.mozilla.org/images/7/77/Install-gtk-cross-20081106.tar.zip Install-gtk-cross-20081106.tar.zip] ( or this previous version [https://wiki.mozilla.org/images/a/a5/Install_gtk_101708.zip Install_gtk_101708.zip] ''doesn't support --html option and not optimized to cross compilation'')
* Download and unpack platform_patches.zip [http://wiki.mozilla.org/images/e/e2/Platform_patches.zip]
* Edit your ''install.sh'' or  ''install-cross.sh'' to adjust parameters to your needs. You can use the ''--html'' option to check what will be executed by the script before installation.
* Try ''install_gtk.py --help'' for usage instructions
* When you are ready, suppress the ''--html'' option in ''install.sh'' then run it, that downloads all source packages and patchs, applies cairo and gtk patches, builds and installs. If you want to change parametrers, try ''install_gtk.py --help'' for usage instructions then modify ''install.sh''
* Run install_gtk.py that downloads all source packages, applies cairo and gtk patches, builds and installs
* Copy this [http://wiki.mozilla.org/Mobile/DFBPorting/directfbrc .directfbrc] to ~/.directfbrc then edit it to ajust parameters to your needs
* Copy this .directfbrc [http://wiki.mozilla.org/Mobile/DFBPorting/directfbrc] to ~/.directfbrc


Note: Installation might fail if the packages are not available from the download link mentioned in config.py.


== DirectFB Build and Test Environment setup - Manually ==
=== Manual Installation ===
=== Prepare installation directory ===


We are going to install under /usr/local/dfb to avoid confusion when X and DFB apps are running simultaneously.
We are going to install under /usr/local/dfb to avoid confusion when X and DFB apps are running simultaneously.
Line 144: Line 142:
* export CPPFLAGS=-I/usr/local/dfb/include
* export CPPFLAGS=-I/usr/local/dfb/include
* export LDFLAGS=-L/usr/local/dfb/lib
* export LDFLAGS=-L/usr/local/dfb/lib
=== GTK-DFB package installation ===


==== jpeg ====
==== jpeg ====
Line 152: Line 148:
* '''Download URL: '''ftp://ftp.gtk.org/pub/gtk/v2.10/dependencies/jpegsrc.v6b.tar.gz
* '''Download URL: '''ftp://ftp.gtk.org/pub/gtk/v2.10/dependencies/jpegsrc.v6b.tar.gz
* '''Installation:'''
* '''Installation:'''
** tar -xzvf jpegsrc.v6b.tar.gz
** tar xzvf jpegsrc.v6b.tar.gz
** cd jpeg-6b
** cd jpeg-6b
** ./configure --prefix=/usr/local/dfb --without-x --enable-shared --without-libjasper
** ./configure --prefix=/usr/local/dfb --without-x --enable-shared --without-libjasper
Line 168: Line 164:
** make
** make
** make install  
** make install  
==== zlib ====
* '''Package Name: ''' zlib-1.2.3.tar.gz
* '''Download URL: ''' http://internap.dl.sourceforge.net/sourceforge/libpng/zlib-1.2.3.tar.gz
* '''Installation: '''
** tar zxvf zlib-1.2.3.tar.gz
** cd zlib-1.2.3
** ./configure --prefix=/usr/local/dfb
** make
** make install


==== libpng ====
==== libpng ====


* '''Package Name: ''' libpng-1.2.29.tar.bz2  
* '''Package Name: ''' libpng-1.2.34.tar.bz2  
* '''Download URL: ''' http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.29.tar.bz2
* '''Download URL: ''' http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.34.tar.bz2
* '''Installation: '''  
* '''Installation: '''  
** tar jxvf libpng-1.2.29.tar.bz2
** tar jxvf libpng-1.2.34.tar.bz2
** cd libpng-1.2.29
** cd libpng-1.2.34
** cp ./scripts/makefile.linux  ./Makefile
** Change “prefix=/usr/local” to “prefix=/usr/local/dfb” (line no 31) in Makefile manually
** make  
** make  
** make install
** make install
Line 189: Line 194:
** cd pkg-config-0.22
** cd pkg-config-0.22
** ./configure --prefix=/usr/local/dfb --without-x
** ./configure --prefix=/usr/local/dfb --without-x
** make
** make install
==== glib ====
* '''Package Name: ''' glib-2.16.3.tar.bz2
* '''Download URL: ''' http://ftp.gnome.org/pub/gnome/sources/glib/2.16/glib-2.16.3.tar.bz2
* '''Installation: '''
** tar jxvf glib-2.16.3.tar.bz2
** cd glib-2.16.3
** ./configure --prefix=/usr/local/dfb
** make
** make
** make install  
** make install  
Line 206: Line 200:


* '''Package Name: ''' gettext-0.17.tar.gz
* '''Package Name: ''' gettext-0.17.tar.gz
* '''Download URL: ''' http://ftp.gnu.org/gnu/gettext/
* '''Download URL: ''' http://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz
* '''Installation:'''
* '''Installation:'''
** tar zxvf gettext-0.17.tar.gz
** tar zxvf gettext-0.17.tar.gz
Line 215: Line 209:


Note: This package might not be required.
Note: This package might not be required.
==== glib ====
* '''Package Name: ''' glib-2.16.3.tar.bz2
* '''Download URL: ''' http://ftp.gnome.org/pub/gnome/sources/glib/2.16/glib-2.16.3.tar.bz2
* '''Installation: '''
** tar jxvf glib-2.16.3.tar.bz2
** cd glib-2.16.3
** ./configure --prefix=/usr/local/dfb
** make
** make install


==== atk ====
==== atk ====
Line 240: Line 245:
==== DirectFB ====
==== DirectFB ====


* '''Package Name: ''' DirectFB-1.1.1.tar.gz
* '''Package Name: ''' DirectFB-1.2.0.tar.gz
* '''Download URL: ''' http://www.directfb.org/downloads/Core/DirectFB-1.1.1.tar.gz
* '''Download URL: ''' http://www.directfb.org/downloads/Old/DirectFB-1.2.0.tar.gz
* '''Installation: '''
* '''Installation: '''
** apt-get install libsdl1.2-dev
** apt-get install libsdl1.2-dev
** tar zxvf DirectFB-1.1.1.tar.gz
** tar zxvf DirectFB-1.2.0.tar.gz
** cd DirectFB-1.1.1
** cd DirectFB-1.2.0
** ./configure --prefix=/usr/local/dfb --enable-x11=no --enable-sdl
** ./configure --prefix=/usr/local/dfb --enable-sdl
** make
** make
** make install
** make install
Line 260: Line 265:
* As root user, run the following command
* As root user, run the following command
** touch /usr/local/dfb/lib/libgdk-x11-2.0.so.0
** touch /usr/local/dfb/lib/libgdk-x11-2.0.so.0
==== libexpat ====
* '''Package Name: ''' expat-2.0.1.tar.gz
* '''Download URL: ''' http://internap.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
* '''Installation: '''
** tar zxvf expat-2.0.1.tar.gz
** cd expat-2.0.1
** ./configure --prefix=/usr/local/dfb
** make
** make install


==== fontconfig ====
==== fontconfig ====
Line 266: Line 282:
* '''Download URL: ''' http://www.fontconfig.org/release/fontconfig-2.4.91.tar.gz
* '''Download URL: ''' http://www.fontconfig.org/release/fontconfig-2.4.91.tar.gz
* '''Installation:'''
* '''Installation:'''
** tar fontconfig-2.4.91.tar.gz
** tar zxvf fontconfig-2.4.91.tar.gz
** cd fontconfig-2.4.91
** cd fontconfig-2.4.91
** ./configure --prefix=/usr/local/dfb --without-x --enable-directfb --disable-xlib --disable-win32
** ./configure --prefix=/usr/local/dfb --without-x --enable-directfb --disable-xlib --disable-win32
** make
** make
** make install  
** make install


==== pixman ====
==== pixman ====


* '''Package Name: ''' pixman-0.10.0.tar.gz
* '''Package Name: ''' pixman-0.12.0.tar.gz
* '''Download URL: ''' http://www.cairographics.org/releases/pixman-0.10.0.tar.gz
* '''Download URL: ''' http://www.cairographics.org/releases/pixman-0.12.0.tar.gz
* '''Installation: '''
* '''Installation: '''
** tar -zxvf pixman-0.10.0.tar.gz
** tar zxvf pixman-0.12.0.tar.gz
** cd pixman-0.10.0
** cd pixman-0.12.0
** ./configure --prefix=/usr/local/dfb  
** ./configure --prefix=/usr/local/dfb  
** make
** make
** make install  
** make install
 


==== cairo ====
==== cairo ====
Line 289: Line 304:
* '''Download URL: ''' http://www.cairographics.org/releases/cairo-1.6.4.tar.gz
* '''Download URL: ''' http://www.cairographics.org/releases/cairo-1.6.4.tar.gz
* '''Patches: ''' Download following patches and apply to the source.
* '''Patches: ''' Download following patches and apply to the source.
** 001-cairo_dfb-run-clipped-function.patch [http://wiki.mozilla.org/images/2/2a/001-cairo_dfb-run-clipped-function.zip]
** [http://wiki.mozilla.org/images/2/2a/001-cairo_dfb-run-clipped-function.zip 001-cairo_dfb-run-clipped-function.patch]
** 002-cairo_dfb-dest-image-clip.patch [http://wiki.mozilla.org/images/a/aa/002-cairo_dfb-dest-image-clip.zip]
** [http://wiki.mozilla.org/images/a/aa/002-cairo_dfb-dest-image-clip.zip 002-cairo_dfb-dest-image-clip.patch]
** [http://wiki.mozilla.org/images/5/5d/003-cairo_dfb-zero-box-clip-fix.zip 003-cairo_dfb-zero-box-clip-fix.patch]
** [http://wiki.mozilla.org/images/e/e4/004-cairo-blit-optimization.patch.zip 004-cairo-blit-optimization.patch]
** [http://wiki.mozilla.org/images/3/3c/005-cairo-font-crash-fix.patch.zip 005-cairo-font-crash-fix.patch]
* '''Installation: '''
* '''Installation: '''
** tar -zxvf cairo-1.6.4.tar.gz
** tar zxvf cairo-1.6.4.tar.gz
** cd cairo-1.6.4
** cd cairo-1.6.4
** ./configure --prefix=/usr/local/dfb --enable-directfb=yes --enable-xlib=no --enable-xlib-xrender=no --enable-xcb=no --without-x --disable-win32
** ./configure --prefix=/usr/local/dfb --enable-directfb=yes --enable-xlib=no --enable-xlib-xrender=no --enable-xcb=no --without-x --disable-win32
Line 313: Line 331:
* '''Package Name: ''' gtk+-2.12.9.tar.bz2
* '''Package Name: ''' gtk+-2.12.9.tar.bz2
* '''Download URL: ''' http://ftp.gnome.org/pub/gnome/sources/gtk+/2.12/gtk+-2.12.9.tar.bz2
* '''Download URL: ''' http://ftp.gnome.org/pub/gnome/sources/gtk+/2.12/gtk+-2.12.9.tar.bz2
* '''Patches: ''' Download the following patch and apply to the source.
** [http://wiki.mozilla.org/images/c/c4/001-gtk%2B-2.12.9-dok4.zip 001-gtk+-2.12.9-dok4.patch]
** [http://wiki.mozilla.org/images/3/3e/002-gtk%2B-2.12.9-gdkkeys_fix.zip 002-gtk+-2.12.9-gdkkeys_fix.patch]
** [http://wiki.mozilla.org/images/2/2b/003-gtk%2B-2.12.9-dok-scroll-experimental.patch.zip  003-gtk+-2.12.9-dok-scroll-experimental.patch]
** [http://wiki.mozilla.org/images/c/cb/004-gtk%2B-2.12.9-dok-visual-fix.patch.zip  004-gtk+-2.12.9-dok-visual-fix.patch]
** [http://wiki.mozilla.org/images/a/ac/005-gtk%2B-2.12.9-dok-event-block-fix.patch.zip 005-gtk+-2.12.9-dok-event-block-fix.patch]
** [http://wiki.mozilla.org/images/c/c0/006-gtk%2B-2.12.9-dok-set-default-display-fix.patch.zip 006-gtk+-2.12.9-dok-set-default-display-fix.patch]
** [http://wiki.mozilla.org/images/4/40/007-gtk%2B-2.12.9-dok-set-focus-fixes.patch.zip 007-gtk+-2.12.9-dok-set-focus-fixes.patch]
* '''Installation: '''
* '''Installation: '''
** tar jxvf gtk+-2.12.9.tar.bz2
** tar jxvf gtk+-2.12.9.tar.bz2
** gtk+-2.12.9
** cd gtk+-2.12.9
** ./configure --prefix=/usr/local/dfb --with-gdktarget=directfb --without-x
** ./configure --prefix=/usr/local/dfb --with-gdktarget=directfb --without-x
**  make  
**  make  
Line 333: Line 359:
** make install
** make install


==== libexpat ====
=== Test ===
 
* '''Package Name: ''' expat-2.0.1.tar.gz
* '''Download URL: ''' http://expat.sourceforge.net/
* '''Installation: '''
** tar zxvf expat-2.0.1.tar.gz
** cd expat-2.0.1
** ./configure --prefix=/usr/local/dfb
** make
** make install
 
=== Building and testing GTK-DirectFB applications ===


* Setup pkg-config and library paths
* Existing examples
** export LD_LIBRARY_PATH=/usr/local/dfb/lib
** Try running test applications under gtk+-2.12.9/tests directory
** export PKG_CONFIG_PATH=/usr/local/dfb/lib/pkgconfig
* New Examples
* Write a “Hello world” GTK application: hell_world.c and compile it
** Setup pkg-config and library paths
** gcc `pkg-config --cflags --libs gtk+-2.0` hello_world.c –o hello_world
*** export LD_LIBRARY_PATH=/usr/local/dfb/lib
* Run hello_world
*** export PKG_CONFIG_PATH=/usr/local/dfb/lib/pkgconfig
** A DirectFB window with hello_world widget inside should pop-up
** Write a “Hello world” GTK application: hello_world.c and compile it
*** gcc `pkg-config --cflags --libs gtk+-2.0` hello_world.c –o hello_world
** Run hello_world
*** A DirectFB window with hello_world widget inside should pop-up


== Building and testing Firefox-DirectFB ==
== Building and testing Firefox-DFB ==


=== Getting mozilla-dfb sources from hg ===
=== Getting mozilla-dfb sources from hg ===
Line 360: Line 378:
* ''hg clone http://hg.mozilla.org/users/pavlov_mozilla.com/mozilla-dfb mozilla-dfb-src''
* ''hg clone http://hg.mozilla.org/users/pavlov_mozilla.com/mozilla-dfb mozilla-dfb-src''
* ''cd mozilla-dfb-src''
* ''cd mozilla-dfb-src''
* ''python client.py --cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot --skip-tamarin checkout''
* ''python client.py --skip-tamarin checkout
* (on Mac OS X 10.4, perhaps) ''python client.py --cvs ocvs --skip-tamarin checkout


=== Build mozilla-dfb ===
=== Build mozilla-dfb ===


* Copy this .mozconfig [http://wiki.mozilla.org/Mobile/DFBPorting/mozconfig] to mozilla-dfb-src/.mozconfig
* Copy this [http://wiki.mozilla.org/Mobile/DFBPorting/mozconfig .mozconfig] to mozilla-dfb-src/.mozconfig
* set LD_LIBRARY_PATH and PKG_CONFIG_PATH to installed gtk-dfb packages
* set LD_LIBRARY_PATH and PKG_CONFIG_PATH to installed gtk-dfb packages
* ''make -f client.mk build'' in the mozilla-dfb-src directory
* ''make -f client.mk build'' in the mozilla-dfb-src directory
=== Issues ===


== Bugs ==
== Bugs ==
A good bug search term is <tt>[https://bugzilla.mozilla.org/buglist.cgi?quicksearch=%5Bdfb%5D &#x5B;dfb&#x5D;]</tt>.
As of November 2010, all these bugs were marked fixed in 2008 or 2009.
* Port Mozilla to Gtk-DirectFB : {{bug|422221}}
* Some parts of content area not painted when scrolled : {{bug|435471}}
* Toolbar icons disappear randomly when other toolbar buttons are clicked : {{bug|435492}}
* Entire browser flickers when mouse is hovered over a toolbar menu popup : {{bug|435494}}
* Menu items are not selectable using mouse in toolbar menu popup : {{bug|435499}}


* Port Mozilla to Gtk-DirectFB : bug 422221 [https://bugzilla.mozilla.org/show_bug.cgi?id=422221]
== Comments ==
* Some parts of content area not painted when scrolled : bug 435471 [https://bugzilla.mozilla.org/show_bug.cgi?id=435471]
A "how to report a bug" section is needed.
* Toolbar icons disappear randomly when other toolbar buttons are clicked : bug 435492 [https://bugzilla.mozilla.org/show_bug.cgi?id=435492]
* Entire browser flickers when mouse is hovered over a toolbar menu popup : bug 435494 [https://bugzilla.mozilla.org/show_bug.cgi?id=435494]
* Menu items are not selectable using mouse in toolbar menu popup : bug 435499 [https://bugzilla.mozilla.org/show_bug.cgi?id=435499]

Latest revision as of 22:38, 7 November 2010

Porting Goals

  • Firefox running with full functionality (including SVG) on DirectFB (web site, Wikipedia) -based platforms
  • Use GDK as much as possible so that the backend (X, DFB etc) dependencies are abstracted out
  • Use DirectFB calls only if absolutely necessary
    • Functionality not mappable to GDK
    • Any other compelling reasons related to performance

Porting Items

Native Surface Creation

Current State

cairo_xlib_* functions are used for creating surfaces on X. These cairo_xlib_* funtions are implemented in cairo and are specific to X backend.

Related files
  • gfx/thebes/public/gfxXlibSurface.h
  • gfx/thebes/public/gfxXlibSurface.cpp
  • All callers of gfxXlibSurface
    • widget/src/gtk2/nsWindow.cpp
    • gfx/thebes/src/gfxPlatformGtk.cpp
    • gfx/thebes/src/gfxASurface.cpp
    • layout/generic/nsObjectFrame.cpp


Proposed Porting Approach

  • Clone gfxXlibSurface to gfxGdkCairoSurface
  • Callers of gfxXlibSurface will now call gfxGdkCairoSurface.
  • gfxGdkCairoSurface implementation calls Xlib specific functions under MOZ_X11 switch and calls DirectFB specific functions under MOZ_DFB switch.
  • This approach will abstract out all backend specific functions and move them to a single place
  • Users of gfxXlibSurface to create cairo surface for a GdkWindow will simply call gfxGdkCairoSurface with GdkDrawable
  • Users of gfxXlibSurface to create cairo surface for an offscreen buffer (pixmap) will undergo some changes:
    • A gdk pixmap of required depth will be created and corresponding GdkDrawable will be passed to gfxGdkCairoSurface for creating cairo surface
    • All other x11 dependent code (checking for xrender extension etc) will be removed as gfxGdkCairoSurface will take care of all required functionality .
  • The actual cairo-xlib surface creation will use GdkDrawable's depth to call correct cairo_xlib functions:
    • cairo_xlib_surface_create() will be called if the GdkDrawable has non-NULL visual
    • else: cairo_xlib_surface_create_for_bitmap() will be called if the depth is 1
    • else : cairo_xlib_surface_create_with_xrender_format() will be called
  • The actual cairo-dfb surface creation will use type of GdkDrawable (Window or pixmap) to call correct cairo-dfb functions
    • cairo_directfb_surface_create() will be called with the DFB Surface returned from gdk_directfb_surface_lookup (), if the GdkDrawable is a Window
    • cairo_directfb_surface_create() will be called with a newly created DFB Surface. The new DFB Surface will be created using CreateSurface() with the GdkDrawable's depth mapped to DFB pixel format.

NativeRenderer

Current State

NativeRenderer's Draw function is called for drawing a GTK widget composited with cairo state. NativeRenderer calls cairo_draw_with_xlib that has lot of dependencies on cairo_xlib*. cairo_draw_with_xlib does all the fancy stuff (complex transforms) and finally calls NativeDraw with the Drawable associated with the cairo surface. cairo_xlib provides API to obtain Drawable associated with a given Cairo surface.

According to Vlad (on irc), cairo_draw_with_xlib is really there for supporting complex transforms (rotation, affine-transformations etc) that gfx natively doesn't support but depends on cairo. Effect of disabling cairo_draw_with_xlib is that the SVG and Canvas will not work; but native theming will work fine.


Related files
  • gfx/thebes/public/gfxXlibNativeRenderer.h
  • gfx/thebes/src/gfxXlibNativeRenderer.cpp
  • All callers of gfxXlibNativeRenderer
    • widget/src/gtk2/nsNativeThemeGTK.cpp
    • layout/generic/nsObjectFrame.cpp

Proposed Porting Approach

  • gfxXlibNativeRenderer will be cloned to gfxGdkNativeRenderer
    • GdkDrawable will replace (Display, Visual, Drawable) touple
  • All the users of gfxXlibNativeRenderer will use gfxGdkNativeRenderer
  • Getting GdkDrawable from cairo surface
    • A new static const field will be added to gfxASurface class
      • static const cairo_user_data_key_t backendRenderingContext;
    • During the surface creation time, gfxGdkCairoSurface.cpp will store the GdkDrawable as user data in cairo surface
      • SetData (&gfxASurface::backendRenderingContext, (void *) mDrawable, nsnull);
    • Draw function in gfxGdknativeRenderer.cpp will obtain the GdkDrawable by calling GetData() function
      • (GdkDrawable *) ctx->OriginalSurface()->GetData(&gfxASurface::backendRenderingContext);
  • cairo-xlib-utils.c and cairo-xlib-utils.h will be taken out from the build
  • cairo_draw_with_xlib call in Draw function inside gfxGdkNativeRenderer.cpp will be replaced with the following code snippet.
   double device_offset_x, device_offset_y;
   short offset_x = 0, offset_y = 0;
   cairo_surface_t * target = cairo_get_target (cr);
   cairo_matrix_t matrix;
   cairo_surface_get_device_offset (target, &device_offset_x, &device_offset_y);
   cairo_get_matrix (cr, &matrix);
   _convert_coord_to_short (matrix.x0 + device_offset_x, &offset_x);
   _convert_coord_to_short (matrix.y0 + device_offset_y, &offset_y);
   cairo_surface_flush (target);
   NativeDraw ((GdkDrawable *) ctx->OriginalSurface()->GetData(&gfxASurface::backendRenderingContext),
           offset_x, offset_y, NULL, 0);
   cairo_surface_mark_dirty (target);

TODO

In the current proposal we are ignoring cairo_draw_with_xlib; i.e., it will be disabled in the beginning phases of the porting. After the basic functionality is working on DFB, then we will work on this. Meanwhile, any input to port cairo_draw_with_xlib to GDK will be greatly appreciated.

Previous Work

GTK-DFB Package Installation

Using script

Note: This has been tested on Fedora Core 8 and a Mandrake 9.1.

  • Download and unpack Install-gtk-cross-20081106.tar.zip ( or this previous version Install_gtk_101708.zip doesn't support --html option and not optimized to cross compilation)
  • Edit your install.sh or install-cross.sh to adjust parameters to your needs. You can use the --html option to check what will be executed by the script before installation.
  • When you are ready, suppress the --html option in install.sh then run it, that downloads all source packages and patchs, applies cairo and gtk patches, builds and installs. If you want to change parametrers, try install_gtk.py --help for usage instructions then modify install.sh
  • Copy this .directfbrc to ~/.directfbrc then edit it to ajust parameters to your needs

Note: Installation might fail if the packages are not available from the download link mentioned in config.py.

Manual Installation

We are going to install under /usr/local/dfb to avoid confusion when X and DFB apps are running simultaneously.

Create installation directories under /usr/local/dfb:

  • mkdir /usr/local/dfb
  • mkdir -p /usr/local/dfb/man/man1
  • mkdir /usr/local/dfb/bin
  • mkdir /usr/local/dfb/lib
  • mkdir /usr/local/dfb/etc
  • mkdir /usr/local/dfb/include
  • mkdir /usr/local/dfb/info
  • mkdir /usr/local/dfb/sbin
  • mkdir /usr/local/dfb/share
  • mkdir /usr/local/dfb/src

Set the following environment variables in the build terminal

  • export LD_LIBRARY_PATH=/usr/local/dfb/lib
  • export PATH=/usr/local/dfb/bin/:$PATH
  • export PKG_CONFIG=/usr/local/dfb/bin/pkg-config
  • export PKG_CONFIG_PATH=/usr/local/dfb/lib/pkgconfig
  • export CPPFLAGS=-I/usr/local/dfb/include
  • export LDFLAGS=-L/usr/local/dfb/lib

jpeg

tiff

zlib

libpng

pkg-config

gettext

Note: This package might not be required.

glib

atk

freetype

DirectFB

After installing DirectFB, set it up to run over SDL on X11.

  • Create .directfbrc under home directory.
  • Add following lines to .directfbrc
    • wm=default
    • mode=800x600
    • depth=32
    • system=sdl
  • As root user, run the following command
    • touch /usr/local/dfb/lib/libgdk-x11-2.0.so.0

libexpat

fontconfig

  • Package Name: fontconfig-2.4.91.tar.gz
  • Download URL: http://www.fontconfig.org/release/fontconfig-2.4.91.tar.gz
  • Installation:
    • tar zxvf fontconfig-2.4.91.tar.gz
    • cd fontconfig-2.4.91
    • ./configure --prefix=/usr/local/dfb --without-x --enable-directfb --disable-xlib --disable-win32
    • make
    • make install

pixman

cairo

pango

gtk

libIDL

Test

  • Existing examples
    • Try running test applications under gtk+-2.12.9/tests directory
  • New Examples
    • Setup pkg-config and library paths
      • export LD_LIBRARY_PATH=/usr/local/dfb/lib
      • export PKG_CONFIG_PATH=/usr/local/dfb/lib/pkgconfig
    • Write a “Hello world” GTK application: hello_world.c and compile it
      • gcc `pkg-config --cflags --libs gtk+-2.0` hello_world.c –o hello_world
    • Run hello_world
      • A DirectFB window with hello_world widget inside should pop-up

Building and testing Firefox-DFB

Getting mozilla-dfb sources from hg

Build mozilla-dfb

  • Copy this .mozconfig to mozilla-dfb-src/.mozconfig
  • set LD_LIBRARY_PATH and PKG_CONFIG_PATH to installed gtk-dfb packages
  • make -f client.mk build in the mozilla-dfb-src directory

Issues

Bugs

A good bug search term is [dfb].

As of November 2010, all these bugs were marked fixed in 2008 or 2009.

  • Port Mozilla to Gtk-DirectFB : bug 422221
  • Some parts of content area not painted when scrolled : bug 435471
  • Toolbar icons disappear randomly when other toolbar buttons are clicked : bug 435492
  • Entire browser flickers when mouse is hovered over a toolbar menu popup : bug 435494
  • Menu items are not selectable using mouse in toolbar menu popup : bug 435499

Comments

A "how to report a bug" section is needed.