]> Pileus Git - ~andy/gtk/blob - gdk/directfb/README
73b333493f33b4e3d06eb9548a9b1db44886581c
[~andy/gtk] / gdk / directfb / README
1 README for GDK-DirectFB
2 ------------------------
3
4 This is the GDK backend that allows GTK to work on top of DirectFB.
5
6 Important:
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
9 DFBARGS.
10 Example:
11 export DFBARGS=system=sdl
12
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+.
17
18
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 
22 cairo on DirectFB. 
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.
26
27
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.
31
32
33 GTK+ application compiled with this version of GTK+ understand some
34 additional 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
56 Additionally all DirectFB command-line options as described in the
57 directfbrc man-page are supported.
58
59
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
62 able 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
82 Don't use these functions if you want to be able to compile your
83 application against GTK+-X11 or other GTK+ versions.
84
85
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:
89
90   pkg-config --cflags gtk+-directfb-2.0
91   pkg-config --libs gtk+-directfb-2.0
92
93
94 See the file TODO for a list of unimplemented features.
95
96
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
99 at the address
100 http://www.directfb.org/wiki/index.php/Projects:GTK_on_DirectFB
101
102
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.