diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-07-13 11:37:48 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-08-14 16:06:30 +0200 |
commit | 844334b114318ecf12120bdcad2195e9c2da8098 (patch) | |
tree | 2ee4f6e494b93b91c4171b8dca767f7410f00449 | |
parent | 15596fc27547f0a434e2c48027e43758ac35618e (diff) |
font-face: Move the declarations to a private header
This makes it easier to abstract the cairo-object base from font face
objects.
-rw-r--r-- | src/Makefile.sources | 1 | ||||
-rw-r--r-- | src/cairo-default-context.c | 1 | ||||
-rw-r--r-- | src/cairo-font-face-private.h | 87 | ||||
-rw-r--r-- | src/cairo-font-face-twin.c | 1 | ||||
-rw-r--r-- | src/cairo-font-face.c | 1 | ||||
-rw-r--r-- | src/cairo-ft-font.c | 1 | ||||
-rw-r--r-- | src/cairo-gstate.c | 1 | ||||
-rw-r--r-- | src/cairo-quartz-font.c | 1 | ||||
-rw-r--r-- | src/cairo-scaled-font.c | 1 | ||||
-rw-r--r-- | src/cairo-toy-font-face.c | 2 | ||||
-rw-r--r-- | src/cairo-types-private.h | 1 | ||||
-rw-r--r-- | src/cairo-user-font.c | 1 | ||||
-rw-r--r-- | src/cairo-win32-font.c | 1 | ||||
-rw-r--r-- | src/cairo.c | 1 | ||||
-rw-r--r-- | src/cairoint.h | 35 |
15 files changed, 100 insertions, 36 deletions
diff --git a/src/Makefile.sources b/src/Makefile.sources index b5e480513..9463b4e9d 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -68,6 +68,7 @@ cairo_private = \ cairo-error-private.h \ cairo-fixed-private.h \ cairo-fixed-type-private.h \ + cairo-font-face-private.h \ cairo-freelist-private.h \ cairo-freelist-type-private.h \ cairo-freed-pool-private.h \ diff --git a/src/cairo-default-context.c b/src/cairo-default-context.c index 412463202..28b268734 100644 --- a/src/cairo-default-context.c +++ b/src/cairo-default-context.c @@ -45,6 +45,7 @@ #include "cairo-backend-private.h" #include "cairo-default-context-private.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include "cairo-freed-pool-private.h" #include "cairo-path-private.h" #include "cairo-pattern-private.h" diff --git a/src/cairo-font-face-private.h b/src/cairo-font-face-private.h new file mode 100644 index 000000000..77ac39652 --- /dev/null +++ b/src/cairo-font-face-private.h @@ -0,0 +1,87 @@ +/* -*- 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_FONT_FACE_PRIVATE_H +#define CAIRO_FONT_FACE_PRIVATE_H + +#include "cairo-reference-count-private.h" +#include "cairo-types-private.h" + +struct _cairo_font_face { + /* hash_entry must be first */ + cairo_hash_entry_t hash_entry; + cairo_status_t status; + cairo_reference_count_t ref_count; + cairo_user_data_array_t user_data; + const cairo_font_face_backend_t *backend; +}; + +/* #cairo_toy_font_face_t - simple family/slant/weight font faces used + * for the built-in font API + */ +struct _cairo_toy_font_face { + cairo_font_face_t base; + const char *family; + cairo_bool_t owns_family; + cairo_font_slant_t slant; + cairo_font_weight_t weight; + + cairo_font_face_t *impl_face; /* The non-toy font face this actually uses */ +}; + +extern const cairo_private cairo_font_face_t _cairo_font_face_nil; + +cairo_private void +_cairo_font_face_init (cairo_font_face_t *font_face, + const cairo_font_face_backend_t *backend); + +cairo_private cairo_status_t +_cairo_font_face_set_error (cairo_font_face_t *font_face, + cairo_status_t status); + +cairo_private void +_cairo_unscaled_font_init (cairo_unscaled_font_t *font, + const cairo_unscaled_font_backend_t *backend); + +cairo_private_no_warn cairo_unscaled_font_t * +_cairo_unscaled_font_reference (cairo_unscaled_font_t *font); + +cairo_private void +_cairo_unscaled_font_destroy (cairo_unscaled_font_t *font); + +#endif diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c index 2ad263028..606a88a18 100644 --- a/src/cairo-font-face-twin.c +++ b/src/cairo-font-face-twin.c @@ -36,6 +36,7 @@ #include "cairoint.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include <math.h> diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index 96cbcd86c..1f80aa7ea 100644 --- a/src/cairo-font-face.c +++ b/src/cairo-font-face.c @@ -40,6 +40,7 @@ #include "cairoint.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" /** * SECTION:cairo-font-face diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 405430fee..c79e0a606 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -42,6 +42,7 @@ #include "cairoint.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include "cairo-ft-private.h" #include "cairo-pattern-private.h" diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index 1d59fc546..bd5243a89 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -39,6 +39,7 @@ #include "cairo-clip-private.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include "cairo-gstate-private.h" #include "cairo-pattern-private.h" diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c index f529fc973..32d9bfea9 100644 --- a/src/cairo-quartz-font.c +++ b/src/cairo-quartz-font.c @@ -42,6 +42,7 @@ #include "cairo-quartz-private.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" /** * SECTION:cairo-quartz-fonts diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 3eb84eb7d..0bc23f56b 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -40,6 +40,7 @@ #include "cairoint.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include "cairo-pattern-private.h" #include "cairo-scaled-font-private.h" diff --git a/src/cairo-toy-font-face.c b/src/cairo-toy-font-face.c index 363b9a284..54683a37f 100644 --- a/src/cairo-toy-font-face.c +++ b/src/cairo-toy-font-face.c @@ -42,7 +42,7 @@ #define _BSD_SOURCE /* for strdup() */ #include "cairoint.h" #include "cairo-error-private.h" - +#include "cairo-font-face-private.h" static const cairo_font_face_t _cairo_font_face_null_pointer = { { 0 }, /* hash_entry */ diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h index 24443f6ee..b37cabcb3 100644 --- a/src/cairo-types-private.h +++ b/src/cairo-types-private.h @@ -83,6 +83,7 @@ typedef struct _cairo_surface_backend cairo_surface_backend_t; typedef struct _cairo_surface_snapshot cairo_surface_snapshot_t; typedef struct _cairo_surface_subsurface cairo_surface_subsurface_t; typedef struct _cairo_surface_wrapper cairo_surface_wrapper_t; +typedef struct _cairo_toy_font_face cairo_toy_font_face_t; typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t; typedef cairo_array_t cairo_user_data_array_t; diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c index 522711d5c..7015eae6b 100644 --- a/src/cairo-user-font.c +++ b/src/cairo-user-font.c @@ -39,6 +39,7 @@ #include "cairo-recording-surface-private.h" #include "cairo-analysis-surface-private.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" /** * SECTION:cairo-user-fonts diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c index 1bd110409..866898048 100644 --- a/src/cairo-win32-font.c +++ b/src/cairo-win32-font.c @@ -46,6 +46,7 @@ #include "cairo-win32-private.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include "cairo-pattern-private.h" #include "cairo-scaled-font-subsets-private.h" diff --git a/src/cairo.c b/src/cairo.c index e58206b63..4b034f447 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -43,6 +43,7 @@ #include "cairo-backend-private.h" #include "cairo-error-private.h" +#include "cairo-font-face-private.h" #include "cairo-path-private.h" #include "cairo-pattern-private.h" #include "cairo-surface-private.h" diff --git a/src/cairoint.h b/src/cairoint.h index 957b5c5ba..2ed3f1689 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -415,15 +415,6 @@ _cairo_hash_bytes (unsigned long hash, #include "cairo-scaled-font-private.h" -struct _cairo_font_face { - /* hash_entry must be first */ - cairo_hash_entry_t hash_entry; - cairo_status_t status; - cairo_reference_count_t ref_count; - cairo_user_data_array_t user_data; - const cairo_font_face_backend_t *backend; -}; - cairo_private void _cairo_default_context_reset_static_data (void); @@ -436,20 +427,6 @@ _cairo_ft_font_reset_static_data (void); cairo_private void _cairo_win32_font_reset_static_data (void); -/* #cairo_toy_font_face_t - simple family/slant/weight font faces used for - * the built-in font API - */ - -typedef struct _cairo_toy_font_face { - cairo_font_face_t base; - const char *family; - cairo_bool_t owns_family; - cairo_font_slant_t slant; - cairo_font_weight_t weight; - - cairo_font_face_t *impl_face; /* The non-toy font face this actually uses */ -} cairo_toy_font_face_t; - typedef enum _cairo_scaled_glyph_info { CAIRO_SCALED_GLYPH_INFO_METRICS = (1 << 0), CAIRO_SCALED_GLYPH_INFO_SURFACE = (1 << 1), @@ -1142,18 +1119,6 @@ _cairo_color_stop_equal (const cairo_color_stop_t *color_a, cairo_private cairo_content_t _cairo_color_get_content (const cairo_color_t *color) cairo_pure; -/* cairo-font-face.c */ - -extern const cairo_private cairo_font_face_t _cairo_font_face_nil; - -cairo_private void -_cairo_font_face_init (cairo_font_face_t *font_face, - const cairo_font_face_backend_t *backend); - -cairo_private cairo_status_t -_cairo_font_face_set_error (cairo_font_face_t *font_face, - cairo_status_t status); - /* cairo-font-face-twin.c */ cairo_private cairo_font_face_t * |