gtk2/gdk/directfb/README
2006-02-05 04:04:29 +00:00

158 lines
5.6 KiB
Plaintext

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