Commit 8856bfc6 authored by Benjamin Otte's avatar Benjamin Otte

directfb: Remove

As announced by email and on IRC, this backend is removed from GTK 3.
It has been broken for over a year with no one fixing it.
parent 7eabb8fd
......@@ -257,13 +257,13 @@ else
gdktarget=x11
fi
AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target],
AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz]] select non-default GDK target],
gdktarget=$with_gdktarget)
AC_SUBST(gdktarget)
case $gdktarget in
x11|win32|quartz|directfb) ;;
*) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);;
x11|win32|quartz) ;;
*) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz or win32.]);;
esac
gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
......@@ -1248,17 +1248,6 @@ else
AM_CONDITIONAL(USE_QUARTZ, false)
fi
if test "x$gdktarget" = "xdirectfb"; then
DIRECTFB_REQUIRED_VERSION=1.0.0
AC_MSG_CHECKING(for DirectFB)
PKG_CHECK_MODULES(DIRECTFB, [directfb >= $DIRECTFB_REQUIRED_VERSION])
AM_CONDITIONAL(USE_DIRECTFB, true)
else
AM_CONDITIONAL(USE_DIRECTFB, false)
fi
# Check for Pango flags
if test "x$gdktarget" = "xwin32"; then
......@@ -1652,9 +1641,6 @@ elif test "x$gdktarget" = "xwin32" ; then
elif test "x$gdktarget" = "xquartz" ; then
gdk_windowing='
#define GDK_WINDOWING_QUARTZ'
elif test "x$gdktarget" = "xdirectfb" ; then
gdk_windowing='
#define GDK_WINDOWING_DIRECTFB'
fi
if test x$gdk_wchar_h = xyes; then
......@@ -1730,7 +1716,6 @@ gdk/win32/Makefile
gdk/win32/rc/Makefile
gdk/win32/rc/gdk.rc
gdk/quartz/Makefile
gdk/directfb/Makefile
gdk/tests/Makefile
gtk/Makefile
gtk/makefile.msc
......
......@@ -29,7 +29,6 @@ IGNORE_HFILES= \
gdkpoly-generic.h \
keyname-table.h \
win32 \
directfb \
x11 \
quartz
......
......@@ -52,7 +52,6 @@ gdk_error_trap_pop
GDK_WINDOWING_X11
GDK_WINDOWING_WIN32
GDK_WINDOWING_QUARTZ
GDK_WINDOWING_DIRECTFB
<SUBSECTION Standard>
GDK_TYPE_GRAB_STATUS
......
......@@ -117,7 +117,6 @@ content_files = \
running.sgml \
building.sgml \
compiling.sgml \
directfb.sgml \
drawing-model.xml \
glossary.xml \
migrating-2to3.xml \
......
......@@ -361,7 +361,7 @@ How to compile GTK+ itself
<arg>--with-xinput=[no|yes]</arg>
</group>
<group>
<arg>--with-gdktarget=[x11|win32|quartz|directfb]</arg>
<arg>--with-gdktarget=[x11|win32|quartz]</arg>
</group>
<group>
<arg>--disable-introspection</arg>
......@@ -551,8 +551,7 @@ How to compile GTK+ itself
Toggles between the supported backends for GDK.
The default is x11, unless the platform is Windows, in which
case the default is win32. Other supported backends are
the quartz backend for OS X, and the DirectFB backend
for the Linux framebuffer.
the quartz backend for OS X.
</para>
</formalpara>
<formalpara>
......
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-directfb">
<refmeta>
<refentrytitle>Using GTK+ on DirectFB</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ on DirectFB</refname>
<refpurpose>
DirectFB-specific aspects of using GTK+
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK+ on DirectFB</title>
<para>
The DirectFB port of GTK+ is an implementation of GDK (and therefore GTK+)
on top of the <ulink url="http://www.directfb.org">DirectFB</ulink>
libraries.
</para>
<para>
Like the obsolete linux-fb port of GTK+, it runs on the Linux framebuffer,
but the DirectFB libraries provide additional features like hardware graphics
acceleration, input device handling and abstraction and an integrated windowing
system.
</para>
<refsect2><title>Build requirements</title>
<para>
Beyond the usual GTK+ build requirements, the DirectFB backend (obviously)
needs the DirectFB libraries (at least 0.9.21) and cairo compiled with
DirectFB support.
</para>
</refsect2>
</refsect1>
</refentry>
......@@ -119,7 +119,6 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="x11.sgml" />
<xi:include href="windows.sgml" />
<xi:include href="osx.sgml" />
<xi:include href="directfb.sgml" />
<xi:include href="resources.sgml" />
<xi:include href="xml/question_index.sgml" />
<xi:include href="drawing-model.xml" />
......
......@@ -9,7 +9,7 @@ INTROSPECTION_COMPILER_ARGS = \
--includedir=.
SUBDIRS = $(gdktarget) . tests
DIST_SUBDIRS = win32 x11 quartz directfb tests
DIST_SUBDIRS = win32 x11 quartz tests
CLEANFILES =
......@@ -155,10 +155,6 @@ common_sources = \
gdkmarshalers.c \
gdkmarshalers.h
libgdk_directfb_3_0_la_SOURCES = $(common_sources)
libgdk_directfb_3_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS)
libgdk_directfb_3_0_la_LDFLAGS = $(LDADD)
libgdk_x11_3_0_la_SOURCES = $(common_sources)
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
......@@ -286,7 +282,7 @@ endif
lib_LTLIBRARIES = $(gdktargetlib)
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la libgdk-directfb-3.0.la
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
......
The GDK DirectFB backend was written by
Denis Oliver Kropp <dok@directfb.org>
Sven Neumann <neo@directfb.org>
Large parts of the code are based on other GDK backends
especially the linuxfb backend which was written mainly
by Alex Larsson <alexl@redhat.com>.
The upgrade to gtk 2.8.x was done by
Michael Emmel <mike.emmel@gmail.com>
Extensive help and support and code was recieved from the Debian
community especially the Debian installer team who bravely chose to
use the gdk directfb port for the graphical debian installer. In
particular
Attilio Fiandrotti <fiandro@tiscalinet.it>
Davide Viti <zinosat@tiscali.it>
for there tireless work bringing the backend from a small project to
stability.
And finally thanks to the Extremadura goverment for bringing the
directfb developers and debian installer team together for a workshop.
## Makefile.am for gtk+/gdk/gdk-directfb
include $(top_srcdir)/Makefile.decl
libgdkincludedir = $(includedir)/gtk-3.0/gdk
INCLUDES = \
-DG_LOG_DOMAIN=\"Gdk-DirectFB\" \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
-DG_DISABLE_DEPRECATED \
@GTK_DEBUG_FLAGS@ \
@GDK_DEP_CFLAGS@
LDADDS = \
@GDK_DEP_LIBS@
noinst_LTLIBRARIES = libgdk-directfb.la
libgdk_directfb_la_SOURCES = \
gdkapplaunchcontext-directfb.c \
gdkcolor-directfb.c \
gdkcursor-directfb.c \
gdkdnd-directfb.c \
gdkdisplay-directfb.c \
gdkdisplay-directfb.h \
gdkdrawable-directfb.c \
gdkevents-directfb.c \
gdkgeometry-directfb.c \
gdkglobals-directfb.c \
gdkim-directfb.c \
gdkinput-directfb.c \
gdkinput-directfb.h \
gdkkeys-directfb.c \
gdkmain-directfb.c \
gdkpixmap-directfb.c \
gdkprivate-directfb.h \
gdkproperty-directfb.c \
gdkscreen-directfb.c \
gdkselection-directfb.c \
gdkspawn-directfb.c \
gdktestutils-directfb.c \
gdkvisual-directfb.c \
gdkdirectfb.h \
gdkwindow-directfb.c \
gdkwindowid.c \
x-cursors.xbm
libgdkinclude_HEADERS = \
gdkdirectfb.h \
gdkprivate-directfb.h
EXTRA_DIST += AUTHORS README TODO
-include $(top_srcdir)/git.mk
README for GDK-DirectFB
------------------------
This is the GDK backend that allows GTK to work on top of DirectFB.
Important:
The current code does not pass through directfb passed on the gtk
apps command line on to directfb you need to set the environment variable
DFBARGS.
Example:
export DFBARGS=system=sdl
DirectFB is a hardware abstraction layer on top of the Linux
frame buffer that provides drawing functions, a window stack and
support for input devices. The code you find here is a backend for
GDK, the drawing kit used by GTK+.
As DirectFB provides drawing functions, a windowing stack and manages
input devices, this is a lightweight GDK port. Some parts of GDK
require higher level drawing functions that are supported by
cairo on DirectFB.
GDK also uses some feature like bitmaps that do not map well to
modern graphics hardware and are for that reason not yet supported in
this snapshot. See the file TODO for a list of missing features.
If you want GTK+ to draw window decorations for you, edit the file
gtk/gtkwindow-decorate.c and uncomment the line that says
#define DECORATE_WINDOWS.
GTK+ application compiled with this version of GTK+ understand some
additional command-line options special to the DirectFB GDK backend:
--transparent-unfocused Makes unfocused windows translucent.
--argb-font Use ARGB surfaces for fonts, needed for some
broken hardware.
--glyph-surface-cache Lets you tune the size of the glyph cache,
the default is to cache glyphs from 8 faces.
--enable-color-keying This option turns on a hack that does the
following:
(1) It overrides the color used to draw the window background to
gdk_directfb_bg_color as defined in gdkprivate-directfb.h.
Note that the alpha value only takes effect if the window has
an alpha channel.
(2) It also draws all rectangles that are drawn in
gdk_directfb_bg_color_key in this color (gdk_directfb_bg_color).
This feature can be used to create windows with translucent background.
Additionally all DirectFB command-line options as described in the
directfbrc man-page are supported.
This version of GTK+ also introduces two new functions that are special
to the DirectFB version. You need to include gdk/gdkdirectfb.h to be
able to use them.
gdk_directfb_window_set_opacity (GdkWindow *window, guchar opacity));
This function sets the overall opacity for toplevel GDK windows.
gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format);
This function returns a GdkVisual for a DirectFB pixelformat and
thus gives you control over the window surface. If for example
you want to create a window with alpha channel you can use some
code like the following:
visual = gdk_directfb_visual_by_format (DSPF_ARGB);
cmap = gdk_colormap_new (visual, FALSE);
gtk_widget_push_colormap (cmap);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_pop_colormap ();
g_object_unref (cmap);
Don't use these functions if you want to be able to compile your
application against GTK+-X11 or other GTK+ versions.
If you are developing a GTK+ application for GTK+-DirectFB make sure
you use the gtk+-directfb-2.0.pc file when calling pkg-config to get
the correct compiler and linker flags for GTK+-DirectFB:
pkg-config --cflags gtk+-directfb-2.0
pkg-config --libs gtk+-directfb-2.0
See the file TODO for a list of unimplemented features.
Detailed and up-to-date instructions on how to build a complete
set of GTK-DFB libraries is avalable in the WIKI of the DirectFB project
at the address
http://www.directfb.org/wiki/index.php/Projects:GTK_on_DirectFB
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.
A list of missing things and known bugs in the DirectFB GDK backend:
- Implement more GDK drawing functions. The most important ones
(including XOR) do work now. Other drawing functions are rarely
used and would need support from DirectFB.
- Implemenent extended input devices. Shouldn't be too hard.
- Look into DND and selections. DND seems to work inside one
application at least.
- Consider using the recently added glyph cache in PangoFT2 to
implement our glyph surface cache. Probably limit the number
of cached glyphs or the size of the surface cache instead of
keeping all glyphs from a number of fonts in the cache.
Some things that will probably never happen:
- Line styles, joining and related stuff. We could use code from the
LinuxFB backend but it seems to be bloat for most applications.
Implementing dashed lines would probably make sense and shouldn't
be too hard.
- Bitmaps (they are partly supported) and masks. This stuff should
be entirely deprecated. Use real alpha channels instead!
This is a simple list of unimplemented function stubs and there file
to see the implementation check the x11 dir.
Its not started yet.
gdkcolor-directfb.c
gdkcursor-directfb.c
gdkdisplay-directfb.c
gdkdnd-directfb.c
gdkdrawable-directfb.c
gdkevents-directfb.c
gdkgc-directfb.c
gdkgeometry-directfb.c
gdkglobals-directfb.c
gdkim-directfb.c
gdkinput-directfb.c
gdkkeys-directfb.c
gdk_keymap_lookup_key
gdk_keyval_convert_case
gdkmain-directfb.c
gdkpixmap-directfb.c
gdkproperty-directfb.c
gdkscreen-directfb.c
gdkselection-directfb.c
gdkspawn-directfb.c
gdkvisual-directfb.c
gdkwindow-directfb.c
gdkwindowid.c
glyphsurfacecache.c
NOTES:
event filter callbacks missing see the x11 impl
/* gdkapplaunchcontext-directfb.c - Gtk+ implementation for GAppLaunchContext
Copyright (C) 2007 Red Hat, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Matthias Clasen <mclasen@redhat.com>
*/
#include "config.h"
#include "gdkapplaunchcontext.h"
char *
_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
{
return NULL;
}
void
_gdk_windowing_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id)
{
}
/* 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.
*/
/*
* GTK+ DirectFB backend
* Copyright (C) 2001-2002 convergence integrated media GmbH
* Copyright (C) 2002 convergence GmbH
* Written by Denis Oliver Kropp <dok@convergence.de> and
* Sven Neumann <sven@convergence.de>
*/
#include "config.h"
#include "gdk.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gdkcolor.h"
#include "gdkinternals.h"
#include "gdkdirectfb.h"
#include "gdkprivate-directfb.h"
typedef struct {
GdkColorInfo *info;
IDirectFBPalette *palette;
} GdkColormapPrivateDirectFB;
static void gdk_colormap_finalize (GObject *object);
static gint gdk_colormap_alloc_pseudocolors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success);
static void gdk_directfb_allocate_color_key (GdkColormap *colormap);
G_DEFINE_TYPE (GdkColormap, gdk_colormap, G_TYPE_OBJECT)
static void
gdk_colormap_init (GdkColormap *colormap)
{
colormap->size = 0;
colormap->colors = NULL;
colormap->windowing_data = NULL;
}
static void
gdk_colormap_class_init (GdkColormapClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gdk_colormap_finalize;
}
static void
gdk_colormap_finalize (GObject *object)
{
GdkColormap *colormap = GDK_COLORMAP (object);
GdkColormapPrivateDirectFB *private = colormap->windowing_data;
g_free (colormap->colors);
if (private)
{
g_free (private->info);
if (private->palette)
private->palette->Release (private->palette);
g_free (private);
colormap->windowing_data = NULL;
}
G_OBJECT_CLASS (gdk_colormap_parent_class)->finalize (object);
}
GdkColormap*
gdk_colormap_new (GdkVisual *visual,
gboolean private_cmap)
{
GdkColormap *colormap;
gint i;
g_return_val_if_fail (visual != NULL, NULL);
colormap = g_object_new (gdk_colormap_get_type (), NULL);
colormap->visual = visual;
colormap->size = visual->colormap_size;
switch (visual->type)
{
case GDK_VISUAL_PSEUDO_COLOR:
{
IDirectFB *dfb = _gdk_display->directfb;
IDirectFBPalette *palette;
GdkColormapPrivateDirectFB *private;
DFBPaletteDescription dsc;
dsc.flags = DPDESC_SIZE;
dsc.size = colormap->size;
if (!dfb->CreatePalette (dfb, &dsc, &palette))
return NULL;
colormap->colors = g_new0 (GdkColor, colormap->size);
private = g_new0 (GdkColormapPrivateDirectFB, 1);
private->info = g_new0 (GdkColorInfo, colormap->size);
if (visual == gdk_visual_get_system())
{
/* save the first (transparent) palette entry */
private->info[0].ref_count++;
}
private->palette = palette;
colormap->windowing_data = private;
gdk_directfb_allocate_color_key (colormap);
}
break;
case GDK_VISUAL_STATIC_COLOR:
colormap->colors = g_new0 (GdkColor, colormap->size);
for (i = 0; i < colormap->size; i++)
{
GdkColor *color = colormap->colors + i;
color->pixel = i;
color->red = (i & 0xE0) << 8 | (i & 0xE0);
color->green = (i & 0x1C) << 11 | (i & 0x1C) << 3;
color->blue = (i & 0x03) << 14 | (i & 0x03) << 6;
}
break;
default:
break;
}
return colormap;
}
GdkScreen*
gdk_colormap_get_screen (GdkColormap *cmap)
{
return _gdk_screen;
}
GdkColormap*
gdk_screen_get_system_colormap (GdkScreen *screen)
{
static GdkColormap *colormap = NULL;
if (!colormap)
{
GdkVisual *visual = gdk_visual_get_system();
/* special case PSEUDO_COLOR to use the system palette */
if (visual->type == GDK_VISUAL_PSEUDO_COLOR)
{
GdkColormapPrivateDirectFB *private;
IDirectFBSurface *surface;
colormap = g_object_new (gdk_colormap_get_type (), NULL);
colormap->visual = visual;
colormap->size = visual->colormap_size;
colormap->colors = g_new0 (GdkColor, colormap->size);
private = g_new0 (GdkColormapPrivateDirectFB, 1);
private->info = g_new0 (GdkColorInfo, colormap->size);
surface=GDK_WINDOW_IMPL_DIRECTFB (
GDK_WINDOW_OBJECT (_gdk_parent_root)->impl)->drawable.surface;
surface->GetPalette (surface, &private->palette);
colormap->windowing_data = private;
/* save the first (transparent) palette entry */
private->info[0].ref_count++;
gdk_directfb_allocate_color_key (colormap);
}
else
{
colormap = gdk_colormap_new (visual, FALSE);
}
}
return colormap;
}
void
gdk_colormap_free_colors (GdkColormap *colormap,
const GdkColor *colors,
gint ncolors)
{
GdkColormapPrivateDirectFB *private;
gint i;
g_return_if_fail (GDK_IS_COLORMAP (colormap));
g_return_if_fail (colors != NULL);
private = colormap->windowing_data;
if (!private)
return;
for (i = 0; i < ncolors; i++)
{
gint index = colors[i].pixel;
if (index < 0 || index >= colormap->size)
continue;
if (private->info[index].ref_count)
private->info[index].ref_count--;
}
}
gint
gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success)
{
GdkVisual *visual;
gint i;
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), 0);
g_return_val_if_fail (colors != NULL, 0);
g_return_val_if_fail (success != NULL, 0);
switch (colormap->visual->type)
{
case GDK_VISUAL_TRUE_COLOR:
visual = colormap->visual;
for (i = 0; i < ncolors; i++)
{
colors[i].pixel =
(((colors[i].red
>> (16 - visual->red_prec)) << visual->red_shift) +
((colors[i].green