]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/framebuffer.sgml
move README.linux-fb in here
[~andy/gtk] / docs / reference / gtk / framebuffer.sgml
1 <refentry id="gtk-framebuffer" revision="1 Jan 2002">
2 <refmeta>
3 <refentrytitle>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 Using embedded GTK+ on the Linux framebuffer
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 freetype-config in 2.0.  Make sure that you install freetype before
31 Pango, since Pango also needs it.  Freetype can be found at
32 ftp://ftp.freetype.org
33 </para>
34 </refsect2>
35
36 <refsect2><title>Hardware requirements</title>
37 <para>
38 You need a graphics card with an availible framebuffer driver that can
39 run in 8, 16, 24 or 32 bpp, such as matroxfb or vesafb.  You also need
40 a supported mouse. GTK+ currently supports the ps2 mouse, ms serial
41 mouse and fidmour touchscreen. Additional hardware support should 
42 be simple to add.
43 </para>
44 </refsect2>
45
46 <refsect2><title>Building and installing</title>
47 <para>
48 First build and install glib and pango as usual, in that order.
49
50 Then configure Gtk by running configure (or autogen.sh if running from
51 CVS) with <literal>--with-gdktarget=linux-fb</literal>.
52 </para>
53
54 <para>Then compile as ususal: make; make install</para>
55 </refsect2>
56
57 <refsect2><title>Fonts</title>
58 <para>
59 Since GtkFB uses freetype 2 to render fonts it can render truetype and
60 postscript type 1 antialiased fonts.
61 </para>
62
63 <para>At startup it scans some directories looking for fonts. By default
64 it looks in $prefix/lib/ft2fonts, and if you want to change this you
65 must add something like:
66
67 <programlisting>
68 [PangoFT2]
69 FontPath = /usr/share/fonts/default/Type1:/usr/share/fonts/default/TrueType
70 </programlisting>
71
72 To your <filename>$prefix/etc/pango/pangorc</filename> or <filename>~/.pangorc</filename>.
73 </para>
74
75 <para>
76 You must also set up font aliases for the fonts Sans, Serif and
77 Monotype.  This is done by creating a
78 <filename>$prefix/etc/pango/pangoft2.aliases</filename> or
79 <filename>~/.pangoft2_aliases</filename> file. You can also set the name of this file using
80 the key AliasFiles in the PangoFT2 section in pangorc.
81 </para>
82
83 <para>
84 An example of a font alias file for the urw fontset is:
85 <programlisting>
86 sans normal normal normal normal "urw gothic l"
87 serif normal normal normal normal "urw palladio l"
88 monospace normal normal normal normal "nimbus mono l"
89 </programlisting>
90 </para>
91
92 <para>
93 And one using the Windows truetype fonts is:
94 <programlisting>
95 sans normal normal normal normal "arial"
96 serif normal normal normal normal "times new roman"
97 monospace normal normal normal normal "courier new"
98 </programlisting>
99
100 A more detailed example can be found in examples/pangoft2.aliases in the
101 pango distribution.
102 </para>
103 </refsect2>
104
105 <refsect2><title>Running</title>
106 <para>
107 To run a program you should only need to start it, but there are some
108 things that can cause problems, and some things that can be controlled
109 by environment variables. Try testgtk distributed with GTK+ to test
110 if things work.
111 </para>
112
113 <para>
114 If you use a ps2 mouse, make sure that /dev/psaux is readable and
115 writable.
116 </para>
117
118 <para>Make sure gpm is not running.</para>
119
120 <para>If you don't specify anything GtkFB will start up in the current
121 virtual console in the current resolution and bit-depth. This can be
122 changed by specifying environment variables:
123 </para>
124
125 <para>
126 <programlisting>
127 GDK_VT:
128  unset means open on the current VT.
129  0-9: open on the specified VT. Make sure you have read/write rights
130       there.
131  new: Allocate a new VT after the last currently used one.
132
133 GDK_DISPLAY_MODE:
134  Specifies the name of a mode in /etc/fb.modes that you want to use.
135
136 GDK_DISPLAY_DEPTH:
137  Specify the desired bit depth of the framebuffer.
138  
139 GDK_DISPLAY_WIDTH:
140  Specify the desired width of the framebuffer.
141  
142 GDK_DISPLAY_HEIGHT:
143  Specify the desired height of the framebuffer.
144
145 GDK_DISPLAY:
146  Specify the framebuffer device to use. Default is /dev/fb0
147
148 GDK_MOUSE_TYPE:
149  Specify mouse type. Currently supported is:
150   ps2 - PS/2 mouse
151   imps2 - PS/2 intellimouse (wheelmouse)
152   ms - Microsoft serial mouse
153   fidmour - touch screen
154  Default is ps2.
155
156 GDK_KEYBOARD_TYPE:
157  Specify keyboard type. Currently supported is
158   xlate - normal tty mode keyboard.
159     Quite limited, cannot detect key up/key down events. Doesn't
160     handle ctrl/alt/shift for all keys. This is the default driver,
161     but should not be used in "production" use.
162   raw - read from the tty in RAW mode.
163     Sets the keyboard in RAW mode and handles all the keycodes. This
164     gives correct handling of modifiers and key up/down events. You
165     must be root to use this. If you use this for development or
166     debugging it is recommended to enable magic sysrq handling in the
167     kernel. Then you can use ALT-SysRQ-r to turn the keyboard back to
168     normal mode.
169  Default is xlate.
170 </programlisting>
171 </para>
172 </refsect2>
173
174 <refsect2><title>Debug features</title>
175 <para>Pressing Ctrl-Alt-Return repaints the whole screen.
176 Unfortunately this cannot be pressed when using the xlate keyboard
177 driver, so instead you can use shift-F1 instead when using this
178 driver.
179 </para>
180
181 <para>Pressing Ctrl-Alt-BackSpace kills the GtkFB program. (Can't be pressed
182 in the xlate driver.)</para>
183 </refsect2>
184
185 </refsect1>
186
187 </refentry>