diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-07-13 10:37:00 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-08-14 16:06:31 +0200 |
commit | 45cd2ee7358956ae1b7764ad89c1e8d414504572 (patch) | |
tree | bb6af5fc31b503693e7175b6708ca3b43a1bf1d7 | |
parent | 844334b114318ecf12120bdcad2195e9c2da8098 (diff) |
userdata: Move the declarations to a private header
This makes it easier to abstract the cairo-object base from public
objects.
-rw-r--r-- | src/Makefile.sources | 1 | ||||
-rw-r--r-- | src/cairo-array.c | 1 | ||||
-rw-r--r-- | src/cairo-device-private.h | 1 | ||||
-rw-r--r-- | src/cairo-font-face-private.h | 1 | ||||
-rw-r--r-- | src/cairo-private.h | 1 | ||||
-rw-r--r-- | src/cairo-qt-surface.cpp | 1 | ||||
-rw-r--r-- | src/cairo-scaled-font-private.h | 1 | ||||
-rw-r--r-- | src/cairo-script-surface.c | 1 | ||||
-rw-r--r-- | src/cairo-surface-private.h | 1 | ||||
-rw-r--r-- | src/cairo-surface.c | 1 | ||||
-rw-r--r-- | src/cairo-svg-surface.c | 1 | ||||
-rw-r--r-- | src/cairo-user-data-private.h | 77 | ||||
-rw-r--r-- | src/cairo-xcb-surface-core.c | 1 | ||||
-rw-r--r-- | src/cairo-xcb-surface.c | 1 | ||||
-rw-r--r-- | src/cairoint.h | 33 |
15 files changed, 90 insertions, 33 deletions
diff --git a/src/Makefile.sources b/src/Makefile.sources index 9463b4e9d..fb1ac5c56 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -104,6 +104,7 @@ cairo_private = \ cairo-surface-snapshot-private.h \ cairo-surface-wrapper-private.h \ cairo-types-private.h \ + cairo-user-data-private.h \ cairo-user-font-private.h \ cairo-wideint-private.h \ cairo-wideint-type-private.h \ diff --git a/src/cairo-array.c b/src/cairo-array.c index 52b283ff8..c81c9dd87 100644 --- a/src/cairo-array.c +++ b/src/cairo-array.c @@ -38,6 +38,7 @@ #include "cairoint.h" #include "cairo-error-private.h" +#include "cairo-user-data-private.h" /** * _cairo_array_init: diff --git a/src/cairo-device-private.h b/src/cairo-device-private.h index 6eb44f3b6..642843ddd 100644 --- a/src/cairo-device-private.h +++ b/src/cairo-device-private.h @@ -40,6 +40,7 @@ #include "cairo-mutex-private.h" #include "cairo-reference-count-private.h" #include "cairo-types-private.h" +#include "cairo-user-data-private.h" struct _cairo_device { cairo_reference_count_t ref_count; diff --git a/src/cairo-font-face-private.h b/src/cairo-font-face-private.h index 77ac39652..ebbec7273 100644 --- a/src/cairo-font-face-private.h +++ b/src/cairo-font-face-private.h @@ -41,6 +41,7 @@ #include "cairo-reference-count-private.h" #include "cairo-types-private.h" +#include "cairo-user-data-private.h" struct _cairo_font_face { /* hash_entry must be first */ diff --git a/src/cairo-private.h b/src/cairo-private.h index 9f4f55b7c..b8e8a76be 100644 --- a/src/cairo-private.h +++ b/src/cairo-private.h @@ -38,6 +38,7 @@ #include "cairo-types-private.h" #include "cairo-reference-count-private.h" +#include "cairo-user-data-private.h" CAIRO_BEGIN_DECLS diff --git a/src/cairo-qt-surface.cpp b/src/cairo-qt-surface.cpp index aaed90cbc..a82341e0e 100644 --- a/src/cairo-qt-surface.cpp +++ b/src/cairo-qt-surface.cpp @@ -45,6 +45,7 @@ #include "cairo-region-private.h" #include "cairo-surface-clipper-private.h" #include "cairo-types-private.h" +#include "cairo-user-data-private.h" #include "cairo-ft.h" #include "cairo-qt.h" diff --git a/src/cairo-scaled-font-private.h b/src/cairo-scaled-font-private.h index 5c0ba3c13..f0aade8d0 100644 --- a/src/cairo-scaled-font-private.h +++ b/src/cairo-scaled-font-private.h @@ -44,6 +44,7 @@ #include "cairo-list-private.h" #include "cairo-mutex-type-private.h" #include "cairo-reference-count-private.h" +#include "cairo-user-data-private.h" typedef struct _cairo_scaled_glyph_page cairo_scaled_glyph_page_t; diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c index 0f7252a27..9e619db8f 100644 --- a/src/cairo-script-surface.c +++ b/src/cairo-script-surface.c @@ -59,6 +59,7 @@ #include "cairo-surface-snapshot-private.h" #include "cairo-surface-subsurface-private.h" #include "cairo-surface-wrapper-private.h" +#include "cairo-user-data-private.h" #if CAIRO_HAS_FT_FONT #include "cairo-ft-private.h" diff --git a/src/cairo-surface-private.h b/src/cairo-surface-private.h index 31ddb8c7b..d100d3167 100644 --- a/src/cairo-surface-private.h +++ b/src/cairo-surface-private.h @@ -44,6 +44,7 @@ #include "cairo-list-private.h" #include "cairo-reference-count-private.h" #include "cairo-clip-private.h" +#include "cairo-user-data-private.h" typedef void (*cairo_surface_func_t) (cairo_surface_t *); diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 71f8aeaf7..2512d8dc9 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -45,6 +45,7 @@ #include "cairo-recording-surface-private.h" #include "cairo-region-private.h" #include "cairo-tee-surface-private.h" +#include "cairo-user-data-private.h" /** * SECTION:cairo-surface diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index 66d0fc20d..deeca3f0f 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -53,6 +53,7 @@ #include "cairo-scaled-font-subsets-private.h" #include "cairo-surface-clipper-private.h" #include "cairo-svg-surface-private.h" +#include "cairo-user-data-private.h" /** * SECTION:cairo-svg diff --git a/src/cairo-user-data-private.h b/src/cairo-user-data-private.h new file mode 100644 index 000000000..1cde95c1d --- /dev/null +++ b/src/cairo-user-data-private.h @@ -0,0 +1,77 @@ +/* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */ +/* cairo - a vector graphics library with display and print output + * + * Copyright © 2002 University of Southern California + * Copyright © 2005 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 University of Southern + * California. + * + * Contributor(s): + * Carl D. Worth <cworth@cworth.org> + */ + +#ifndef CAIRO_USER_DATA_PRIVATE_H +#define CAIRO_USER_DATA_PRIVATE_H + +#include "cairo-types-private.h" + +typedef struct { + const cairo_user_data_key_t *key; + void *user_data; + cairo_destroy_func_t destroy; +} cairo_user_data_slot_t; + +cairo_private void +_cairo_user_data_array_init (cairo_user_data_array_t *array); + +cairo_private void +_cairo_user_data_array_fini (cairo_user_data_array_t *array); + +cairo_private void * +_cairo_user_data_array_get_data (cairo_user_data_array_t *array, + const cairo_user_data_key_t *key); + +cairo_private cairo_status_t +_cairo_user_data_array_set_data (cairo_user_data_array_t *array, + const cairo_user_data_key_t *key, + void *user_data, + cairo_destroy_func_t destroy); + +cairo_private cairo_status_t +_cairo_user_data_array_copy (cairo_user_data_array_t *dst, + const cairo_user_data_array_t *src); + +cairo_private void +_cairo_user_data_array_foreach (cairo_user_data_array_t *array, + void (*func) (const void *key, + void *elt, + void *closure), + void *closure); + +#endif diff --git a/src/cairo-xcb-surface-core.c b/src/cairo-xcb-surface-core.c index c3c095313..70158a229 100644 --- a/src/cairo-xcb-surface-core.c +++ b/src/cairo-xcb-surface-core.c @@ -32,6 +32,7 @@ #include "cairoint.h" #include "cairo-boxes-private.h" +#include "cairo-user-data-private.h" #include "cairo-xcb-private.h" /* XXX dithering */ diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index da35e75c9..3789c16b5 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -40,6 +40,7 @@ #include "cairoint.h" +#include "cairo-user-data-private.h" #include "cairo-xcb.h" #include "cairo-xcb-private.h" diff --git a/src/cairoint.h b/src/cairoint.h index 2ed3f1689..21c7235e4 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -367,39 +367,6 @@ _cairo_array_num_elements (const cairo_array_t *array); cairo_private unsigned int _cairo_array_size (const cairo_array_t *array); -typedef struct { - const cairo_user_data_key_t *key; - void *user_data; - cairo_destroy_func_t destroy; -} cairo_user_data_slot_t; - -cairo_private void -_cairo_user_data_array_init (cairo_user_data_array_t *array); - -cairo_private void -_cairo_user_data_array_fini (cairo_user_data_array_t *array); - -cairo_private void * -_cairo_user_data_array_get_data (cairo_user_data_array_t *array, - const cairo_user_data_key_t *key); - -cairo_private cairo_status_t -_cairo_user_data_array_set_data (cairo_user_data_array_t *array, - const cairo_user_data_key_t *key, - void *user_data, - cairo_destroy_func_t destroy); - -cairo_private cairo_status_t -_cairo_user_data_array_copy (cairo_user_data_array_t *dst, - const cairo_user_data_array_t *src); - -cairo_private void -_cairo_user_data_array_foreach (cairo_user_data_array_t *array, - void (*func) (const void *key, - void *elt, - void *closure), - void *closure); - #define _CAIRO_HASH_INIT_VALUE 5381 cairo_private unsigned long |