]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/framebuffer.sgml
Add rule to regenerate man pages from Docbook. (man_MANS): Add
[~andy/gtk] / docs / reference / gtk / framebuffer.sgml
1 <refentry id="gtk-framebuffer" revision="1 Jan 2002">
2 <refmeta>
3 <refentrytitle>Using GTK+ on the Framebuffer</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GTK Library</refmiscinfo>
6 </refmeta>
7
8 <refnamediv>
9 <refname>Using GTK+ on the Framebuffer</refname>
10 <refpurpose>
11 Linux framebuffer aspects of using GTK+
12 </refpurpose>
13 </refnamediv>
14
15 <refsect1>
16 <title>GTK+ for the Linux Framebuffer</title>
17
18 <para>
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.
23 </para>
24
25 <refsect2><title>Build requirements</title>
26 <para>
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>.
36 </para>
37 </refsect2>
38
39 <refsect2><title>Hardware requirements</title>
40 <para>
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 
45 be simple to add.
46 </para>
47 </refsect2>
48
49 <refsect2><title>Building and installing</title>
50 <para>
51 First build and install GLib, ATK and Pango as usual, in that order.
52
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>.
56 </para>
57
58 <para>Then compile as usual: <command>make; make install</command></para>
59 </refsect2>
60
61 <refsect2><title>Fonts</title>
62 <para>
63 Since GtkFB uses FreeType 2 to render fonts it can render TrueType and
64 Postscript type 1 antialiased fonts.
65 </para>
66
67 <para>
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.
72 </para>
73 </refsect2>
74
75 <refsect2><title>Running</title>
76 <para>
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.
81 </para>
82
83 <para>
84 If you use a ps2 mouse, make sure that <filename>/dev/psaux</filename> is 
85 readable and writable.
86 </para>
87
88 <para>Make sure <command>gpm</command> is not running.</para>
89
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:
93 </para>
94
95 <para>
96 <programlisting>
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
100       there.
101  new: Allocate a new VT after the last currently used one.
102
103 <envar>GDK_DISPLAY_MODE</envar>:
104  Specifies the name of a mode in <filename>/etc/fb.modes</filename> that you 
105  want to use.
106
107 <envar>GDK_DISPLAY_DEPTH</envar>:
108  Specify the desired bit depth of the framebuffer.
109  
110 <envar>GDK_DISPLAY_WIDTH</envar>:
111  Specify the desired width of the framebuffer.
112  
113 <envar>GDK_DISPLAY_HEIGHT</envar>:
114  Specify the desired height of the framebuffer.
115
116 <envar>GDK_DISPLAY</envar>:
117  Specify the framebuffer device to use. Default is <filename>/dev/fb0</filename>.
118
119 <envar>GDK_MOUSE_TYPE</envar>:
120  Specify mouse type. Currently supported is:
121   ps2 - PS/2 mouse
122   imps2 - PS/2 intellimouse (wheelmouse)
123   ms - Microsoft serial mouse
124   fidmour - touch screen
125  Default is ps2.
126
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
139     normal mode.
140  Default is xlate.
141 </programlisting>
142 </para>
143 </refsect2>
144
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
149 driver.
150 </para>
151
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>
154 </refsect2>
155
156 </refsect1>
157
158 </refentry>