Commit 16ecf558 authored by Matthias Clasen's avatar Matthias Clasen

Make GTK+ use an external gdk-pixbuf

parent d722adb7
...@@ -3,22 +3,12 @@ Prerequisites ...@@ -3,22 +3,12 @@ Prerequisites
GTK+ requires the following packages: GTK+ requires the following packages:
- The GLib, Pango, ATK and cairo libraries, available at the same - The GLib, Pango, GdkPixbuf, ATK and cairo libraries, available at
location as GTK+. GTK+ @GTK_VERSION@ requires at least GLib 2.23.6, the same location as GTK+. GTK+ @GTK_VERSION@ requires at least
Pango 1.20, ATK 1.29.2 and cairo 1.6.0. GLib 2.23.6, Pango 1.20, GdkPixbuf 2.21.0 ATK 1.29.2 and cairo 1.6.0.
- gobject-introspection 0.6.7 or newer. - gobject-introspection 0.6.7 or newer.
- The TIFF, PNG, and JPEG image loading libraries. You most
likely have these installed on your system already. If not
these libraries are available from:
http://www.libtiff.org/
http://www.libpng.org/
http://www.ijg.org/
libtiff must be version 3.6.0 or higher.
Simple install procedure Simple install procedure
======================== ========================
......
## Makefile.am for GTK+ ## Makefile.am for GTK+
include $(top_srcdir)/Makefile.decl include $(top_srcdir)/Makefile.decl
SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests perf contrib SRC_SUBDIRS = gdk gtk modules demos tests perf
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
...@@ -147,7 +147,7 @@ gdk-$(GDKTARGET)-3.0-uninstalled.pc: gdk-3.0-uninstalled.pc ...@@ -147,7 +147,7 @@ gdk-$(GDKTARGET)-3.0-uninstalled.pc: gdk-3.0-uninstalled.pc
cp gdk-3.0-uninstalled.pc gdk-$(GDKTARGET)-3.0-uninstalled.pc cp gdk-3.0-uninstalled.pc gdk-$(GDKTARGET)-3.0-uninstalled.pc
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdk-pixbuf-3.0.pc gdk-$(GDKTARGET)-3.0.pc gtk+-$(GDKTARGET)-3.0.pc gail-3.0.pc pkgconfig_DATA = gdk-$(GDKTARGET)-3.0.pc gtk+-$(GDKTARGET)-3.0.pc gail-3.0.pc
if OS_UNIX if OS_UNIX
pkgconfig_DATA += gtk+-unix-print-3.0.pc pkgconfig_DATA += gtk+-unix-print-3.0.pc
......
This diff is collapsed.
include $(top_srcdir)/Makefile.decl
SUBDIRS =
if USE_X11
SUBDIRS += gdk-pixbuf-xlib
endif
-include $(top_srcdir)/git.mk
=== ChangeLog discontinued ===
With the move to git, GTK+ is switching from a ChangeLog file
to relying on commit messages to provide change history. Please
see README.commits for guidance on the expected message format.
2009-03-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.16.0 ===
2009-03-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.15.5 ===
2009-02-17 Matthias Clasen <mclasen@redhat.com>
* === Released 2.15.4 ===
2009-02-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.15.3 ===
2009-01-27 Matthias Clasen <mclasen@redhat.com>
* === Released 2.15.2 ===
2009-01-23 Matthias Clasen <mclasen@redhat.com>
* === Released 2.15.1 ===
2009-01-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.15.0 ===
2008-09-17 Matthias Clasen <mclasen@redhat.com>
* === Released 2.14.2 ===
2008-09-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.14.1 ===
2008-09-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.14.0 ===
2008-08-18 Matthias Clasen <mclasen@redhat.com>
* ==== Released 2.13.7 ===
2008-08-05 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.6 ===
2008-07-21 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.5 ===
2008-07-05 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.4 ===
2008-06-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.3 ===
2008-06-03 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.2 ===
2008-05-29 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.1 ===
2008-05-26 Michael Natterer <mitch@imendio.com>
* gdk-pixbuf-xlib.h
* gdk-pixbuf-xlibrgb.h: use G_BEGIN/END_DECLS.
2008-02-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.0 ===
2007-10-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.1 ===
2007-09-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.0 ===
2007-07-21 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.6 ===
2007-07-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.5 ===
2007-06-19 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.4 ===
2007-06-15 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.3 ===
2007-06-06 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.2 ===
2007-06-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.1 ===
2007-05-24 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.0 ===
2006-10-08 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-xlib.c: Apply a cleanup patch by
Kjartan Maraas (#341812)
2006-08-17 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.2 ===
2006-07-23 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.1 ===
2006-07-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.0 ===
2006-06-21 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.4 ===
2006-06-12 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.3 ===
2006-06-05 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.2 ===
2006-05-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.1 ====
2006-05-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.0 ===
2005-11-17 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-xlib-drawable.c:
* gdk-pixbuf-xlibrgb.c: const correctness fixes
found by Arjan van de Ven and gcc.
2005-10-05 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-xlib-2.0.pc.in (Requires): Require
gmodule-no-export-2.0 instead of gmodule-2.0
2005-08-24 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.2 ===
* === Released 2.8.1 ===
2005-08-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.0 ===
2005-08-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.5 ===
2005-07-22 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.4 ===
2005-07-15 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.3 ===
2005-07-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.2 ===
2005-07-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.1 ===
2005-06-20 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.0 ===
2005-01-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.6.1 ===
2004-12-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.6.0 ===
2004-12-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.6 ===
2004-11-12 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.5 ===
2004-10-27 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.4 ===
2004-09-19 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.3 ===
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.2 ===
2004-08-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.1 ===
Tue Jul 20 23:26:10 2004 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-xlibrgb.c: Include config.h first. (#148034)
Sun Jul 18 20:17:41 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* === released 2.5.0 ==
Tue Mar 9 09:33:54 2004 Owen Taylor <otaylor@redhat.com>
* === Released 2.3.6 ===
Wed Mar 3 15:50:28 2004 Owen Taylor <otaylor@redhat.com>
* Makefile.am (libgdk_pixbuf_xlib_2_0_la_LIBADD): Add
a shared library dependency on libgdk-pixbuf (#124687)
Tue Feb 24 14:45:03 2004 Owen Taylor <otaylor@redhat.com>
* === Released 2.3.3 ===
Fri Feb 13 10:32:09 2004 Owen Taylor <otaylor@redhat.com>
* gdk-pixbuf-xlibrgb.h: Remove a couple of unneeded
#includes. Isn't unsupported code fun?
(133833, Gregory Merchan)
Tue Oct 7 23:30:00 2003 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-xlib.h: Add C++ guards. (123955, Harring Figueiredo)
2002-08-06 jacob berkman <jacob@ximian.com>
* Makefile.am (lib_LTLIBRARIES): link against xlibs
2002-01-25 Federico Mena Quintero <federico@ximian.com>
Merge from gdk-pixbuf stable.
* gdk-pixbuf-xlib-drawable.c (rgb565msb): Fixed the endianness
conversion --- swap the individual 16 bit values instead of taking
everying as a 32 bit value.
(rgb565lsb): Likewise.
(rgb555lsb): Likewise.
(rgb555msb): Likewise.
2001-11-26 Akira TAGOH <tagoh@redhat.com>
* Makefile.am (libgdk_pixbuf_xlib_1_3_la_LDFLAGS):
Added -version-info.
2001-05-19 Havoc Pennington <hp@pobox.com>
* gdk-pixbuf-xlibrgb.c: docs
2001-06-04 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-xlibrgb.c (xlib_rgb_init): remove C++ comment,
reported by Dan McNichol
Mon Jan 8 11:41:41 2001 Owen Taylor <otaylor@redhat.com>
* Makefile.am (INCLUDES): Add @x_cflags@ (#36310)
2001-01-02 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-xlib-2.0.pc.in (Description): fix up description a bit.
2000-10-06 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-xlib.c: Put display/screen here, instead of in
the main gdk-pixbuf library as it was in 1.0; since the io-xpm
loader doesn't use these variables anymore it should be OK
2000-09-26 Federico Mena Quintero <federico@helixcode.com>
* gdk-pixbuf/gdk-pixbuf-xlib-drawable.c
(gdk_pixbuf_xlib_get_from_drawable): Do not use
gdk_screen_{width,height}(). Thanks to John Harper for pointing
this out.
2000-08-26 Federico Mena Quintero <federico@helixcode.com>
* gdk-pixbuf/gdk-pixbuf-xlibrgb.c: Added API reference docs.
2000-08-25 Federico Mena Quintero <federico@helixcode.com>
* gdk-pixbuf/gdk-pixbuf-xlib-drawable.c (handle_x_error): Return
0.
(xlib_window_is_viewable): Return FALSE in the last case.
* gdk-pixbuf/gdk-pixbuf-xlib-render.c: Updated the inline docs.
* gdk-pixbuf/gdk-pixbuf-xlib.c: Added API docs.
2000-08-25 John Harper <john@dcs.warwick.ac.uk>
Work to create an Xlib version of gdk-pixbuf (with the Xlib
port of GdkRGB for rendering):
* configure.in: check for X libraries, set and substitute
GDK_PIXBUF_XLIB_{LIBDIR,INCLUDEDIR,LIBS} variables
* gdk_pixbuf_xlibConf.sh.in: new file -- gnome-config details
for the gdk-pixbuf-xlib library
* Makefile.am: build and install gdk_pixbuf_xlibConf.sh
* gdk-pixbuf/gdk-pixbuf-xlib-render.c,
gdk-pixbuf/gdk-pixbuf-xlib.c, gdk-pixbuf/gdk-pixbuf-xlib.h,
gdk-pixbuf/gdk-pixbuf-xlib-private.h,
gdk-pixbuf/gdk-pixbuf-xlib-drawable.c: new files, ported the
GDK dependent parts of gdk-pixbuf to use Xlib. Functions that
were called gdk_pixbuf_FOO are now gdk_pixbuf_xlib_FOO
* gdk-pixbuf/gdk-pixbuf-xlibrgb.c,
gdk-pixbuf/gdk-pixbuf-xlibrgb.h: added Chris Blizzard's Xlib
port of GdkRGB (from Mozilla CVS)
* gdk-pixbuf/Makefile.am: build a library libgdk_pixbuf_xlib.la
including the non-GDK dependent objects from libgdk_pixbuf.la
plus the Xlib ports and xlibrgb
include $(top_srcdir)/Makefile.decl
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
lib_LTLIBRARIES=libgdk_pixbuf_xlib-3.0.la
INCLUDES = \
-I$(top_srcdir) -I$(top_builddir) \
-I$(top_srcdir)/gdk-pixbuf \
-I$(top_srcdir)/contrib \
$(GDK_PIXBUF_XLIB_DEP_CFLAGS)
libgdk_pixbuf_xlib_3_0_la_LDFLAGS = \
-export-dynamic \
$(no_undefined) \
-version-info $(LT_VERSION_INFO)
libgdk_pixbuf_xlib_3_0_la_LIBADD = \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \
$(GDK_PIXBUF_XLIB_DEP_LIBS)
libgdk_pixbuf_xlib_3_0_la_SOURCES = \
gdk-pixbuf-xlib-private.h \
gdk-pixbuf-xlib.c \
gdk-pixbuf-xlib-render.c \
gdk-pixbuf-xlib-drawable.c \
gdk-pixbuf-xlibrgb.c
libgdk_pixbuf_xlibincludedir=$(includedir)/gtk-3.0/gdk-pixbuf-xlib
libgdk_pixbuf_xlibinclude_HEADERS = \
gdk-pixbuf-xlib.h \
gdk-pixbuf-xlibrgb.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdk-pixbuf-xlib-3.0.pc
EXTRA_DIST += gdk-pixbuf-xlib-3.0.pc.in
-include $(top_srcdir)/git.mk
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: GdkPixbuf Xlib
Description: GdkPixbuf rendering for Xlib
Version: @VERSION@
Requires: gobject-2.0,gmodule-no-export-2.0,gdk-pixbuf-3.0
Libs: -L${libdir} -lgdk_pixbuf_xlib-@GTK_API_VERSION@
Cflags: -I${includedir}
This diff is collapsed.
/* GdkPixbuf library - Xlib header file
*
* Authors: John Harper <john@dcs.warwick.ac.uk>
*
* This 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.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
#ifndef GDK_PIXBUF_XLIB_PRIVATE_H
#define GDK_PIXBUF_XLIB_PRIVATE_H
#include "gdk-pixbuf-xlib.h"
#include <X11/Xlib.h>
extern Display *gdk_pixbuf_dpy;
extern int gdk_pixbuf_screen;
#endif
/* GdkPixbuf library - Rendering functions
*
* Copyright (C) 1999 The Free Software Foundation
*
* Author: Federico Mena-Quintero <federico@gimp.org>
*
* This 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.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*/
/* Trivially ported to Xlib(RGB) by John Harper. */
#include "config.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-xlib-private.h"
/**
* gdk_pixbuf_xlib_render_threshold_alpha:
* @pixbuf: A pixbuf.
* @bitmap: Bitmap where the bilevel mask will be painted to.
* @src_x: Source X coordinate.
* @src_y: source Y coordinate.
* @dest_x: Destination X coordinate.
* @dest_y: Destination Y coordinate.
* @width: Width of region to threshold.
* @height: Height of region to threshold.
* @alpha_threshold: Opacity values below this will be painted as zero; all
* other values will be painted as one.
*
* Takes the opacity values in a rectangular portion of a pixbuf and thresholds
* them to produce a bi-level alpha mask that can be used as a clipping mask for
* a drawable.
*
**/
void
gdk_pixbuf_xlib_render_threshold_alpha (GdkPixbuf *pixbuf, Pixmap bitmap,
int src_x, int src_y,
int dest_x, int dest_y,
int width, int height,
int alpha_threshold)
{
GC gc;
XColor color;
int x, y;
guchar *p;
int start, start_status;
int status;
XGCValues gcv;
g_return_if_fail (pixbuf != NULL);
g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4);
g_return_if_fail (pixbuf->bits_per_sample == 8);
g_return_if_fail (bitmap != 0);
g_return_if_fail (width >= 0 && height >= 0);
g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);
g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);
g_return_if_fail (alpha_threshold >= 0 && alpha_threshold <= 255);
if (width == 0 || height == 0)
return;
gc = XCreateGC (gdk_pixbuf_dpy, bitmap, 0, &gcv);
if (!pixbuf->has_alpha) {
color.pixel = (alpha_threshold == 255) ? 0 : 1;
XSetForeground (gdk_pixbuf_dpy, gc, color.pixel);
XFillRectangle (gdk_pixbuf_dpy, bitmap, gc,
dest_x, dest_y, width, height);
XFreeGC (gdk_pixbuf_dpy, gc);
return;
}
color.pixel = 0;
XSetForeground (gdk_pixbuf_dpy, gc, color.pixel);
XFillRectangle (gdk_pixbuf_dpy, bitmap, gc,
dest_x, dest_y, width, height);
color.pixel = 1;
XSetForeground (gdk_pixbuf_dpy, gc, color.pixel);
for (y = 0; y < height; y++) {
p = (pixbuf->pixels + (y + src_y) * pixbuf->rowstride + src_x * pixbuf->n_channels
+ pixbuf->n_channels - 1);
start = 0;
start_status = *p < alpha_threshold;
for (x = 0; x < width; x++) {
status = *p < alpha_threshold;
if (status != start_status) {
if (!start_status)
XDrawLine (gdk_pixbuf_dpy, bitmap, gc,
start + dest_x, y + dest_y,
x - 1 + dest_x, y + dest_y);
start = x;
start_status = status;
}
p += pixbuf->n_channels;
}
if (!start_status)
XDrawLine (gdk_pixbuf_dpy, bitmap, gc,
start + dest_x, y + dest_y,
x - 1 + dest_x, y + dest_y);
}
XFreeGC (gdk_pixbuf_dpy, gc);
}
/* Creates a buffer by stripping the alpha channel of a pixbuf */
static guchar *
remove_alpha (GdkPixbuf *pixbuf, int x, int y, int width, int height, int *rowstride)
{
guchar *buf;
int xx, yy;
guchar *src, *dest;
g_assert (pixbuf->n_channels == 4);
g_assert (pixbuf->has_alpha);
g_assert (width > 0 && height > 0);
g_assert (x >= 0 && x + width <= pixbuf->width);
g_assert (y >= 0 && y + height <= pixbuf->height);
*rowstride = 4 * ((width * 3 + 3) / 4);
buf = g_new (guchar, *rowstride * height);
for (yy = 0; yy < height; yy++) {
src = pixbuf->pixels + pixbuf->rowstride * (yy + y) + x * pixbuf->n_channels;
dest = buf + *rowstride * yy;
for (xx = 0; xx < width; xx++) {
*dest++ = *src++;
*dest++ = *src++;
*dest++ = *src++;
src++;
}
}
return buf;
}
/**
* gdk_pixbuf_xlib_render_to_drawable:
* @pixbuf: A pixbuf.
* @drawable: Destination drawable.
* @gc: GC used for rendering.
* @src_x: Source X coordinate within pixbuf.
* @src_y: Source Y coordinate within pixbuf.
* @dest_x: Destination X coordinate within drawable.
* @dest_y: Destination Y coordinate within drawable.
* @width: Width of region to render, in pixels.
* @height: Height of region to render, in pixels.
* @dither: Dithering mode for XlibRGB.
* @x_dither: X offset for dither.
* @y_dither: Y offset for dither.
*
* Renders a rectangular portion of a pixbuf to a drawable while using the
* specified GC. This is done using XlibRGB, so the specified drawable must
* have the XlibRGB visual and colormap. Note that this function will ignore