diff options
author | Carl Worth <cworth@cworth.org> | 2006-09-09 15:05:56 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-09-11 11:05:02 -0700 |
commit | 79aed8c5fc82439f6724e8820ebcdaa585657574 (patch) | |
tree | 9f3bf336088ad81f1b5dc436fe8e63c7249d4d9a | |
parent | cb6aed0a816cc5f09bb5660d4961ca196243eb10 (diff) |
Deprecated CAIRO_FORMAT_RGB16_565. Add cairo-deprecated.h .
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/cairo-deprecated.h | 41 | ||||
-rw-r--r-- | src/cairo-image-surface.c | 5 | ||||
-rw-r--r-- | src/cairo-xlib-surface.c | 2 | ||||
-rw-r--r-- | src/cairo.h | 17 |
5 files changed, 49 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 745dfbc69..e2484b5a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -142,6 +142,7 @@ cairo_headers = \ cairoincludedir = $(includedir)/cairo cairoinclude_HEADERS = \ cairo-features.h \ + cairo-deprecated.h \ $(cairo_headers) lib_LTLIBRARIES = libcairo.la diff --git a/src/cairo-deprecated.h b/src/cairo-deprecated.h new file mode 100644 index 000000000..2424fb852 --- /dev/null +++ b/src/cairo-deprecated.h @@ -0,0 +1,41 @@ +/* cairo - a vector graphics library with display and print output + * + * Copyright © 2006 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it either under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation + * (the "LGPL") or, at your option, under the terms of the Mozilla + * Public License Version 1.1 (the "MPL"). If you do not alter this + * notice, a recipient may use your version of this file under either + * the MPL or the LGPL. + * + * You should have received a copy of the LGPL along with this library + * in the file COPYING-LGPL-2.1; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the MPL along with this library + * in the file COPYING-MPL-1.1 + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY + * OF ANY KIND, either express or implied. See the LGPL or the MPL for + * the specific language governing rights and limitations. + * + * The Original Code is the cairo graphics library. + * + * The Initial Developer of the Original Code is Red Hat, Inc. + * + * Contributor(s): + * Carl D. Worth <cworth@cworth.org> + */ + +#ifndef CAIRO_DEPRECATED_H +#define CAIRO_DEPRECATED_H + +#define CAIRO_FORMAT_RGB16_565 4 + +#endif /* CAIRO_DEPRECATED_H */ diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 49a463836..0e79b22b6 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -44,8 +44,6 @@ _cairo_format_bpp (cairo_format_t format) return 1; case CAIRO_FORMAT_A8: return 8; - case CAIRO_FORMAT_RGB16_565: - return 16; case CAIRO_FORMAT_RGB24: case CAIRO_FORMAT_ARGB32: return 32; @@ -211,9 +209,6 @@ _create_pixman_format (cairo_format_t format) case CAIRO_FORMAT_A8: return pixman_format_create (PIXMAN_FORMAT_NAME_A8); break; - case CAIRO_FORMAT_RGB16_565: - return pixman_format_create (PIXMAN_FORMAT_NAME_RGB16_565); - break; case CAIRO_FORMAT_RGB24: return pixman_format_create (PIXMAN_FORMAT_NAME_RGB24); break; diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 365e40d5d..d0f915822 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -177,8 +177,6 @@ _CAIRO_FORMAT_DEPTH (cairo_format_t format) return 1; case CAIRO_FORMAT_A8: return 8; - case CAIRO_FORMAT_RGB16_565: - return 16; case CAIRO_FORMAT_RGB24: return 24; case CAIRO_FORMAT_ARGB32: diff --git a/src/cairo.h b/src/cairo.h index e9ac35acc..df6abda0d 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -39,6 +39,7 @@ #define CAIRO_H #include <cairo-features.h> +#include <cairo-deprecated.h> CAIRO_BEGIN_DECLS @@ -1360,14 +1361,7 @@ cairo_surface_set_fallback_resolution (cairo_surface_t *surface, * machine the first pixel is in the least-significant bit. * @CAIRO_FORMAT_RGB16_565: This format value is deprecated. It has * never been properly implemented in cairo and should not be used - * by applications. For example, any attempt to create an image - * surface with a format of CAIRO_FORMAT_RGB16_565 will fail. This - * format value was added as part of fixing cairo's xlib backend to - * work with X servers advertising a 16-bit, 565 visual. But as it - * turned out, adding this format to #cairo_format_t was not - * necessary, and was a mistake, (cairo's xlib backend can work fine - * with 16-bit visuals in the same way it works with BGR visuals - * without any BGR formats in #cairo_format_t). (Since 1.2) + * by applications. (since 1.2) * * #cairo_format_t is used to identify the memory format of * image data. @@ -1378,8 +1372,11 @@ typedef enum _cairo_format { CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24, CAIRO_FORMAT_A8, - CAIRO_FORMAT_A1, - CAIRO_FORMAT_RGB16_565 + CAIRO_FORMAT_A1 + /* The value of 4 is reserved by a deprecated enum value. + * The next format added must have an explicit value of 5. + CAIRO_FORMAT_RGB16_565 = 4, + */ } cairo_format_t; cairo_public cairo_surface_t * |