Deprecated CAIRO_FORMAT_RGB16_565. Add cairo-deprecated.h .

This commit is contained in:
Carl Worth 2006-09-09 15:05:56 -07:00
parent cb6aed0a81
commit 79aed8c5fc
5 changed files with 49 additions and 17 deletions

View file

@ -142,6 +142,7 @@ cairo_headers = \
cairoincludedir = $(includedir)/cairo
cairoinclude_HEADERS = \
cairo-features.h \
cairo-deprecated.h \
$(cairo_headers)
lib_LTLIBRARIES = libcairo.la

41
src/cairo-deprecated.h Normal file
View file

@ -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 */

View file

@ -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;

View file

@ -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:

View file

@ -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 *