1 README for GDK-DirectFB
2 ------------------------
4 This is the GDK backend that allows GTK to work on top of DirectFB.
7 The current code does not pass through directfb passed on the gtk
8 apps command line on to directfb you need to set the environment variable
11 export DFBARGS=system=sdl
13 DirectFB is a hardware abstraction layer on top of the Linux
14 frame buffer that provides drawing functions, a window stack and
15 support for input devices. The code you find here is a backend for
16 GDK, the drawing kit used by GTK+.
19 As DirectFB provides drawing functions, a windowing stack and manages
20 input devices, this is a lightweight GDK port. Some parts of GDK
21 require higher level drawing functions that are supported by
23 GDK also uses some feature like bitmaps that do not map well to
24 modern graphics hardware and are for that reason not yet supported in
25 this snapshot. See the file TODO for a list of missing features.
28 If you want GTK+ to draw window decorations for you, edit the file
29 gtk/gtkwindow-decorate.c and uncomment the line that says
30 #define DECORATE_WINDOWS.
33 GTK+ application compiled with this version of GTK+ understand some
34 additional command-line options special to the DirectFB GDK backend:
36 --transparent-unfocused Makes unfocused windows translucent.
38 --argb-font Use ARGB surfaces for fonts, needed for some
41 --glyph-surface-cache Lets you tune the size of the glyph cache,
42 the default is to cache glyphs from 8 faces.
44 --enable-color-keying This option turns on a hack that does the
47 (1) It overrides the color used to draw the window background to
48 gdk_directfb_bg_color as defined in gdkprivate-directfb.h.
49 Note that the alpha value only takes effect if the window has
51 (2) It also draws all rectangles that are drawn in
52 gdk_directfb_bg_color_key in this color (gdk_directfb_bg_color).
54 This feature can be used to create windows with translucent background.
56 Additionally all DirectFB command-line options as described in the
57 directfbrc man-page are supported.
60 This version of GTK+ also introduces two new functions that are special
61 to the DirectFB version. You need to include gdk/gdkdirectfb.h to be
64 gdk_directfb_window_set_opacity (GdkWindow *window, guchar opacity));
66 This function sets the overall opacity for toplevel GDK windows.
68 gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format);
70 This function returns a GdkVisual for a DirectFB pixelformat and
71 thus gives you control over the window surface. If for example
72 you want to create a window with alpha channel you can use some
73 code like the following:
75 visual = gdk_directfb_visual_by_format (DSPF_ARGB);
76 cmap = gdk_colormap_new (visual, FALSE);
77 gtk_widget_push_colormap (cmap);
78 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
79 gtk_widget_pop_colormap ();
80 g_object_unref (cmap);
82 Don't use these functions if you want to be able to compile your
83 application against GTK+-X11 or other GTK+ versions.
86 If you are developing a GTK+ application for GTK+-DirectFB make sure
87 you use the gtk+-directfb-2.0.pc file when calling pkg-config to get
88 the correct compiler and linker flags for GTK+-DirectFB:
90 pkg-config --cflags gtk+-directfb-2.0
91 pkg-config --libs gtk+-directfb-2.0
94 See the file TODO for a list of unimplemented features.
97 Detailed and up-to-date instructions on how to build a complete
98 set of GTK-DFB libraries is avalable in the WIKI of the DirectFB project
100 http://www.directfb.org/wiki/index.php/Projects:GTK_on_DirectFB
103 This library is free software; you can redistribute it and/or modify it
104 under the terms of the GNU Lesser General Public License as published
105 by the Free Software Foundation; either version 2 of the License, or
106 (at your option) any later version.