Commit e8c3fbf4 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

removed linux-fb backend files.

2008-03-11  Michael Natterer  <mitch@imendio.com>

	* gdk/linux-fb/*: removed linux-fb backend files.

	* acconfig.h
	* config.h.win32.in
	* docs/README.linux-fb
	* gtk/Makefile.am: remove remaining traces of linux-fb.

	* gtk/gtkwindow-decorate.c: same here. There is some code that
	calls into linux-fb to set window move/resize callbacks. I put it
	in #if 0 as a reminder because we did use decorated windows with
	the DirectFB backend and it did work, so I don't really know why
	this code is needed or how it could work with DirectFB back then.
	The file does actually compile now if DECORATE_WINDOWS is defined,
	but I didn't test with DirectFB to check if it does anything.


svn path=/trunk/; revision=19749
parent 1e1f49e0
2008-03-11 Michael Natterer <mitch@imendio.com>
* gdk/linux-fb/*: removed linux-fb backend files.
* acconfig.h
* config.h.win32.in
* docs/README.linux-fb
* gtk/Makefile.am: remove remaining traces of linux-fb.
* gtk/gtkwindow-decorate.c: same here. There is some code that
calls into linux-fb to set window move/resize callbacks. I put it
in #if 0 as a reminder because we did use decorated windows with
the DirectFB backend and it did work, so I don't really know why
this code is needed or how it could work with DirectFB back then.
The file does actually compile now if DECORATE_WINDOWS is defined,
but I didn't test with DirectFB to check if it does anything.
2008-03-11 Alberto Ruiz <aruiz@gnome.org>
* gtk/gtkcombobox.c (gtk_combo_box_size_allocate):
......
......@@ -52,12 +52,6 @@
/* Define to use XKB extension */
#undef HAVE_XKB
/* Define to use shadowfb in the linux-fb port */
#undef ENABLE_SHADOW_FB
/* Define to use a fb manager in the linux-fb port */
#undef ENABLE_FB_MANAGER
#undef XINPUT_NONE
#undef XINPUT_GXI
#undef XINPUT_XFREE
......
......@@ -57,12 +57,6 @@
/* Define to use XKB extension */
/* #undef HAVE_XKB */
/* Define to use shadowfb in the linux-fb port */
/* #undef ENABLE_SHADOW_FB */
/* Define to use a fb manager in the linux-fb port */
/* #undef ENABLE_FB_MANAGER */
/* #undef XINPUT_NONE */
/* #undef XINPUT_GXI */
/* #undef XINPUT_XFREE */
......
THIS FILE IS OBSOLETE - use docs/reference/gtk/framebuffer.sgml
About GtkFB:
------------
The linux-fb port of Gtk+, also known as GtkFB is an implementation of
gdk (and therefor gtk) that runs on the linux framebuffer. It runs in
a single process that doesn't need X. It should run most Gtk+ programs
without any changes to the source.
Build requirements:
-------------------
To run GtkFB programs you will need glib, pango and gtk from cvs
HEAD. Make sure you update these at the same time, since changes to
glib and pango often forces changes in gtk+. Pango optionally depends
on libfribidi, but for normal GtkFB usage that can be ignored.
You also need freetype 2, I recommend that you use freetype 2.0.1 or
later, as there was some problems with freetype-config in 2.0.
Make sure that you install freetype before pango, since pango also
needs it.
Freetype can be found at ftp://ftp.freetype.org
Hardware requirements:
----------------------
You need a graphics card with an available framebuffer driver that can
run in 8, 16, 24 or 32 bpp. I use the matroxfb driver, but i.e. vesafb
should work too. You also need a supported mouse. Currently supported
is ps2 mouse, ms serial mouse and fidmour touchscreen.
Building and installing:
------------------------
First build and install glib and pango as usual, in that order.
Then configure Gtk by running configure (or autogen.sh if running from
cvs) with --with-gdktarget=linux-fb.
Then compile as usual: make; make install
Fonts:
------
Since GtkFB uses freetype 2 to render fonts it can render truetype and
postscript type 1 antialiased fonts.
At startup it scans some directories looking for fonts. By default
it looks in $prefix/lib/ft2fonts, and if you want to change this you
must add something like:
[PangoFT2]
FontPath = /usr/share/fonts/default/Type1:/usr/share/fonts/default/TrueType
To your $prefix/etc/pango/pangorc or ~/.pangorc.
You must also set up font aliases for the fonts Sans, Serif and Monotype.
This is done by creating a $prefix/etc/pango/pangoft2.aliases or
~/.pangoft2_aliases file. You can also set the name of this file using the
key AliasFiles in the PangoFT2 section in pangorc.
An example of a font alias file for the urw fontset is:
sans normal normal normal normal "urw gothic l"
serif normal normal normal normal "urw palladio l"
monospace normal normal normal normal "nimbus mono l"
And one using the Windows truetype fonts is:
sans normal normal normal normal "arial"
serif normal normal normal normal "times new roman"
monospace normal normal normal normal "courier new"
A more detailed example can be found in examples/pangoft2.aliases in the
pango distribution.
Running:
--------
To run a program you should only need to start it, but there are some
things that can cause problems, and some things that can be controlled
by environment variables. Try testgtk distributed with gtk+ to test
if things work.
If you use a ps2 mouse, make sure that /dev/psaux is readable and
writable.
Make sure gpm is not running.
If you don't specify anything GtkFB will start up in the current
virtual console in the current resolution and bit-depth. This can be
changed by specifying environment variables:
GDK_VT:
unset means open on the current VT.
0-9: open on the specified VT. Make sure you have read/write rights
there.
new: Allocate a new VT after the last currently used one.
GDK_DISPLAY_MODE:
Specifies the name of a mode in /etc/fb.modes that you want to use.
GDK_DISPLAY_DEPTH:
Specify the desired bit depth of the framebuffer.
GDK_DISPLAY_WIDTH:
Specify the desired width of the framebuffer.
GDK_DISPLAY_HEIGHT:
Specify the desired height of the framebuffer.
GDK_DISPLAY:
Specify the framebuffer device to use. Default is /dev/fb0
GDK_MOUSE_TYPE:
Specify mouse type. Currently supported is:
ps2 - PS/2 mouse
imps2 - PS/2 intellimouse (wheelmouse)
ms - Microsoft serial mouse
fidmour - touch screen
Default is ps2.
GDK_KEYBOARD_TYPE:
Specify keyboard type. Currently supported is
xlate - normal tty mode keyboard.
Quite limited, cannot detect key up/key down events. Doesn't
handle ctrl/alt/shift for all keys. This is the default driver,
but should not be used in "production" use.
raw - read from the tty in RAW mode.
Sets the keyboard in RAW mode and handles all the keycodes. This
gives correct handling of modifiers and key up/down events. You
must be root to use this. If you use this for development or
debugging it is recommended to enable magic sysrq handling in the
kernel. Then you can use ALT-SysRQ-r to turn the keyboard back to
normal mode.
Default is xlate.
HACKING:
--------
Pressing Ctrl-Alt-Return repaints the whole screen.
Unfortunately this cannot be pressed when using the xlate keyboard
driver, so instead you can use shift-F1 instead when using this
driver.
Pressing Ctrl-Alt-BackSpace kills the GtkFB program. (Can't be pressed
in the xlate driver.
More to be written.
- Alexander Larsson <alexl@redhat.com>
2000/12/06
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
bin_PROGRAMS =
if ENABLE_FB_MANAGER
bin_PROGRAMS += gdkfbmanager gdkfbswitch
endif
libgdkincludedir = $(includedir)/gtk-2.0/gdk
libgdkfbincludedir = $(includedir)/gtk-2.0/gdk/linux-fb
INCLUDES = \
-DG_LOG_DOMAIN=\"Gdk\" \
-DGDK_DATA_PREFIX=\"$(prefix)\" \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
$(GDK_DEP_CFLAGS) \
$(GTK_DEBUG_FLAGS)
noinst_LTLIBRARIES = libgdk-linux-fb.la
libgdkinclude_HEADERS= \
gdkfb.h
libgdk_linux_fb_la_SOURCES = \
gdkcolor-fb.c \
gdkcursor-fb.c \
gdkdisplay-fb.c \
gdkdnd-fb.c \
gdkdrawable-fb2.c \
gdkevents-fb.c \
gdkfbmanager.h \
gdkfont-fb.c \
gdkgc-fb.c \
gdkgeometry-fb.c \
gdkglobals-fb.c \
gdkim-fb.c \
gdkimage-fb.c \
gdkinput.c \
gdkinputprivate.h \
gdkkeyboard-fb.c \
gdkmain-fb.c \
gdkmouse-fb.c \
gdkpango-fb.c \
gdkpixmap-fb.c \
gdkprivate-fb.h \
gdkproperty-fb.c \
gdkrender-fb.c \
gdkscreen-fb.c \
gdkselection-fb.c \
gdkspawn-fb.c \
gdkvisual-fb.c \
gdkwindow-fb.c \
mi.h \
miarc.c \
midash.c \
mifillarc.c \
mifillarc.h \
mifpoly.h \
mifpolycon.c \
miline.h \
mipoly.c \
mipoly.h \
mipolygen.c \
mipolyutil.c \
miscanfill.h \
mispans.c \
mispans.h \
mistruct.h \
mitypes.h \
miwideline.c \
miwideline.h \
mizerclip.c \
mizerline.c
gdkfbmanager_sources = gdkfbmanager.c
gdkfbmanager_LDFLAGS = $(GLIB_LIBS)
gdkfbswitch_sources = gdkfbswitch.c
gdkfbswitch_LDFLAGS = $(GLIB_LIBS)
EXTRA_DIST += x-cursors.xbm
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <config.h>
#include <time.h>
#include <sys/ioctl.h>
#include <string.h>
#include <stdlib.h>
#include "gdkcolor.h"
#include "gdkprivate-fb.h"
#define GDK_COLORMAP_PRIVATE_DATA(cmap) ((GdkColormapPrivateFB *) GDK_COLORMAP (cmap)->windowing_data)
static gint gdk_colormap_match_color (GdkColormap *cmap,
GdkColor *color,
const gchar *available);
static void gdk_fb_color_round_to_hw (GdkColor *color);
static gpointer parent_class;
static void
gdk_colormap_finalize (GObject *object)
{
GdkColormap *colormap = GDK_COLORMAP (object);
GdkColormapPrivateFB *private = GDK_COLORMAP_PRIVATE_DATA (colormap);
if (private->hash)
g_hash_table_destroy (private->hash);
g_free (private->info);
g_free (colormap->colors);
g_free (private);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gdk_colormap_init (GdkColormap *colormap)
{
GdkColormapPrivateFB *private;
private = g_new (GdkColormapPrivateFB, 1);
colormap->windowing_data = private;
colormap->size = 0;
colormap->colors = NULL;
}
static void
gdk_colormap_class_init (GdkColormapClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_colormap_finalize;
}
GType
gdk_colormap_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkColormapClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_colormap_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkColormap),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_colormap_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkColormap",
&object_info,
0);
}
return object_type;
}
GdkColormap *
gdk_colormap_new (GdkVisual *visual,
gint private_cmap)
{
GdkColormap *colormap;
GdkColormap *system;
GdkColormapPrivateFB *private;
GdkFBDisplay *fbd;
int i;
g_return_val_if_fail (visual != NULL, NULL);
colormap = g_object_new (gdk_colormap_get_type (), NULL);
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
colormap->visual = visual;
fbd = gdk_display;
private->hash = NULL;
colormap->size = visual->colormap_size;
colormap->colors = NULL;
switch (visual->type)
{
case GDK_VISUAL_STATIC_GRAY:
case GDK_VISUAL_STATIC_COLOR:
case GDK_VISUAL_GRAYSCALE:
case GDK_VISUAL_PSEUDO_COLOR:
private->info = g_new0 (GdkColorInfo, colormap->size);
colormap->colors = g_new (GdkColor, colormap->size);
private->hash = g_hash_table_new ((GHashFunc) gdk_color_hash,
(GEqualFunc) gdk_color_equal);
system = gdk_colormap_get_system ();
memcpy (colormap->colors, system->colors, colormap->size * sizeof (GdkColor));
if (private_cmap)
{
guint16 red[256], green[256], blue[256];
struct fb_cmap fbc = {0, 256};
fbc.red = red;
fbc.green = green;
fbc.blue = blue;
if (ioctl (fbd->fb_fd, FBIOGETCMAP, &fbc))
g_error("ioctl(FBIOGETCMAP) failed");
for (i = 0; i < colormap->size; i++)
{
colormap->colors[i].pixel = i;
colormap->colors[i].red = red[i];
colormap->colors[i].green = green[i];
colormap->colors[i].blue = blue[i];
}
gdk_colormap_change (colormap, colormap->size);
}
break;
case GDK_VISUAL_DIRECT_COLOR:
g_warning ("gdk_colormap_new () on a direct color visual not implemented");
#if 0
colormap->colors = g_new (GdkColor, colormap->size);
size = 1 << visual->red_prec;
for (i = 0; i < size; i++)
colormap->colors[i].red = i * 65535 / (size - 1);
size = 1 << visual->green_prec;
for (i = 0; i < size; i++)
colormap->colors[i].green = i * 65535 / (size - 1);
size = 1 << visual->blue_prec;
for (i = 0; i < size; i++)
colormap->colors[i].blue = i * 65535 / (size - 1);
gdk_colormap_change (colormap, colormap->size);
#endif
break;
default:
g_assert_not_reached ();
case GDK_VISUAL_TRUE_COLOR:
break;
}
return colormap;
}
GdkColormap*
gdk_screen_get_system_colormap (GdkScreen *screen)
{
static GdkColormap *colormap = NULL;
if (!colormap)
{
GdkColormapPrivateFB *private;
GdkVisual *visual = gdk_visual_get_system ();
int i, r, g, b;
colormap = g_object_new (gdk_colormap_get_type (), NULL);
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
colormap->visual = visual;
private->hash = NULL;
colormap->size = visual->colormap_size;
colormap->colors = NULL;
switch (visual->type)
{
case GDK_VISUAL_STATIC_GRAY:
case GDK_VISUAL_STATIC_COLOR:
case GDK_VISUAL_GRAYSCALE:
case GDK_VISUAL_PSEUDO_COLOR:
private->info = g_new0 (GdkColorInfo, colormap->size);
colormap->colors = g_new (GdkColor, colormap->size);
private->hash = g_hash_table_new ((GHashFunc) gdk_color_hash,
(GEqualFunc) gdk_color_equal);
switch(visual->type)
{
case GDK_VISUAL_GRAYSCALE:
for(i = 0; i < 256; i++) {
colormap->colors[i].red =
colormap->colors[i].green =
colormap->colors[i].blue = i << 8;
gdk_fb_color_round_to_hw (&colormap->colors[i]);
}
i--;
colormap->colors[i].red =
colormap->colors[i].green =
colormap->colors[i].blue = 65535; /* Make it a true white */
gdk_fb_color_round_to_hw (&colormap->colors[i]);
break;
case GDK_VISUAL_PSEUDO_COLOR:
/* Color cube stolen from gdkrgb upon advice from Owen */
for(i = r = 0; r < 6; r++)
for(g = 0; g < 6; g++)
for(b = 0; b < 6; b++)
{
colormap->colors[i].red = r * 65535 / 5;
colormap->colors[i].green = g * 65535 / 5;
colormap->colors[i].blue = b * 65535 / 5;
gdk_fb_color_round_to_hw (&colormap->colors[i]);
i++;
}
g_assert (i == 216);
/* Fill in remaining space with grays */
for(i = 216; i < 256; i++)
{
colormap->colors[i].red =
colormap->colors[i].green =
colormap->colors[i].blue = (i - 216) * 40;
gdk_fb_color_round_to_hw (&colormap->colors[i]);
}
/* Real white */
colormap->colors[255].red =
colormap->colors[255].green =
colormap->colors[255].blue = 65535;
gdk_fb_color_round_to_hw (&colormap->colors[255]);
break;
default:
break;
}
break;
case GDK_VISUAL_DIRECT_COLOR:
g_warning ("gdk_colormap_get_system() on a direct color visual is not implemented");
break;
default:
g_assert_not_reached ();
case GDK_VISUAL_TRUE_COLOR:
break;
}
/* Lock all colors for the system colormap
* on pseudocolor visuals. The AA text rendering
* takes to many colors otherwise.
*/
if ((visual->type == GDK_VISUAL_GRAYSCALE) ||
(visual->type == GDK_VISUAL_PSEUDO_COLOR))
{
for(i = 0; i < 256; i++)
{
colormap->colors[i].pixel = i;
private->info[i].ref_count = 1;
g_hash_table_insert (private->hash,
&colormap->colors[i],
&colormap->colors[i]);
}
}
gdk_colormap_change (colormap, colormap->size);
}
return colormap;
}
gint
gdk_colormap_get_system_size (void)
{
return 1 << (gdk_display->modeinfo.bits_per_pixel);
}
void
gdk_colormap_change (GdkColormap *colormap,
gint ncolors)
{
guint16 red[256], green[256], blue[256];
struct fb_cmap fbc = {0,256};
GdkColormapPrivateFB *private;
int i;
g_return_if_fail (colormap != NULL);
fbc.red = red;
fbc.green = green;
fbc.blue = blue;
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
switch (colormap->visual->type)
{
case GDK_VISUAL_GRAYSCALE:
for(i = 0; i < ncolors; i++)
{
red[i] = green[i] = blue[i] =
(colormap->colors[i].red +
colormap->colors[i].green +
colormap->colors[i].blue)/3;
}
ioctl (gdk_display->fb_fd, FBIOPUTCMAP, &fbc);
break;
case GDK_VISUAL_PSEUDO_COLOR:
for (i = 0; i < ncolors; i++)
{
red[i] = colormap->colors[i].red;
green[i] = colormap->colors[i].green;
blue[i] = colormap->colors[i].blue;
}
ioctl (gdk_display->fb_fd, FBIOPUTCMAP, &fbc);
break;
default:
break;
}
}
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivateFB *private;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
if ((colormap->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(colormap->visual->type != GDK_VISUAL_GRAYSCALE))
return;
for (i = 0; i < ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{