1 <refentry id="gtk-framebuffer" revision="1 Jan 2002">
3 <refentrytitle>Using GTK+ on the Framebuffer</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GTK Library</refmiscinfo>
9 <refname>Using GTK+ on the Framebuffer</refname>
11 Linux framebuffer aspects of using GTK+
16 <title>GTK+ for the Linux Framebuffer</title>
19 The linux-fb port of GTK+, also known as GtkFB is an implementation of
20 GDK (and therefore GTK+) that runs on the Linux framebuffer. It runs in
21 a single process that doesn't need X. It should run most GTK+ programs
22 without any changes to the source.
25 <refsect2><title>Build requirements</title>
27 You need GTK+ 2.0; the 1.2.x series does not have framebuffer support.
28 To compile GTK+ with framebuffer support you will need FreeType 2; we
29 recommend FreeType 2.0.1 or later, as there was some problems with
30 <command>freetype-config</command> in 2.0. Make sure that you install
31 FreeType before Pango, since Pango also needs it. FreeType can be found at
32 <ulink url="ftp://ftp.freetype.org">ftp://ftp.freetype.org</ulink>. You also
33 need fontconfig in order to properly use the FreeType 2 backend in Pango.
34 Fontconfig depends on FreeType as well. Fontconfig can be found at
35 <ulink url="http://fontconfig.org">http://fontconfig.org</ulink>.
39 <refsect2><title>Hardware requirements</title>
41 You need a graphics card with an available framebuffer driver that can
42 run in 8, 16, 24 or 32 bpp, such as matroxfb or vesafb. You also need
43 a supported mouse. GTK+ currently supports the ps2 mouse, ms serial
44 mouse and fidmour touchscreen. Additional hardware support should
49 <refsect2><title>Building and installing</title>
51 First build and install GLib, ATK and Pango as usual, in that order.
53 Then configure GTK+ by running <command>configure</command> (or
54 <command>autogen.sh</command> if running from
55 CVS) with <option>--with-gdktarget=linux-fb</option>.
58 <para>Then compile as usual: <command>make; make install</command></para>
61 <refsect2><title>Fonts</title>
63 Since GtkFB uses FreeType 2 to render fonts it can render TrueType and
64 Postscript type 1 antialiased fonts.
68 GtkFB uses fontconfig for configuration of font information, including
69 directories and aliases. Make sure that you have your fonts.conf file
70 configured with where your TrueType and Type1 fonts are. Please refer to the
71 fontconfig documentation for more information.
75 <refsect2><title>Running</title>
77 To run a program you should only need to start it, but there are some
78 things that can cause problems, and some things that can be controlled
79 by environment variables. Try <application>gtk-demo</application> distributed
80 with GTK+ to test if things work.
84 If you use a ps2 mouse, make sure that <filename>/dev/psaux</filename> is
85 readable and writable.
88 <para>Make sure <command>gpm</command> is not running.</para>
90 <para>If you don't specify anything GtkFB will start up in the current
91 virtual console in the current resolution and bit-depth. This can be
92 changed by specifying environment variables:
97 <envar>GDK_VT</envar>:
98 unset means open on the current VT.
99 0-9: open on the specified VT. Make sure you have read/write rights
101 new: Allocate a new VT after the last currently used one.
103 <envar>GDK_DISPLAY_MODE</envar>:
104 Specifies the name of a mode in <filename>/etc/fb.modes</filename> that you
107 <envar>GDK_DISPLAY_DEPTH</envar>:
108 Specify the desired bit depth of the framebuffer.
110 <envar>GDK_DISPLAY_WIDTH</envar>:
111 Specify the desired width of the framebuffer.
113 <envar>GDK_DISPLAY_HEIGHT</envar>:
114 Specify the desired height of the framebuffer.
116 <envar>GDK_DISPLAY</envar>:
117 Specify the framebuffer device to use. Default is <filename>/dev/fb0</filename>.
119 <envar>GDK_MOUSE_TYPE</envar>:
120 Specify mouse type. Currently supported is:
122 imps2 - PS/2 intellimouse (wheelmouse)
123 ms - Microsoft serial mouse
124 fidmour - touch screen
127 <envar>GDK_KEYBOARD_TYPE</envar>:
128 Specify keyboard type. Currently supported is
129 xlate - normal tty mode keyboard.
130 Quite limited, cannot detect key up/key down events. Doesn't
131 handle ctrl/alt/shift for all keys. This is the default driver,
132 but should not be used in "production" use.
133 raw - read from the tty in RAW mode.
134 Sets the keyboard in RAW mode and handles all the keycodes. This
135 gives correct handling of modifiers and key up/down events. You
136 must be root to use this. If you use this for development or
137 debugging it is recommended to enable magic sysrq handling in the
138 kernel. Then you can use ALT-SysRQ-r to turn the keyboard back to
145 <refsect2><title>Debug features</title>
146 <para>Pressing Ctrl-Alt-Return repaints the whole screen.
147 Unfortunately this cannot be pressed when using the xlate keyboard
148 driver, so instead you can use shift-F1 instead when using this
152 <para>Pressing Ctrl-Alt-BackSpace kills the GtkFB program. (This can't be
153 pressed in the xlate driver, so instead you can use shift-F8.)</para>