1 README for GDK-DirectFB
2 ------------------------
4 This is a developers snapshot of a GDK backend based on DirectFB.
5 It requires GTK+ version 2.0 (see http://www.gtk.org/) and DirectFB
6 (see http://www.directfb.org/).
9 The current code does not pass through directfb passed on the gtk
10 apps command line on to directfb you need to set the environment variable
13 export DFBARGS=system=sdl
18 DirectFB is a hardware abstraction layer on top of the Linux
19 frame buffer that provides drawing functions, a window stack and
20 support for input devices. The code you find here is a backend for
21 GDK, the drawing kit used by GTK+.
23 To give it a try, you first need DirectFB (at least version 0.9.17)
24 available from http://www.directfb.org/. Then you need to get your
25 hands on a recent version of GTK+-2.0. The latest release (gtk+-2.8.10)
28 Here are urls for the current for all the source needed to build the current latest gtk release
30 ftp://ftp.gtk.org/pub/gtk/v2.8/atk-1.10.3.tar.gz
31 ftp://ftp.gtk.org/pub/gtk/v2.8/glib-2.8.5.tar.gz
32 ftp://ftp.gtk.org/pub/gtk/v2.8/pango-1.10.2.tar.gz
33 ftp://ftp.gtk.org/pub/gtk/v2.8/gtk+-2.8.10.tar.gz
35 If you don't have tiff i.e stock debian is a the url.
36 ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.0.tar.gz
37 The default build will fail without it.
39 You also need the latest version of cairo from CVS it contains
40 support for a DirectFB backend and should be avialable in the next
44 cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo co cairo
48 Alternatively checkout GTK+ from CVS. Place this
49 directory into the gdk subdirectory of your GTK+ tree and rename it
50 to directfb. Then change to the toplevel GTK+ directory and apply
51 gtk-directfb.patch there is now a mkpatch shell script which should
52 correctly automate creating the directfb target via:
55 cd ../../; make && make install
57 If this fails the older instructions are still available. Note that several
58 file must be regenerated with the auto tools.
62 patch -p0 < gdk/directfb/gtk-directfb.patch
64 Regenerate the configure script and the Makefiles by calling automake
65 and autoconf. Then rebuild GTK+ using the '--with-gdktarget=directfb'
69 Alternatively you can download a version of GTK+ that includes the
70 DirectFB GDK backend and has the patches already applied, see
72 http://www.directfb.org/download/GTK+-DirectFB/
75 As DirectFB provides drawing functions, a windowing stack and manages
76 input devices, this is a lightweight GDK port. Some parts of GDK
77 require higher level drawing functions that are supported by
79 GDK also uses some feature like bitmaps that do not map well to
80 modern graphics hardware and are for that reason not yet supported in
81 this snapshot. See the file TODO for a list of missing features.
84 If you want GTK+ to draw window decorations for you, edit the file
85 gtk/gtkwindow-decorate.c and uncomment the line that says
86 #define DECORATE_WINDOWS.
89 GTK+ application compiled with this version of GTK+ understand some
90 additional command-line options special to the DirectFB GDK backend:
92 --transparent-unfocused Makes unfocused windows translucent.
94 --argb-font Use ARGB surfaces for fonts, needed for some
97 --glyph-surface-cache Lets you tune the size of the glyph cache,
98 the default is to cache glyphs from 8 faces.
100 --enable-color-keying This option turns on a hack that does the
103 (1) It overrides the color used to draw the window background to
104 gdk_directfb_bg_color as defined in gdkprivate-directfb.h.
105 Note that the alpha value only takes effect if the window has
107 (2) It also draws all rectangles that are drawn in
108 gdk_directfb_bg_color_key in this color (gdk_directfb_bg_color).
110 This feature can be used to create windows with translucent background.
112 Additionally all DirectFB command-line options as described in the
113 directfbrc man-page are supported.
116 This version of GTK+ also introduces two new functions that are special
117 to the DirectFB version. You need to include gdk/gdkdirectfb.h to be
120 gdk_directfb_window_set_opacity (GdkWindow *window, guchar opacity));
122 This function sets the overall opacity for toplevel GDK windows.
124 gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format);
126 This function returns a GdkVisual for a DirectFB pixelformat and
127 thus gives you control over the window surface. If for example
128 you want to create a window with alpha channel you can use some
129 code like the following:
131 visual = gdk_directfb_visual_by_format (DSPF_ARGB);
132 cmap = gdk_colormap_new (visual, FALSE);
133 gtk_widget_push_colormap (cmap);
134 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
135 gtk_widget_pop_colormap ();
136 g_object_unref (cmap);
138 Don't use these functions if you want to be able to compile your
139 application against GTK+-X11 or other GTK+ versions.
142 If you are developing a GTK+ application for GTK+-DirectFB make sure
143 you use the gtk+-directfb-2.0.pc file when calling pkg-config to get
144 the correct compiler and linker flags for GTK+-DirectFB:
146 pkg-config --cflags gtk+-directfb-2.0
147 pkg-config --libs gtk+-directfb-2.0
150 See the file TODO for a list of unimplemented features.
152 This library is free software; you can redistribute it and/or modify it
153 under the terms of the GNU Lesser General Public License as published
154 by the Free Software Foundation; either version 2 of the License, or
155 (at your option) any later version.
157 For more information check out http://www.directfb.org/.