1README for GDK-DirectFB 2------------------------ 3 4This is the GDK backend that allows GTK to work on top of DirectFB. 5 6Important: 7The current code does not pass through directfb passed on the gtk 8apps command line on to directfb you need to set the environment variable 9DFBARGS. 10Example: 11export DFBARGS=system=sdl 12 13DirectFB is a hardware abstraction layer on top of the Linux 14frame buffer that provides drawing functions, a window stack and 15support for input devices. The code you find here is a backend for 16GDK, the drawing kit used by GTK+. 17 18 19As DirectFB provides drawing functions, a windowing stack and manages 20input devices, this is a lightweight GDK port. Some parts of GDK 21require higher level drawing functions that are supported by 22cairo on DirectFB. 23GDK also uses some feature like bitmaps that do not map well to 24modern graphics hardware and are for that reason not yet supported in 25this snapshot. See the file TODO for a list of missing features. 26 27 28If you want GTK+ to draw window decorations for you, edit the file 29gtk/gtkwindow-decorate.c and uncomment the line that says 30#define DECORATE_WINDOWS. 31 32 33GTK+ application compiled with this version of GTK+ understand some 34additional command-line options special to the DirectFB GDK backend: 35 36 --transparent-unfocused Makes unfocused windows translucent. 37 38 --argb-font Use ARGB surfaces for fonts, needed for some 39 broken hardware. 40 41 --glyph-surface-cache Lets you tune the size of the glyph cache, 42 the default is to cache glyphs from 8 faces. 43 44 --enable-color-keying This option turns on a hack that does the 45 following: 46 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 50 an alpha channel. 51 (2) It also draws all rectangles that are drawn in 52 gdk_directfb_bg_color_key in this color (gdk_directfb_bg_color). 53 54 This feature can be used to create windows with translucent background. 55 56Additionally all DirectFB command-line options as described in the 57directfbrc man-page are supported. 58 59 60This version of GTK+ also introduces two new functions that are special 61to the DirectFB version. You need to include gdk/gdkdirectfb.h to be 62able to use them. 63 64 gdk_directfb_window_set_opacity (GdkWindow *window, guchar opacity)); 65 66 This function sets the overall opacity for toplevel GDK windows. 67 68 gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format); 69 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: 74 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); 81 82Don't use these functions if you want to be able to compile your 83application against GTK+-X11 or other GTK+ versions. 84 85 86If you are developing a GTK+ application for GTK+-DirectFB make sure 87you use the gtk+-directfb-2.0.pc file when calling pkg-config to get 88the correct compiler and linker flags for GTK+-DirectFB: 89 90 pkg-config --cflags gtk+-directfb-2.0 91 pkg-config --libs gtk+-directfb-2.0 92 93 94See the file TODO for a list of unimplemented features. 95 96 97Detailed and up-to-date instructions on how to build a complete 98set of GTK-DFB libraries is avalable in the WIKI of the DirectFB project 99at the address 100http://www.directfb.org/wiki/index.php/Projects:GTK_on_DirectFB 101 102 103This library is free software; you can redistribute it and/or modify it 104under the terms of the GNU Lesser General Public License as published 105by the Free Software Foundation; either version 2 of the License, or 106(at your option) any later version. 107