Back to index

lightning-sunbird  0.9+nobinonly
cairoint.h
Go to the documentation of this file.
00001 /* cairo - a vector graphics library with display and print output
00002  *
00003  * Copyright © 2002 University of Southern California
00004  * Copyright © 2005 Red Hat, Inc.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it either under the terms of the GNU Lesser General Public
00008  * License version 2.1 as published by the Free Software Foundation
00009  * (the "LGPL") or, at your option, under the terms of the Mozilla
00010  * Public License Version 1.1 (the "MPL"). If you do not alter this
00011  * notice, a recipient may use your version of this file under either
00012  * the MPL or the LGPL.
00013  *
00014  * You should have received a copy of the LGPL along with this library
00015  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00017  * You should have received a copy of the MPL along with this library
00018  * in the file COPYING-MPL-1.1
00019  *
00020  * The contents of this file are subject to the Mozilla Public License
00021  * Version 1.1 (the "License"); you may not use this file except in
00022  * compliance with the License. You may obtain a copy of the License at
00023  * http://www.mozilla.org/MPL/
00024  *
00025  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
00026  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
00027  * the specific language governing rights and limitations.
00028  *
00029  * The Original Code is the cairo graphics library.
00030  *
00031  * The Initial Developer of the Original Code is University of Southern
00032  * California.
00033  *
00034  * Contributor(s):
00035  *     Carl D. Worth <cworth@cworth.org>
00036  */
00037 
00038 /*
00039  * These definitions are solely for use by the implementation of cairo
00040  * and constitute no kind of standard.  If you need any of these
00041  * functions, please drop me a note.  Either the library needs new
00042  * functionality, or there's a way to do what you need using the
00043  * existing published interfaces. cworth@cworth.org
00044  */
00045 
00046 #ifndef _CAIROINT_H_
00047 #define _CAIROINT_H_
00048 
00049 #if HAVE_CONFIG_H
00050 #include "config.h"
00051 #endif
00052 
00053 #include <assert.h>
00054 #include <stdlib.h>
00055 #include <string.h>
00056 #include <stdarg.h>
00057 
00058 #ifdef _MSC_VER
00059 #define _USE_MATH_DEFINES
00060 #endif
00061 #include <math.h>
00062 #include <limits.h>
00063 #include <stdio.h>
00064 
00065 #include "cairo.h"
00066 #include "cairo-debug.h"
00067 #include <pixman.h>
00068 
00069 #if __GNUC__ >= 3 && defined(__ELF__)
00070 # define slim_hidden_proto(name)   slim_hidden_proto1(name, INT_##name)
00071 # define slim_hidden_def(name)            slim_hidden_def1(name, INT_##name)
00072 # define slim_hidden_proto1(name, internal)                           \
00073   extern __typeof (name) name                                         \
00074        __asm__ (slim_hidden_asmname (internal))                \
00075        cairo_private;
00076 # define slim_hidden_def1(name, internal)                      \
00077   extern __typeof (name) EXT_##name __asm__(slim_hidden_asmname(name))       \
00078        __attribute__((__alias__(slim_hidden_asmname(internal))))
00079 # define slim_hidden_ulp           slim_hidden_ulp1(__USER_LABEL_PREFIX__)
00080 # define slim_hidden_ulp1(x)              slim_hidden_ulp2(x)
00081 # define slim_hidden_ulp2(x)              #x
00082 # define slim_hidden_asmname(name) slim_hidden_asmname1(name)
00083 # define slim_hidden_asmname1(name)       slim_hidden_ulp #name
00084 #else
00085 # define slim_hidden_proto(name)
00086 # define slim_hidden_def(name)
00087 #endif
00088 
00089 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
00090 #define CAIRO_PRINTF_FORMAT(fmt_index, va_index) \
00091        __attribute__((__format__(__printf__, fmt_index, va_index)))
00092 #else
00093 #define CAIRO_PRINTF_FORMAT(fmt_index, va_index)
00094 #endif
00095 
00096 /* slim_internal.h */
00097 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
00098 #define cairo_private              __attribute__((__visibility__("hidden")))
00099 #else
00100 #define cairo_private
00101 #endif
00102 
00103 /* This macro allow us to deprecate a function by providing an alias
00104    for the old function name to the new function name. With this
00105    macro, binary compatibility is preserved. The macro only works on
00106    some platforms --- tough.
00107 
00108    Meanwhile, new definitions in the public header file break the
00109    source code so that it will no longer link against the old
00110    symbols. Instead it will give a descriptive error message
00111    indicating that the old function has been deprecated by the new
00112    function.
00113 */
00114 #if __GNUC__ >= 2 && defined(__ELF__)
00115 # define CAIRO_FUNCTION_ALIAS(old, new)          \
00116        extern __typeof (new) old          \
00117        __asm__ ("" #old)                  \
00118        __attribute__((__alias__("" #new)))
00119 #else
00120 # define CAIRO_FUNCTION_ALIAS(old, new)
00121 #endif
00122 
00123 #ifndef __GNUC__
00124 #define __attribute__(x)
00125 #endif
00126 
00127 #if defined(__GNUC__)
00128 #define INLINE __inline__
00129 #else
00130 #define INLINE
00131 #endif
00132 
00133 #if HAVE_PTHREAD_H
00134 # include <pthread.h>
00135 # define CAIRO_MUTEX_DECLARE(name) static pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
00136 #define CAIRO_MUTEX_DECLARE_GLOBAL(name) pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
00137 # define CAIRO_MUTEX_LOCK(name) pthread_mutex_lock (&name)
00138 # define CAIRO_MUTEX_UNLOCK(name) pthread_mutex_unlock (&name)
00139 #endif
00140 
00141 #if !defined(CAIRO_MUTEX_DECLARE) && defined CAIRO_HAS_WIN32_SURFACE
00142 // if 0 this for mozilla; we're only going to use cairo single-threaded,
00143 // and we can't use DllMain since we link statically.  So this is
00144 // much simpler.
00145 #if 0
00146 # define WIN32_LEAN_AND_MEAN
00147 # include <windows.h>
00148   /* the real initialization must take place in DllMain */
00149 # define CAIRO_MUTEX_DECLARE(name) extern CRITICAL_SECTION name; 
00150 # define CAIRO_MUTEX_DECLARE_GLOBAL(name) extern LPCRITICAL_SECTION name;
00151 # define CAIRO_MUTEX_LOCK(name) EnterCriticalSection (&name)
00152 # define CAIRO_MUTEX_UNLOCK(name) LeaveCriticalSection (&name)
00153 #endif
00154 #endif
00155 
00156 #ifndef CAIRO_MUTEX_DECLARE
00157 # define CAIRO_MUTEX_DECLARE(name)
00158 # define CAIRO_MUTEX_DECLARE_GLOBAL(name)
00159 # define CAIRO_MUTEX_LOCK(name)
00160 # define CAIRO_MUTEX_UNLOCK(name)
00161 #endif
00162 
00163 #undef MIN
00164 #define MIN(a, b) ((a) < (b) ? (a) : (b))
00165 
00166 #undef MAX
00167 #define MAX(a, b) ((a) > (b) ? (a) : (b))
00168 
00169 #ifndef FALSE
00170 #define FALSE 0
00171 #endif
00172 
00173 #ifndef TRUE
00174 #define TRUE 1
00175 #endif
00176 
00177 #define ASSERT_NOT_REACHED         \
00178 do {                               \
00179     static const int NOT_REACHED = 0;     \
00180     assert (NOT_REACHED);          \
00181 } while (0)
00182 
00183 #ifndef M_PI
00184 #define M_PI           3.14159265358979323846
00185 #endif
00186 
00187 #include "cairo-wideint.h"
00188 
00189 typedef int32_t             cairo_fixed_16_16_t;
00190 typedef cairo_int64_t       cairo_fixed_32_32_t;
00191 typedef cairo_int64_t       cairo_fixed_48_16_t;
00192 typedef cairo_int128_t      cairo_fixed_64_64_t;
00193 typedef cairo_int128_t      cairo_fixed_96_32_t;
00194 
00195 /* The common 16.16 format gets a shorter name */
00196 typedef cairo_fixed_16_16_t cairo_fixed_t;
00197 
00198 #define CAIRO_MAXSHORT SHRT_MAX
00199 #define CAIRO_MINSHORT SHRT_MIN
00200 
00201 #define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff))
00202 #define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0)
00203 
00204 #include "cairo-hash-private.h"
00205 
00206 typedef struct _cairo_point {
00207     cairo_fixed_t x;
00208     cairo_fixed_t y;
00209 } cairo_point_t;
00210 
00211 typedef struct _cairo_slope
00212 {
00213     cairo_fixed_t dx;
00214     cairo_fixed_t dy;
00215 } cairo_slope_t, cairo_distance_t;
00216 
00217 typedef struct _cairo_point_double {
00218     double x;
00219     double y;
00220 } cairo_point_double_t;
00221 
00222 typedef struct _cairo_distance_double {
00223     double dx;
00224     double dy;
00225 } cairo_distance_double_t;
00226 
00227 typedef struct _cairo_line {
00228     cairo_point_t p1;
00229     cairo_point_t p2;
00230 } cairo_line_t, cairo_box_t;
00231 
00232 typedef struct _cairo_trapezoid {
00233     cairo_fixed_t top, bottom;
00234     cairo_line_t left, right;
00235 } cairo_trapezoid_t;
00236 
00237 typedef struct _cairo_rectangle {
00238     short x, y;
00239     unsigned short width, height;
00240 } cairo_rectangle_t, cairo_glyph_size_t;
00241 
00242 /* Sure wish C had a real enum type so that this would be distinct
00243    from cairo_status_t. Oh well, without that, I'll use this bogus 1000
00244    offset */
00245 typedef enum cairo_int_status {
00246     CAIRO_INT_STATUS_DEGENERATE = 1000,
00247     CAIRO_INT_STATUS_UNSUPPORTED,
00248     CAIRO_INT_STATUS_NOTHING_TO_DO
00249 } cairo_int_status_t;
00250 
00251 typedef enum cairo_direction {
00252     CAIRO_DIRECTION_FORWARD,
00253     CAIRO_DIRECTION_REVERSE
00254 } cairo_direction_t;
00255 
00256 typedef struct _cairo_path_fixed cairo_path_fixed_t;
00257 typedef enum _cairo_clip_mode cairo_clip_mode_t;
00258 typedef struct _cairo_clip_path cairo_clip_path_t;
00259 typedef struct _cairo_clip cairo_clip_t;
00260 
00261 typedef struct _cairo_edge {
00262     cairo_line_t edge;
00263     int clockWise;
00264 
00265     cairo_fixed_16_16_t current_x;
00266 } cairo_edge_t;
00267 
00268 typedef struct _cairo_polygon {
00269     int num_edges;
00270     int edges_size;
00271     cairo_edge_t *edges;
00272 
00273     cairo_point_t first_point;
00274     cairo_point_t current_point;
00275     int has_current_point;
00276 
00277     int closed;
00278 } cairo_polygon_t;
00279 
00280 typedef struct _cairo_spline {
00281     cairo_point_t a, b, c, d;
00282 
00283     cairo_slope_t initial_slope;
00284     cairo_slope_t final_slope;
00285 
00286     int num_points;
00287     int points_size;
00288     cairo_point_t *points;
00289 } cairo_spline_t;
00290 
00291 typedef struct _cairo_pen_vertex {
00292     cairo_point_t point;
00293 
00294     cairo_slope_t slope_ccw;
00295     cairo_slope_t slope_cw;
00296 } cairo_pen_vertex_t;
00297 
00298 typedef struct _cairo_pen {
00299     double radius;
00300     double tolerance;
00301 
00302     cairo_pen_vertex_t *vertices;
00303     int num_vertices;
00304 } cairo_pen_t;
00305 
00306 typedef struct _cairo_color cairo_color_t;
00307 typedef struct _cairo_image_surface cairo_image_surface_t;
00308 
00309 cairo_private void
00310 _cairo_box_round_to_rectangle (cairo_box_t *box, cairo_rectangle_t *rectangle);
00311 
00312 cairo_private void
00313 _cairo_rectangle_intersect (cairo_rectangle_t *dest, cairo_rectangle_t *src);
00314 
00315 
00316 /* cairo_array.c structures and functions */ 
00317 
00318 typedef struct _cairo_array cairo_array_t;
00319 struct _cairo_array {
00320     int size;
00321     int num_elements;
00322     int element_size;
00323     char *elements;
00324 };
00325 
00326 cairo_private void
00327 _cairo_array_init (cairo_array_t *array, int element_size);
00328 
00329 cairo_private void
00330 _cairo_array_fini (cairo_array_t *array);
00331 
00332 cairo_private cairo_status_t
00333 _cairo_array_grow_by (cairo_array_t *array, int additional);
00334 
00335 cairo_private void
00336 _cairo_array_truncate (cairo_array_t *array, int length);
00337 
00338 cairo_private void *
00339 _cairo_array_append (cairo_array_t *array,
00340                    const void *elements, int num_elements);
00341 
00342 cairo_private void *
00343 _cairo_array_index (cairo_array_t *array, int index);
00344 
00345 cairo_private void
00346 _cairo_array_copy_element (cairo_array_t *array, int index, void *dst);
00347 
00348 cairo_private int
00349 _cairo_array_num_elements (cairo_array_t *array);
00350 
00351 typedef cairo_array_t cairo_user_data_array_t;
00352 
00353 cairo_private void
00354 _cairo_user_data_array_init (cairo_user_data_array_t *array);
00355 
00356 cairo_private void
00357 _cairo_user_data_array_fini (cairo_user_data_array_t *array);
00358 
00359 cairo_private void *
00360 _cairo_user_data_array_get_data (cairo_user_data_array_t     *array,
00361                              const cairo_user_data_key_t *key);
00362 
00363 cairo_private cairo_status_t
00364 _cairo_user_data_array_set_data (cairo_user_data_array_t     *array,
00365                              const cairo_user_data_key_t *key,
00366                              void                     *user_data,
00367                              cairo_destroy_func_t             destroy);
00368 
00369 /* cairo_cache.c structures and functions */ 
00370 
00371 typedef struct _cairo_cache_backend {
00372 
00373     unsigned long    (*hash)                     (void *cache,
00374                                            void *key);
00375 
00376     int                     (*keys_equal)        (void *cache,
00377                                            void *k1, 
00378                                            void *k2);
00379     
00380     cairo_status_t   (*create_entry)             (void *cache,
00381                                            void *key,
00382                                            void **entry_return);
00383 
00384     void             (*destroy_entry)     (void *cache,
00385                                            void *entry);
00386 
00387     void             (*destroy_cache)     (void *cache);
00388 
00389 } cairo_cache_backend_t;
00390 
00391 /* 
00392  * The cairo_cache system makes the following assumptions about
00393  * entries in its cache:
00394  *
00395  *  - a pointer to an entry can be cast to a cairo_cache_entry_base_t.
00396  *  - a pointer to an entry can also be cast to the "key type".
00397  *
00398  * The practical effect of this is that your entries must be laid
00399  * out this way:
00400  *
00401  *    struct my_entry { 
00402  *      cairo_cache_entry_base_t;
00403  *      my_key_value_1;
00404  *      my_key_value_2;
00405  *      ...
00406  *      my_value;
00407  *    };
00408  */
00409 
00410 typedef struct {
00411     unsigned long memory;
00412     unsigned long hashcode;
00413 } cairo_cache_entry_base_t;
00414 
00415 typedef struct {
00416     unsigned long high_water_mark;
00417     unsigned long size;
00418     unsigned long rehash;
00419 } cairo_cache_arrangement_t;
00420 
00421 #undef CAIRO_MEASURE_CACHE_PERFORMANCE
00422 
00423 typedef struct {
00424     const cairo_cache_backend_t *backend;
00425     const cairo_cache_arrangement_t *arrangement;
00426     cairo_cache_entry_base_t **entries;
00427 
00428     unsigned long max_memory;
00429     unsigned long used_memory;
00430     unsigned long live_entries;
00431 
00432 #ifdef CAIRO_MEASURE_CACHE_PERFORMANCE
00433     unsigned long hits;
00434     unsigned long misses;
00435     unsigned long probes;
00436 #endif
00437 } cairo_cache_t;
00438 
00439 cairo_private cairo_status_t
00440 _cairo_cache_init (cairo_cache_t *cache,
00441                  const cairo_cache_backend_t *backend,
00442                  unsigned long max_memory);
00443 
00444 cairo_private void
00445 _cairo_cache_destroy (cairo_cache_t *cache);
00446 
00447 cairo_private void
00448 _cairo_cache_shrink_to (cairo_cache_t *cache,
00449                      unsigned long max_memory);
00450 
00451 cairo_private cairo_status_t
00452 _cairo_cache_lookup (cairo_cache_t *cache,
00453                    void          *key,
00454                    void         **entry_return,
00455                    int           *created_entry);
00456 
00457 cairo_private cairo_status_t
00458 _cairo_cache_remove (cairo_cache_t *cache,
00459                    void          *key);
00460 
00461 cairo_private void *
00462 _cairo_cache_random_entry (cairo_cache_t *cache,
00463                         int (*predicate) (void*));
00464 
00465 cairo_private unsigned long
00466 _cairo_hash_string (const char *c);
00467 
00468 #define CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT 0x100000
00469 #define CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT 0x100000
00470 
00471 typedef struct _cairo_unscaled_font_backend cairo_unscaled_font_backend_t;
00472 typedef struct _cairo_scaled_font_backend   cairo_scaled_font_backend_t;
00473 typedef struct _cairo_font_face_backend     cairo_font_face_backend_t;
00474 
00475 /*
00476  * A cairo_unscaled_font_t is just an opaque handle we use in the
00477  * glyph cache.
00478  */
00479 typedef struct _cairo_unscaled_font {
00480     cairo_hash_entry_t hash_entry;
00481     int ref_count;
00482     const cairo_unscaled_font_backend_t *backend;
00483 } cairo_unscaled_font_t;
00484 
00485 struct _cairo_font_options {
00486     cairo_antialias_t antialias;
00487     cairo_subpixel_order_t subpixel_order;
00488     cairo_hint_style_t hint_style;
00489     cairo_hint_metrics_t hint_metrics;
00490 };
00491 
00492 struct _cairo_scaled_font {
00493     cairo_hash_entry_t hash_entry;
00494     cairo_status_t status;
00495     int ref_count;
00496     cairo_font_face_t *font_face; /* may be NULL */
00497     cairo_matrix_t font_matrix;      /* font space => user space */
00498     cairo_matrix_t ctm;               /* user space => device space */
00499     cairo_matrix_t scale;     /* font space => device space */
00500     cairo_font_options_t options;
00501 
00502     const cairo_scaled_font_backend_t *backend;
00503 };
00504 
00505 struct _cairo_font_face {
00506     cairo_hash_entry_t hash_entry;
00507     cairo_status_t status;
00508     int ref_count;
00509     cairo_user_data_array_t user_data;
00510     const cairo_font_face_backend_t *backend;
00511 };
00512 
00513 /* cairo_font.c is responsible for a global glyph cache: 
00514  *  
00515  *   - glyph entries: [[[base], cairo_unscaled_font_t, scale, flags, index],
00516  *                     image, size, extents]
00517  *
00518  * Surfaces may build their own glyph caches if they have surface-specific
00519  * glyph resources to maintain; those caches can feed off of the global
00520  * caches if need be (eg. cairo_xlib_surface.c does this).
00521  */
00522 
00523 typedef struct {
00524     cairo_cache_entry_base_t base;
00525     cairo_unscaled_font_t *unscaled;
00526     cairo_matrix_t scale;   /* translation is ignored */
00527     int flags;
00528     unsigned long index;
00529 } cairo_glyph_cache_key_t;
00530 
00531 typedef struct {
00532     cairo_glyph_cache_key_t key;
00533     cairo_image_surface_t *image;
00534     cairo_glyph_size_t size;    
00535     cairo_text_extents_t extents;
00536 } cairo_image_glyph_cache_entry_t;
00537 
00538 cairo_private void
00539 _cairo_lock_global_image_glyph_cache (void);
00540 
00541 cairo_private void
00542 _cairo_unlock_global_image_glyph_cache (void);
00543 
00544 cairo_private cairo_cache_t *
00545 _cairo_get_global_image_glyph_cache (void);
00546 
00547 cairo_private void
00548 _cairo_font_reset_static_data (void);
00549 
00550 cairo_private void
00551 _cairo_ft_font_reset_static_data (void);
00552 
00553 cairo_private void
00554 _cairo_xlib_surface_reset_static_data (void);
00555 
00556 cairo_private void
00557 _cairo_xlib_screen_reset_static_data (void);
00558 
00559 /* Some glyph cache functions you can reuse. */
00560 
00561 cairo_private unsigned long
00562 _cairo_glyph_cache_hash (void *cache, void *key);
00563 
00564 cairo_private int
00565 _cairo_glyph_cache_keys_equal (void *cache,
00566                             void *k1,
00567                             void *k2);
00568 
00569 /* the font backend interface */
00570 
00571 struct _cairo_unscaled_font_backend {
00572     void (*destroy)             (void                         *unscaled_font);
00573     cairo_status_t (*create_glyph)  (void                     *unscaled_font,
00574                                  cairo_image_glyph_cache_entry_t *entry);
00575 };
00576 
00577 /* cairo_toy_font_face_t - simple family/slant/weight font faces used for
00578  * the built-in font API
00579  */
00580 
00581 typedef struct _cairo_toy_font_face {
00582     cairo_font_face_t base;
00583     const char *family;
00584     cairo_bool_t owns_family;
00585     cairo_font_slant_t slant;
00586     cairo_font_weight_t weight;
00587 } cairo_toy_font_face_t;
00588 
00589 struct _cairo_scaled_font_backend {
00590     cairo_status_t
00591     (*create_toy)  (cairo_toy_font_face_t *toy_face,
00592                   const cairo_matrix_t    *font_matrix,
00593                   const cairo_matrix_t    *ctm,
00594                   const cairo_font_options_t     *options,
00595                   cairo_scaled_font_t            **scaled_font);
00596 
00597     void
00598     (*fini)          (void                *scaled_font);
00599 
00600     cairo_status_t
00601     (*font_extents)  (void                *scaled_font,
00602                       cairo_font_extents_t       *extents);
00603 
00604     cairo_status_t
00605     (*text_to_glyphs)       (void                *scaled_font,
00606                       const char          *utf8,
00607                       cairo_glyph_t              **glyphs, 
00608                       int                 *num_glyphs);
00609 
00610     cairo_status_t
00611     (*glyph_extents) (void                *scaled_font,
00612                       cairo_glyph_t              *glyphs, 
00613                       int                  num_glyphs,
00614                       cairo_text_extents_t       *extents);
00615 
00616     cairo_status_t
00617     (*glyph_bbox)    (void                *scaled_font,
00618                       const cairo_glyph_t *glyphs,
00619                       int                  num_glyphs,
00620                       cairo_box_t         *bbox);
00621 
00622     cairo_status_t
00623     (*show_glyphs)   (void                *scaled_font,
00624                       cairo_operator_t     operator,
00625                       cairo_pattern_t     *pattern,
00626                       cairo_surface_t     *surface,
00627                       int                  source_x,
00628                       int                  source_y,
00629                       int                  dest_x,
00630                       int                  dest_y,
00631                       unsigned int         width,
00632                       unsigned int         height,
00633                       const cairo_glyph_t *glyphs,
00634                       int                  num_glyphs);
00635   
00636     cairo_status_t
00637     (*glyph_path)    (void                *scaled_font,
00638                       cairo_glyph_t              *glyphs, 
00639                       int                  num_glyphs,
00640                       cairo_path_fixed_t  *path);
00641 
00642     void
00643     (*get_glyph_cache_key) (void          *scaled_font,
00644                          cairo_glyph_cache_key_t     *key);
00645 };
00646 
00647 struct _cairo_font_face_backend {
00648     /* The destroy() function is allowed to resurrect the font face
00649      * by re-referencing. This is needed for the FreeType backend.
00650      */
00651     void
00652     (*destroy)     (void                  *font_face);
00653 
00654     cairo_status_t
00655     (*scaled_font_create) (void                         *font_face,
00656                         const cairo_matrix_t            *font_matrix,
00657                         const cairo_matrix_t            *ctm,
00658                         const cairo_font_options_t      *options,
00659                         cairo_scaled_font_t             **scaled_font);
00660 };
00661 
00662 /* concrete font backends */
00663 #if CAIRO_HAS_FT_FONT
00664 
00665 extern const cairo_private struct _cairo_scaled_font_backend cairo_ft_scaled_font_backend;
00666 
00667 #endif
00668 
00669 #if CAIRO_HAS_WIN32_FONT
00670 
00671 extern const cairo_private struct _cairo_scaled_font_backend cairo_win32_scaled_font_backend;
00672 
00673 #endif
00674 
00675 #if CAIRO_HAS_ATSUI_FONT
00676 
00677 extern const cairo_private struct _cairo_scaled_font_backend cairo_atsui_scaled_font_backend;
00678 
00679 #endif
00680 
00681 typedef struct _cairo_surface_backend {
00682     cairo_surface_t *
00683     (*create_similar)              (void                *surface,
00684                              cairo_content_t      content,
00685                              int                  width,
00686                              int                  height);
00687 
00688     cairo_status_t
00689     (*finish)               (void                *surface);
00690 
00691     cairo_status_t
00692     (*acquire_source_image) (void                    *abstract_surface,
00693                              cairo_image_surface_t  **image_out,
00694                              void                   **image_extra);
00695 
00696     void
00697     (*release_source_image) (void                   *abstract_surface,
00698                              cairo_image_surface_t  *image,
00699                              void                   *image_extra);
00700 
00701     cairo_status_t
00702     (*acquire_dest_image)       (void                   *abstract_surface,
00703                              cairo_rectangle_t       *interest_rect,
00704                              cairo_image_surface_t  **image_out,
00705                              cairo_rectangle_t       *image_rect,
00706                              void                   **image_extra);
00707 
00708     void
00709     (*release_dest_image)       (void                   *abstract_surface,
00710                              cairo_rectangle_t      *interest_rect,
00711                              cairo_image_surface_t  *image,
00712                              cairo_rectangle_t      *image_rect,
00713                              void                   *image_extra);
00714 
00715     cairo_status_t
00716     (*clone_similar)            (void                   *surface,
00717                              cairo_surface_t        *src,
00718                              cairo_surface_t       **clone_out);
00719                              
00720     /* XXX: dst should be the first argument for consistency */
00721     cairo_int_status_t
00722     (*composite)            (cairo_operator_t     operator,
00723                              cairo_pattern_t            *src,
00724                              cairo_pattern_t     *mask,
00725                              void                *dst,
00726                              int                  src_x,
00727                              int                  src_y,
00728                              int                  mask_x,
00729                              int                  mask_y,
00730                              int                  dst_x,
00731                              int                  dst_y,
00732                              unsigned int         width,
00733                              unsigned int         height);
00734 
00735     cairo_int_status_t
00736     (*fill_rectangles)             (void                *surface,
00737                              cairo_operator_t     operator,
00738                              const cairo_color_t *color,
00739                              cairo_rectangle_t   *rects,
00740                              int                  num_rects);
00741 
00742     /* XXX: dst should be the first argument for consistency */
00743     cairo_int_status_t
00744     (*composite_trapezoids) (cairo_operator_t     operator,
00745                              cairo_pattern_t     *pattern,
00746                              void                *dst,
00747                              cairo_antialias_t    antialias,
00748                              int                  src_x,
00749                              int                  src_y,
00750                              int                  dst_x,
00751                              int                  dst_y,
00752                              unsigned int         width,
00753                              unsigned int         height,
00754                              cairo_trapezoid_t   *traps,
00755                              int                  num_traps);
00756 
00757     cairo_int_status_t
00758     (*copy_page)            (void                *surface);
00759 
00760     cairo_int_status_t
00761     (*show_page)            (void                *surface);
00762 
00763     /* Set given region as the clip region for the surface, replacing
00764      * any previously set clip region.  Passing in a NULL region will
00765      * clear the surface clip region.
00766      *
00767      * The surface is expected to store the clip region and clip all
00768      * following drawing operations against it until the clip region
00769      * is cleared of replaced by another clip region.
00770      *
00771      * Cairo will call this function whenever a clip path can be
00772      * represented as a device pixel aligned set of rectangles.  When
00773      * this is not possible, cairo will use mask surfaces for
00774      * clipping.
00775      */
00776     cairo_int_status_t
00777     (*set_clip_region)             (void                *surface,
00778                              pixman_region16_t   *region);
00779 
00780     /* Intersect the given path against the clip path currently set in
00781      * the surface, using the given fill_rule and tolerance, and set
00782      * the result as the new clipping path for the surface.  Passing
00783      * in a NULL path will clear the surface clipping path.
00784      *
00785      * The surface is expected to store the resulting clip path and
00786      * clip all following drawing operations against it until the clip
00787      * path cleared or intersected with a new path.
00788      *
00789      * If a surface implements this function, set_clip_region() will
00790      * never be called and should not be implemented.  If this
00791      * function is not implemented cairo will use set_clip_region()
00792      * (if available) and mask surfaces for clipping.
00793      */
00794     cairo_int_status_t
00795     (*intersect_clip_path)  (void                *dst,
00796                              cairo_path_fixed_t  *path,
00797                              cairo_fill_rule_t   fill_rule,
00798                              double                     tolerance,
00799                              cairo_antialias_t   antialias);
00800 
00801     /* Get the extents of the current surface. For many surface types
00802      * this will be as simple as { x=0, y=0, width=surface->width,
00803      * height=surface->height}.
00804      *
00805      * This function need not take account of any clipping from
00806      * set_clip_region since the generic version of set_clip_region
00807      * saves those, and the generic get_clip_extents will only call
00808      * into the specific surface->get_extents if there is no current
00809      * clip.
00810      */
00811     cairo_int_status_t
00812     (*get_extents)          (void                *surface,
00813                              cairo_rectangle_t   *rectangle);
00814 
00815     /* 
00816      * This is an optional entry to let the surface manage its own glyph
00817      * resources. If null, the font will be asked to render against this
00818      * surface, using image surfaces as glyphs. 
00819      */    
00820     cairo_int_status_t 
00821     (*show_glyphs)          (cairo_scaled_font_t         *font,
00822                              cairo_operator_t            operator,
00823                              cairo_pattern_t            *pattern,
00824                              void                       *surface,
00825                              int                         source_x,
00826                              int                         source_y,
00827                              int                         dest_x,
00828                              int                         dest_y,
00829                              unsigned int                width,
00830                              unsigned int                height,
00831                              const cairo_glyph_t        *glyphs,
00832                              int                         num_glyphs);
00833 
00834     cairo_int_status_t
00835     (*fill_path)            (cairo_operator_t    operator,
00836                              cairo_pattern_t     *pattern,
00837                              void                *dst,
00838                              cairo_path_fixed_t  *path,
00839                              cairo_fill_rule_t   fill_rule,
00840                              double                     tolerance);
00841    
00842     void
00843     (*get_font_options)         (void                  *surface,
00844                              cairo_font_options_t  *options);
00845 
00846     cairo_status_t
00847     (*flush)                    (void                  *surface);
00848 
00849     cairo_status_t
00850     (*mark_dirty_rectangle)     (void                  *surface,
00851                              int                    x,
00852                              int                    y,
00853                              int                    width,
00854                              int                    height);
00855 
00856 } cairo_surface_backend_t;
00857 
00858 typedef struct _cairo_format_masks {
00859     int bpp;
00860     unsigned long alpha_mask;
00861     unsigned long red_mask;
00862     unsigned long green_mask;
00863     unsigned long blue_mask;
00864 } cairo_format_masks_t;
00865 
00866 struct _cairo_surface {
00867     const cairo_surface_backend_t *backend;
00868 
00869     unsigned int ref_count;
00870     cairo_status_t status;
00871     cairo_bool_t finished;
00872     cairo_user_data_array_t user_data;
00873 
00874     double device_x_offset;
00875     double device_y_offset;
00876     double device_x_scale;
00877     double device_y_scale;
00878 
00879     /*
00880      * Each time a clip region is modified, it gets the next value in this
00881      * sequence.  This means that clip regions for this surface are uniquely
00882      * identified andupdates to the clip can be readily identified
00883      */
00884     unsigned int next_clip_serial;
00885     /*
00886      * The serial number of the current clip.  This is set when
00887      * the surface clipping is set.  The gstate can then cheaply
00888      * check whether the surface clipping is already correct before
00889      * performing a rendering operation.
00890      *
00891      * The special value '0' is reserved for the unclipped case.
00892      */
00893     unsigned int current_clip_serial;
00894 };
00895 
00896 struct _cairo_image_surface {
00897     cairo_surface_t base;
00898 
00899     /* libic-specific fields */
00900     cairo_format_t format;
00901     unsigned char *data;
00902     cairo_bool_t owns_data;
00903     cairo_bool_t has_clip;
00904   
00905 
00906     int width;
00907     int height;
00908     int stride;
00909     int depth;
00910 
00911     pixman_image_t *pixman_image;
00912 };
00913 
00914 extern const cairo_private cairo_surface_backend_t cairo_image_surface_backend;
00915 
00916 /* XXX: Right now, the cairo_color structure puts unpremultiplied
00917    color in the doubles and premultiplied color in the shorts. Yes,
00918    this is crazy insane, (but at least we don't export this
00919    madness). I'm still working on a cleaner API, but in the meantime,
00920    at least this does prevent precision loss in color when changing
00921    alpha. */
00922 struct _cairo_color {
00923     double red;
00924     double green;
00925     double blue;
00926     double alpha;
00927 
00928     unsigned short red_short;
00929     unsigned short green_short;
00930     unsigned short blue_short;
00931     unsigned short alpha_short;
00932 };
00933 
00934 typedef enum {
00935     CAIRO_STOCK_WHITE,
00936     CAIRO_STOCK_BLACK,
00937     CAIRO_STOCK_TRANSPARENT
00938 } cairo_stock_t;
00939 
00940 #define CAIRO_EXTEND_DEFAULT CAIRO_EXTEND_NONE
00941 #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_BEST
00942 
00943 typedef enum {
00944     CAIRO_PATTERN_SOLID,
00945     CAIRO_PATTERN_SURFACE,
00946     CAIRO_PATTERN_LINEAR,
00947     CAIRO_PATTERN_RADIAL
00948 } cairo_pattern_type_t;
00949 
00950 typedef struct _cairo_color_stop {
00951     cairo_fixed_t offset;
00952     cairo_color_t color;
00953 } cairo_color_stop_t;
00954 
00955 struct _cairo_pattern {
00956     cairo_pattern_type_t type;
00957     unsigned int      ref_count;
00958     cairo_status_t       status;
00959     cairo_matrix_t    matrix;
00960     cairo_filter_t    filter;
00961     cairo_extend_t    extend;
00962 };
00963 
00964 typedef struct _cairo_solid_pattern {
00965     cairo_pattern_t base;
00966     cairo_color_t color;
00967 } cairo_solid_pattern_t;
00968 
00969 extern const cairo_private cairo_solid_pattern_t cairo_pattern_nil;
00970 
00971 typedef struct _cairo_surface_pattern {
00972     cairo_pattern_t base;
00973     
00974     cairo_surface_t *surface;
00975 } cairo_surface_pattern_t;
00976 
00977 typedef struct _cairo_gradient_pattern {
00978     cairo_pattern_t base;
00979     
00980     cairo_color_stop_t *stops;
00981     int                     n_stops;
00982 } cairo_gradient_pattern_t;
00983 
00984 typedef struct _cairo_linear_pattern {
00985     cairo_gradient_pattern_t base;
00986 
00987     cairo_point_double_t point0;
00988     cairo_point_double_t point1;
00989 } cairo_linear_pattern_t;
00990 
00991 typedef struct _cairo_radial_pattern {
00992     cairo_gradient_pattern_t base;
00993 
00994     cairo_point_double_t center0;
00995     cairo_point_double_t center1;
00996     double            radius0;
00997     double            radius1;
00998 } cairo_radial_pattern_t;
00999 
01000 typedef union {
01001     cairo_gradient_pattern_t base;
01002 
01003     cairo_linear_pattern_t linear;
01004     cairo_radial_pattern_t radial;
01005 } cairo_gradient_pattern_union_t;
01006 
01007 typedef union {
01008     cairo_pattern_t base;
01009     
01010     cairo_solid_pattern_t      solid;
01011     cairo_surface_pattern_t    surface;
01012     cairo_gradient_pattern_union_t gradient;
01013 } cairo_pattern_union_t;
01014 
01015 typedef struct _cairo_surface_attributes {
01016     cairo_matrix_t matrix;
01017     cairo_extend_t extend;
01018     cairo_filter_t filter;
01019     int                 x_offset;
01020     int                 y_offset;
01021     cairo_bool_t   acquired;
01022     void         *extra;
01023 } cairo_surface_attributes_t;
01024 
01025 typedef struct _cairo_traps {
01026     cairo_trapezoid_t *traps;
01027     int num_traps;
01028     int traps_size;
01029     cairo_box_t extents;
01030 } cairo_traps_t;
01031 
01032 #define CAIRO_FONT_SLANT_DEFAULT   CAIRO_FONT_SLANT_NORMAL
01033 #define CAIRO_FONT_WEIGHT_DEFAULT  CAIRO_FONT_WEIGHT_NORMAL
01034 
01035 #define CAIRO_WIN32_FONT_FAMILY_DEFAULT "Arial"
01036 #define CAIRO_ATSUI_FONT_FAMILY_DEFAULT  "Monaco"
01037 #define CAIRO_FT_FONT_FAMILY_DEFAULT     ""
01038 
01039 #if   CAIRO_HAS_WIN32_FONT
01040 
01041 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT
01042 #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_win32_scaled_font_backend
01043 
01044 #elif CAIRO_HAS_ATSUI_FONT
01045 
01046 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_ATSUI_FONT_FAMILY_DEFAULT
01047 #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_atsui_scaled_font_backend
01048 
01049 #elif CAIRO_HAS_FT_FONT
01050 
01051 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT
01052 #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_ft_scaled_font_backend
01053 
01054 #endif
01055 
01056 #define CAIRO_GSTATE_OPERATOR_DEFAULT     CAIRO_OPERATOR_OVER
01057 #define CAIRO_GSTATE_TOLERANCE_DEFAULT    0.1
01058 #define CAIRO_GSTATE_FILL_RULE_DEFAULT    CAIRO_FILL_RULE_WINDING
01059 #define CAIRO_GSTATE_LINE_WIDTH_DEFAULT   2.0
01060 #define CAIRO_GSTATE_LINE_CAP_DEFAULT     CAIRO_LINE_CAP_BUTT
01061 #define CAIRO_GSTATE_LINE_JOIN_DEFAULT    CAIRO_LINE_JOIN_MITER
01062 #define CAIRO_GSTATE_MITER_LIMIT_DEFAULT  10.0
01063 #define CAIRO_GSTATE_DEFAULT_FONT_SIZE  10.0
01064 
01065 typedef struct _cairo_gstate cairo_gstate_t;
01066 
01067 typedef struct _cairo_stroke_face {
01068     cairo_point_t ccw;
01069     cairo_point_t point;
01070     cairo_point_t cw;
01071     cairo_slope_t dev_vector;
01072     cairo_point_double_t usr_vector;
01073 } cairo_stroke_face_t;
01074 
01075 /* cairo.c */
01076 cairo_private void
01077 _cairo_restrict_value (double *value, double min, double max);
01078 
01079 /* cairo_fixed.c */
01080 cairo_private cairo_fixed_t
01081 _cairo_fixed_from_int (int i);
01082 
01083 cairo_private cairo_fixed_t
01084 _cairo_fixed_from_double (double d);
01085 
01086 cairo_private cairo_fixed_t
01087 _cairo_fixed_from_26_6 (uint32_t i);
01088 
01089 cairo_private double
01090 _cairo_fixed_to_double (cairo_fixed_t f);
01091 
01092 cairo_private int
01093 _cairo_fixed_is_integer (cairo_fixed_t f);
01094 
01095 cairo_private int
01096 _cairo_fixed_integer_part (cairo_fixed_t f);
01097 
01098 cairo_private int
01099 _cairo_fixed_integer_floor (cairo_fixed_t f);
01100 
01101 cairo_private int
01102 _cairo_fixed_integer_ceil (cairo_fixed_t f);
01103 
01104 /* cairo_gstate.c */
01105 cairo_private cairo_gstate_t *
01106 _cairo_gstate_create (cairo_surface_t *target);
01107 
01108 cairo_private void
01109 _cairo_gstate_destroy (cairo_gstate_t *gstate);
01110 
01111 cairo_private cairo_gstate_t *
01112 _cairo_gstate_clone (cairo_gstate_t *gstate);
01113 
01114 cairo_private cairo_status_t
01115 _cairo_gstate_begin_group (cairo_gstate_t *gstate);
01116 
01117 cairo_private cairo_status_t
01118 _cairo_gstate_end_group (cairo_gstate_t *gstate);
01119 
01120 cairo_private cairo_surface_t *
01121 _cairo_gstate_get_target (cairo_gstate_t *gstate);
01122 
01123 cairo_private cairo_status_t
01124 _cairo_gstate_set_source (cairo_gstate_t *gstate, cairo_pattern_t *source);
01125 
01126 cairo_private cairo_pattern_t *
01127 _cairo_gstate_get_source (cairo_gstate_t *gstate);
01128 
01129 cairo_private cairo_status_t
01130 _cairo_gstate_set_operator (cairo_gstate_t *gstate, cairo_operator_t operator);
01131 
01132 cairo_private cairo_operator_t
01133 _cairo_gstate_get_operator (cairo_gstate_t *gstate);
01134 
01135 cairo_private cairo_status_t
01136 _cairo_gstate_set_tolerance (cairo_gstate_t *gstate, double tolerance);
01137 
01138 cairo_private double
01139 _cairo_gstate_get_tolerance (cairo_gstate_t *gstate);
01140 
01141 cairo_private cairo_status_t
01142 _cairo_gstate_set_fill_rule (cairo_gstate_t *gstate, cairo_fill_rule_t fill_rule);
01143 
01144 cairo_private cairo_fill_rule_t
01145 _cairo_gstate_get_fill_rule (cairo_gstate_t *gstate);
01146 
01147 cairo_private cairo_status_t
01148 _cairo_gstate_set_line_width (cairo_gstate_t *gstate, double width);
01149 
01150 cairo_private double
01151 _cairo_gstate_get_line_width (cairo_gstate_t *gstate);
01152 
01153 cairo_private cairo_status_t
01154 _cairo_gstate_set_line_cap (cairo_gstate_t *gstate, cairo_line_cap_t line_cap);
01155 
01156 cairo_private cairo_line_cap_t
01157 _cairo_gstate_get_line_cap (cairo_gstate_t *gstate);
01158 
01159 cairo_private cairo_status_t
01160 _cairo_gstate_set_line_join (cairo_gstate_t *gstate, cairo_line_join_t line_join);
01161 
01162 cairo_private cairo_line_join_t
01163 _cairo_gstate_get_line_join (cairo_gstate_t *gstate);
01164 
01165 cairo_private cairo_status_t
01166 _cairo_gstate_set_dash (cairo_gstate_t *gstate, double *dash, int num_dashes, double offset);
01167 
01168 cairo_private cairo_status_t
01169 _cairo_gstate_set_miter_limit (cairo_gstate_t *gstate, double limit);
01170 
01171 cairo_private double
01172 _cairo_gstate_get_miter_limit (cairo_gstate_t *gstate);
01173 
01174 cairo_private void
01175 _cairo_gstate_get_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix);
01176 
01177 cairo_private cairo_status_t
01178 _cairo_gstate_translate (cairo_gstate_t *gstate, double tx, double ty);
01179 
01180 cairo_private cairo_status_t
01181 _cairo_gstate_scale (cairo_gstate_t *gstate, double sx, double sy);
01182 
01183 cairo_private cairo_status_t
01184 _cairo_gstate_rotate (cairo_gstate_t *gstate, double angle);
01185 
01186 cairo_private cairo_status_t
01187 _cairo_gstate_transform (cairo_gstate_t         *gstate,
01188                       const cairo_matrix_t *matrix);
01189 
01190 cairo_private cairo_status_t
01191 _cairo_gstate_set_matrix (cairo_gstate_t       *gstate,
01192                        const cairo_matrix_t *matrix);
01193 
01194 cairo_private cairo_status_t
01195 _cairo_gstate_identity_matrix (cairo_gstate_t *gstate);
01196 
01197 cairo_private cairo_status_t
01198 _cairo_gstate_user_to_device (cairo_gstate_t *gstate, double *x, double *y);
01199 
01200 cairo_private cairo_status_t
01201 _cairo_gstate_user_to_device_distance (cairo_gstate_t *gstate, double *dx, double *dy);
01202 
01203 cairo_private cairo_status_t
01204 _cairo_gstate_device_to_user (cairo_gstate_t *gstate, double *x, double *y);
01205 
01206 cairo_private cairo_status_t
01207 _cairo_gstate_device_to_user_distance (cairo_gstate_t *gstate, double *dx, double *dy);
01208 
01209 cairo_private void
01210 _cairo_gstate_user_to_backend (cairo_gstate_t *gstate, double *x, double *y);
01211 
01212 cairo_private void
01213 _cairo_gstate_backend_to_user (cairo_gstate_t *gstate, double *x, double *y);
01214 
01215 cairo_private cairo_status_t
01216 _cairo_gstate_paint (cairo_gstate_t *gstate);
01217 
01218 cairo_private cairo_status_t
01219 _cairo_gstate_mask (cairo_gstate_t  *gstate,
01220                   cairo_pattern_t *mask);
01221 
01222 cairo_private cairo_status_t
01223 _cairo_gstate_stroke (cairo_gstate_t *gstate, cairo_path_fixed_t *path);
01224 
01225 cairo_private cairo_status_t
01226 _cairo_gstate_fill (cairo_gstate_t *gstate, cairo_path_fixed_t *path);
01227 
01228 cairo_private cairo_status_t
01229 _cairo_gstate_copy_page (cairo_gstate_t *gstate);
01230 
01231 cairo_private cairo_status_t
01232 _cairo_gstate_show_page (cairo_gstate_t *gstate);
01233 
01234 cairo_private cairo_status_t
01235 _cairo_gstate_stroke_extents (cairo_gstate_t      *gstate,
01236                            cairo_path_fixed_t *path,
01237                               double *x1, double *y1,
01238                            double *x2, double *y2);
01239 
01240 cairo_private cairo_status_t
01241 _cairo_gstate_fill_extents (cairo_gstate_t     *gstate,
01242                          cairo_path_fixed_t *path,
01243                             double *x1, double *y1,
01244                          double *x2, double *y2);
01245 
01246 cairo_private cairo_status_t
01247 _cairo_gstate_in_stroke (cairo_gstate_t       *gstate,
01248                       cairo_path_fixed_t *path,
01249                       double                   x,
01250                       double                   y,
01251                       cairo_bool_t     *inside_ret);
01252 
01253 cairo_private cairo_status_t
01254 _cairo_gstate_in_fill (cairo_gstate_t       *gstate,
01255                      cairo_path_fixed_t *path,
01256                      double           x,
01257                      double           y,
01258                      cairo_bool_t    *inside_ret);
01259 
01260 cairo_private cairo_status_t
01261 _cairo_gstate_clip (cairo_gstate_t *gstate, cairo_path_fixed_t *path);
01262 
01263 cairo_private cairo_status_t
01264 _cairo_gstate_reset_clip (cairo_gstate_t *gstate);
01265 
01266 cairo_private cairo_status_t
01267 _cairo_gstate_show_surface (cairo_gstate_t       *gstate,
01268                          cairo_surface_t  *surface,
01269                          double            x,
01270                          double            y,
01271                          double           width,
01272                          double           height);
01273 
01274 cairo_private cairo_status_t
01275 _cairo_gstate_select_font_face (cairo_gstate_t *gstate, 
01276                             const char *family, 
01277                             cairo_font_slant_t slant, 
01278                             cairo_font_weight_t weight);
01279 
01280 cairo_private cairo_status_t
01281 _cairo_gstate_set_font_size (cairo_gstate_t *gstate, 
01282                           double          size);
01283 
01284 cairo_private void
01285 _cairo_gstate_get_font_matrix (cairo_gstate_t *gstate,
01286                             cairo_matrix_t *matrix);
01287      
01288 cairo_private cairo_status_t
01289 _cairo_gstate_set_font_matrix (cairo_gstate_t        *gstate, 
01290                             const cairo_matrix_t *matrix);
01291 
01292 cairo_private void
01293 _cairo_gstate_get_font_options (cairo_gstate_t       *gstate,
01294                             cairo_font_options_t *options);
01295      
01296 cairo_private cairo_status_t
01297 _cairo_gstate_set_font_options (cairo_gstate_t              *gstate, 
01298                             const cairo_font_options_t *options);
01299 
01300 cairo_private cairo_status_t
01301 _cairo_gstate_get_font_face (cairo_gstate_t     *gstate, 
01302                           cairo_font_face_t **font_face);
01303 
01304 cairo_private cairo_status_t
01305 _cairo_gstate_get_font_extents (cairo_gstate_t *gstate, 
01306                             cairo_font_extents_t *extents);
01307 
01308 cairo_private cairo_status_t
01309 _cairo_gstate_set_font_face (cairo_gstate_t    *gstate, 
01310                           cairo_font_face_t *font_face);
01311 
01312 cairo_private cairo_status_t
01313 _cairo_gstate_text_to_glyphs (cairo_gstate_t *font,
01314                            const char     *utf8, 
01315                            double        x,
01316                            double        y,
01317                            cairo_glyph_t **glyphs, 
01318                            int          *num_glyphs);
01319 
01320 cairo_private cairo_status_t
01321 _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
01322                           cairo_glyph_t *glyphs, 
01323                           int num_glyphs,
01324                           cairo_text_extents_t *extents);
01325 
01326 cairo_private cairo_status_t
01327 _cairo_gstate_show_glyphs (cairo_gstate_t *gstate, 
01328                         cairo_glyph_t *glyphs, 
01329                         int num_glyphs);
01330 
01331 cairo_private cairo_status_t
01332 _cairo_gstate_glyph_path (cairo_gstate_t     *gstate, 
01333                        cairo_glyph_t           *glyphs, 
01334                        int               num_glyphs,
01335                        cairo_path_fixed_t *path);
01336 
01337 cairo_private cairo_bool_t
01338 _cairo_operator_bounded (cairo_operator_t operator);
01339 
01340 /* cairo_color.c */
01341 cairo_private const cairo_color_t *
01342 _cairo_stock_color (cairo_stock_t stock);
01343 
01344 #define CAIRO_COLOR_WHITE       _cairo_stock_color (CAIRO_STOCK_WHITE)
01345 #define CAIRO_COLOR_BLACK       _cairo_stock_color (CAIRO_STOCK_BLACK)
01346 #define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT)
01347 
01348 cairo_private void
01349 _cairo_color_init (cairo_color_t *color);
01350 
01351 cairo_private void
01352 _cairo_color_init_rgb (cairo_color_t *color,
01353                      double red, double green, double blue);
01354 
01355 cairo_private void
01356 _cairo_color_init_rgba (cairo_color_t *color,
01357                      double red, double green, double blue,
01358                      double alpha);
01359 
01360 cairo_private void
01361 _cairo_color_multiply_alpha (cairo_color_t *color,
01362                           double       alpha);
01363 
01364 cairo_private void
01365 _cairo_color_get_rgba (cairo_color_t *color,
01366                      double      *red,
01367                      double      *green,
01368                      double      *blue,
01369                      double      *alpha);
01370 
01371 cairo_private void
01372 _cairo_color_get_rgba_premultiplied (cairo_color_t *color,
01373                                  double      *red,
01374                                  double      *green,
01375                                  double      *blue,
01376                                  double      *alpha);
01377 
01378 /* cairo-font.c */
01379 
01380 cairo_private void
01381 _cairo_scaled_font_set_error (cairo_scaled_font_t *scaled_font,
01382                            cairo_status_t status);
01383 
01384 extern const cairo_private cairo_font_face_t _cairo_font_face_nil;
01385 
01386 cairo_private void
01387 _cairo_font_face_init (cairo_font_face_t               *font_face,
01388                      const cairo_font_face_backend_t *backend);
01389 
01390 cairo_private cairo_font_face_t *
01391 _cairo_toy_font_face_create (const char           *family,
01392                           cairo_font_slant_t    slant,
01393                           cairo_font_weight_t   weight);
01394 
01395 cairo_private void
01396 _cairo_unscaled_font_init (cairo_unscaled_font_t               *font, 
01397                         const cairo_unscaled_font_backend_t *backend);
01398 
01399 cairo_private cairo_unscaled_font_t *
01400 _cairo_unscaled_font_reference (cairo_unscaled_font_t *font);
01401 
01402 cairo_private void
01403 _cairo_unscaled_font_destroy (cairo_unscaled_font_t *font);
01404 
01405 cairo_private void
01406 _cairo_scaled_font_init (cairo_scaled_font_t                *scaled_font, 
01407                       cairo_font_face_t             *font_face,
01408                       const cairo_matrix_t              *font_matrix,
01409                       const cairo_matrix_t              *ctm,
01410                       const cairo_font_options_t        *options,
01411                       const cairo_scaled_font_backend_t *backend);
01412 
01413 void
01414 _cairo_scaled_font_fini (cairo_scaled_font_t *scaled_font);
01415 
01416 cairo_private cairo_status_t
01417 _cairo_scaled_font_font_extents (cairo_scaled_font_t  *scaled_font, 
01418                              cairo_font_extents_t *extents);
01419 
01420 cairo_private cairo_status_t
01421 _cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t  *scaled_font,
01422                                const char           *utf8, 
01423                                cairo_glyph_t       **glyphs, 
01424                                int                       *num_glyphs);
01425 
01426 cairo_private cairo_status_t
01427 _cairo_scaled_font_glyph_extents (cairo_scaled_font_t   *scaled_font,
01428                               cairo_glyph_t      *glyphs,
01429                               int                num_glyphs,
01430                               cairo_text_extents_t *extents);
01431 
01432 cairo_private cairo_status_t
01433 _cairo_scaled_font_glyph_bbox (cairo_scaled_font_t   *scaled_font,
01434                             cairo_glyph_t         *glyphs,
01435                             int                    num_glyphs,
01436                             cairo_box_t        *bbox);
01437 
01438 cairo_private cairo_status_t
01439 _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font,
01440                             cairo_operator_t     operator,
01441                             cairo_pattern_t          *source,
01442                             cairo_surface_t          *surface,
01443                             int                source_x,
01444                             int                source_y,
01445                             int                dest_x,
01446                             int                dest_y,
01447                             unsigned int       width,
01448                             unsigned int       height,
01449                             cairo_glyph_t     *glyphs,
01450                             int                num_glyphs);
01451 
01452 cairo_private cairo_status_t
01453 _cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font,
01454                             cairo_glyph_t       *glyphs, 
01455                             int                  num_glyphs,
01456                             cairo_path_fixed_t  *path);
01457 
01458 cairo_private cairo_status_t
01459 _cairo_scaled_font_get_glyph_cache_key (cairo_scaled_font_t     *scaled_font,
01460                                    cairo_glyph_cache_key_t *key);
01461 
01462 /* cairo-font-options.c */
01463 
01464 cairo_private void
01465 _cairo_font_options_init_default (cairo_font_options_t *options);
01466 
01467 /* cairo_hull.c */
01468 cairo_private cairo_status_t
01469 _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices);
01470 
01471 /* cairo_path.c */
01472 cairo_private void
01473 _cairo_path_fixed_init (cairo_path_fixed_t *path);
01474 
01475 cairo_private cairo_status_t
01476 _cairo_path_fixed_init_copy (cairo_path_fixed_t *path,
01477                           cairo_path_fixed_t *other);
01478 
01479 cairo_private void
01480 _cairo_path_fixed_fini (cairo_path_fixed_t *path);
01481 
01482 cairo_private cairo_status_t
01483 _cairo_path_fixed_move_to (cairo_path_fixed_t  *path,
01484                         cairo_fixed_t     x,
01485                         cairo_fixed_t     y);
01486 
01487 cairo_private cairo_status_t
01488 _cairo_path_fixed_rel_move_to (cairo_path_fixed_t *path,
01489                             cairo_fixed_t    dx,
01490                             cairo_fixed_t    dy);
01491 
01492 cairo_private cairo_status_t
01493 _cairo_path_fixed_line_to (cairo_path_fixed_t *path,
01494                         cairo_fixed_t     x,
01495                         cairo_fixed_t     y);
01496 
01497 cairo_private cairo_status_t
01498 _cairo_path_fixed_rel_line_to (cairo_path_fixed_t *path,
01499                             cairo_fixed_t    dx,
01500                             cairo_fixed_t    dy);
01501 
01502 cairo_private cairo_status_t
01503 _cairo_path_fixed_curve_to (cairo_path_fixed_t   *path,
01504                          cairo_fixed_t x0, cairo_fixed_t y0,
01505                          cairo_fixed_t x1, cairo_fixed_t y1,
01506                          cairo_fixed_t x2, cairo_fixed_t y2);
01507 
01508 cairo_private cairo_status_t
01509 _cairo_path_fixed_rel_curve_to (cairo_path_fixed_t *path,
01510                             cairo_fixed_t dx0, cairo_fixed_t dy0,
01511                             cairo_fixed_t dx1, cairo_fixed_t dy1,
01512                             cairo_fixed_t dx2, cairo_fixed_t dy2);
01513 
01514 cairo_private cairo_status_t
01515 _cairo_path_fixed_close_path (cairo_path_fixed_t *path);
01516 
01517 cairo_private cairo_status_t
01518 _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path,
01519                                  cairo_fixed_t   *x,
01520                                  cairo_fixed_t   *y);
01521 
01522 typedef cairo_status_t
01523 (cairo_path_fixed_move_to_func_t) (void           *closure,
01524                                cairo_point_t *point);
01525 
01526 typedef cairo_status_t
01527 (cairo_path_fixed_line_to_func_t) (void           *closure,
01528                                cairo_point_t *point);
01529 
01530 typedef cairo_status_t
01531 (cairo_path_fixed_curve_to_func_t) (void    *closure,
01532                                 cairo_point_t *p0,
01533                                 cairo_point_t *p1,
01534                                 cairo_point_t *p2);
01535 
01536 typedef cairo_status_t
01537 (cairo_path_fixed_close_path_func_t) (void *closure);
01538 
01539 cairo_private cairo_status_t
01540 _cairo_path_fixed_interpret (cairo_path_fixed_t           *path,
01541                      cairo_direction_t              dir,
01542                      cairo_path_fixed_move_to_func_t      *move_to,
01543                      cairo_path_fixed_line_to_func_t      *line_to,
01544                      cairo_path_fixed_curve_to_func_t     *curve_to,
01545                      cairo_path_fixed_close_path_func_t *close_path,
01546                      void                          *closure);
01547 
01548 cairo_private cairo_status_t
01549 _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
01550                        double *x1, double *y1,
01551                        double *x2, double *y2);
01552 
01553 /* cairo_path_fill.c */
01554 cairo_private cairo_status_t
01555 _cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path,
01556                              cairo_fill_rule_t   fill_rule,
01557                              double              tolerance,
01558                              cairo_traps_t      *traps);
01559 
01560 /* cairo_path_stroke.c */
01561 cairo_private cairo_status_t
01562 _cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path,
01563                                cairo_gstate_t     *gstate,
01564                                cairo_traps_t      *traps);
01565 
01566 /* cairo-surface.c */
01567 
01568 extern const cairo_private cairo_surface_t _cairo_surface_nil;
01569 extern const cairo_private cairo_surface_t _cairo_surface_nil_read_error;
01570 extern const cairo_private cairo_surface_t _cairo_surface_nil_file_not_found;
01571 
01572 cairo_private cairo_surface_t *
01573 _cairo_surface_create_similar_scratch (cairo_surface_t *other,
01574                                    cairo_content_t      content,
01575                                    int           width,
01576                                    int           height);
01577 
01578 cairo_private cairo_surface_t *
01579 _cairo_surface_create_similar_solid (cairo_surface_t     *other,
01580                                  cairo_content_t   content,
01581                                  int               width,
01582                                  int               height,
01583                                  const cairo_color_t *color);
01584 
01585 cairo_private void
01586 _cairo_surface_init (cairo_surface_t                    *surface,
01587                    const cairo_surface_backend_t *backend);
01588 
01589 cairo_private cairo_clip_mode_t
01590 _cairo_surface_get_clip_mode (cairo_surface_t *surface);
01591 
01592 cairo_private cairo_status_t
01593 _cairo_surface_composite (cairo_operator_t       operator,
01594                        cairo_pattern_t    *src,
01595                        cairo_pattern_t    *mask,
01596                        cairo_surface_t    *dst,
01597                        int                src_x,
01598                        int                src_y,
01599                        int                mask_x,
01600                        int                mask_y,
01601                        int                dst_x,
01602                        int                dst_y,
01603                        unsigned int              width,
01604                        unsigned int              height);
01605 
01606 cairo_private cairo_status_t
01607 _cairo_surface_fill_rectangle (cairo_surface_t      *surface,
01608                             cairo_operator_t         operator,
01609                             const cairo_color_t *color,
01610                             int               x,
01611                             int               y,
01612                             int               width,
01613                             int               height);
01614 
01615 cairo_private cairo_status_t
01616 _cairo_surface_fill_region (cairo_surface_t         *surface,
01617                          cairo_operator_t     operator,
01618                          const cairo_color_t    *color,
01619                          pixman_region16_t      *region);
01620 
01621 cairo_private cairo_status_t
01622 _cairo_surface_fill_rectangles (cairo_surface_t         *surface,
01623                             cairo_operator_t     operator,
01624                             const cairo_color_t  *color,
01625                             cairo_rectangle_t    *rects,
01626                             int                  num_rects);
01627 
01628 cairo_private cairo_int_status_t
01629 _cairo_surface_fill_path (cairo_operator_t       operator,
01630                        cairo_pattern_t    *pattern,
01631                        cairo_surface_t    *dst,
01632                        cairo_path_fixed_t *path,
01633                        cairo_fill_rule_t  fill_rule,
01634                        double             tolerance);
01635   
01636 cairo_private cairo_status_t
01637 _cairo_surface_composite_trapezoids (cairo_operator_t   operator,
01638                                  cairo_pattern_t *pattern,
01639                                  cairo_surface_t *dst,
01640                                  cairo_antialias_t      antialias,
01641                                  int             src_x,
01642                                  int             src_y,
01643                                  int             dst_x,
01644                                  int             dst_y,
01645                                  unsigned int    width,
01646                                  unsigned int    height,
01647                                  cairo_trapezoid_t      *traps,
01648                                  int             ntraps);
01649 
01650 cairo_private cairo_status_t
01651 _cairo_surface_clip_and_composite_trapezoids (cairo_pattern_t *src,
01652                                          cairo_operator_t operator,
01653                                          cairo_surface_t *dst,
01654                                          cairo_traps_t *traps,
01655                                          cairo_clip_t *clip,
01656                                          cairo_antialias_t antialias);
01657 
01658 cairo_private cairo_status_t
01659 _cairo_surface_copy_page (cairo_surface_t *surface);
01660 
01661 cairo_private cairo_status_t
01662 _cairo_surface_show_page (cairo_surface_t *surface);
01663 
01664 cairo_private cairo_status_t
01665 _cairo_surface_acquire_source_image (cairo_surface_t         *surface,
01666                                  cairo_image_surface_t  **image_out,
01667                                  void                   **image_extra);
01668 
01669 cairo_private void
01670 _cairo_surface_release_source_image (cairo_surface_t        *surface,
01671                                  cairo_image_surface_t  *image,
01672                                  void                   *image_extra);
01673 
01674 cairo_private cairo_status_t
01675 _cairo_surface_acquire_dest_image (cairo_surface_t         *surface,
01676                                cairo_rectangle_t       *interest_rect,
01677                                cairo_image_surface_t  **image_out,
01678                                cairo_rectangle_t       *image_rect,
01679                                void                   **image_extra);
01680 
01681 cairo_private void
01682 _cairo_surface_release_dest_image (cairo_surface_t        *surface,
01683                                cairo_rectangle_t      *interest_rect,
01684                                cairo_image_surface_t  *image,
01685                                cairo_rectangle_t      *image_rect,
01686                                void                   *image_extra);
01687     
01688 cairo_private cairo_status_t
01689 _cairo_surface_clone_similar (cairo_surface_t  *surface,
01690                            cairo_surface_t  *src,
01691                            cairo_surface_t **clone_out);
01692 
01693 cairo_private unsigned int
01694 _cairo_surface_get_current_clip_serial (cairo_surface_t *surface);
01695 
01696 cairo_private unsigned int
01697 _cairo_surface_allocate_clip_serial (cairo_surface_t *surface);
01698 
01699 cairo_private cairo_status_t
01700 _cairo_surface_reset_clip (cairo_surface_t *surface);
01701 
01702 cairo_private cairo_status_t
01703 _cairo_surface_set_clip_region (cairo_surface_t      *surface,
01704                             pixman_region16_t   *region,
01705                             unsigned int      serial);
01706 
01707 cairo_private cairo_int_status_t
01708 _cairo_surface_intersect_clip_path (cairo_surface_t    *surface,
01709                                 cairo_path_fixed_t *path,
01710                                 cairo_fill_rule_t   fill_rule,
01711                                 double           tolerance,
01712                                 cairo_antialias_t       antialias);
01713 
01714 cairo_private cairo_status_t
01715 _cairo_surface_set_clip (cairo_surface_t *surface, cairo_clip_t *clip);
01716 
01717 cairo_private cairo_status_t
01718 _cairo_surface_get_extents (cairo_surface_t   *surface,
01719                          cairo_rectangle_t *rectangle);
01720 
01721 cairo_private cairo_status_t
01722 _cairo_surface_show_glyphs (cairo_scaled_font_t          *scaled_font,
01723                          cairo_operator_t        operator,
01724                          cairo_pattern_t         *pattern,
01725                          cairo_surface_t         *surface,
01726                          int                            source_x,
01727                          int                            source_y,
01728                          int                            dest_x,
01729                          int                            dest_y,
01730                          unsigned int            width,
01731                          unsigned int            height,
01732                          const cairo_glyph_t            *glyphs,
01733                          int                            num_glyphs);
01734 
01735 cairo_private cairo_status_t
01736 _cairo_surface_composite_fixup_unbounded (cairo_surface_t            *dst,
01737                                      cairo_surface_attributes_t *src_attr,
01738                                      int                         src_width,
01739                                      int                         src_height,
01740                                      cairo_surface_attributes_t *mask_attr,
01741                                      int                         mask_width,
01742                                      int                         mask_height,
01743                                      int                      src_x,
01744                                      int                      src_y,
01745                                      int                      mask_x,
01746                                      int                      mask_y,
01747                                      int                      dst_x,
01748                                      int                      dst_y,
01749                                      unsigned int                    width,
01750                                      unsigned int                    height);
01751 
01752 cairo_private cairo_status_t
01753 _cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t            *dst,
01754                                           cairo_surface_attributes_t *src_attr,
01755                                           int                         src_width,
01756                                           int                         src_height,
01757                                           int                         mask_width,
01758                                           int                         mask_height,
01759                                           int                      src_x,
01760                                           int                      src_y,
01761                                           int                      mask_x,
01762                                           int                      mask_y,
01763                                           int                      dst_x,
01764                                           int                      dst_y,
01765                                           unsigned int             width,
01766                                           unsigned int             height);
01767 
01768 /* cairo_image_surface.c */
01769 
01770 #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \
01771                                 (format) <= CAIRO_FORMAT_A1)
01772 
01773 #define CAIRO_CONTENT_VALID(content) ((content) &&                             \
01774                                   (((content) & ~(CAIRO_CONTENT_COLOR |      \
01775                                                 CAIRO_CONTENT_ALPHA |      \
01776                                                 CAIRO_CONTENT_COLOR_ALPHA))\
01777                                    == 0))
01778 
01779 cairo_private cairo_format_t
01780 _cairo_format_from_content (cairo_content_t content);
01781 
01782 cairo_private cairo_content_t
01783 _cairo_content_from_format (cairo_format_t format);
01784 
01785 cairo_private cairo_surface_t *
01786 _cairo_image_surface_create_with_masks (unsigned char          *data,
01787                                    cairo_format_masks_t   *format,
01788                                    int                  width,
01789                                    int                  height,
01790                                    int                  stride);
01791 
01792 cairo_private void
01793 _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface);
01794 
01795 cairo_private cairo_int_status_t
01796 _cairo_image_surface_set_clip_region (cairo_image_surface_t *surface,
01797                                   pixman_region16_t *region);
01798 
01799 cairo_private cairo_bool_t
01800 _cairo_surface_is_image (cairo_surface_t *surface);
01801 
01802 /* cairo_pen.c */
01803 cairo_private cairo_status_t
01804 _cairo_pen_init (cairo_pen_t *pen, double radius, cairo_gstate_t *gstate);
01805 
01806 cairo_private cairo_status_t
01807 _cairo_pen_init_empty (cairo_pen_t *pen);
01808 
01809 cairo_private cairo_status_t
01810 _cairo_pen_init_copy (cairo_pen_t *pen, cairo_pen_t *other);
01811 
01812 cairo_private void
01813 _cairo_pen_fini (cairo_pen_t *pen);
01814 
01815 cairo_private cairo_status_t
01816 _cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points);
01817 
01818 cairo_private cairo_status_t
01819 _cairo_pen_add_points_for_slopes (cairo_pen_t *pen,
01820                               cairo_point_t *a,
01821                               cairo_point_t *b,
01822                               cairo_point_t *c,
01823                               cairo_point_t *d);
01824 
01825 cairo_private cairo_status_t
01826 _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
01827                                    cairo_slope_t *slope,
01828                                    int *active);
01829 
01830 cairo_private cairo_status_t
01831 _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
01832                                     cairo_slope_t *slope,
01833                                     int *active);
01834 
01835 cairo_private cairo_status_t
01836 _cairo_pen_stroke_spline (cairo_pen_t *pen,
01837                        cairo_spline_t *spline,
01838                        double tolerance,
01839                        cairo_traps_t *traps);
01840 
01841 /* cairo_polygon.c */
01842 cairo_private void
01843 _cairo_polygon_init (cairo_polygon_t *polygon);
01844 
01845 cairo_private void
01846 _cairo_polygon_fini (cairo_polygon_t *polygon);
01847 
01848 cairo_private cairo_status_t
01849 _cairo_polygon_add_edge (cairo_polygon_t *polygon, cairo_point_t *p1, cairo_point_t *p2);
01850 
01851 cairo_private cairo_status_t
01852 _cairo_polygon_move_to (cairo_polygon_t *polygon, cairo_point_t *point);
01853 
01854 cairo_private cairo_status_t
01855 _cairo_polygon_line_to (cairo_polygon_t *polygon, cairo_point_t *point);
01856 
01857 cairo_private cairo_status_t
01858 _cairo_polygon_close (cairo_polygon_t *polygon);
01859 
01860 /* cairo_spline.c */
01861 cairo_private cairo_int_status_t
01862 _cairo_spline_init (cairo_spline_t *spline,
01863                   cairo_point_t *a,
01864                   cairo_point_t *b,
01865                   cairo_point_t *c,
01866                   cairo_point_t *d);
01867 
01868 cairo_private cairo_status_t
01869 _cairo_spline_decompose (cairo_spline_t *spline, double tolerance);
01870 
01871 cairo_private void
01872 _cairo_spline_fini (cairo_spline_t *spline);
01873 
01874 /* cairo_matrix.c */
01875 cairo_private void
01876 _cairo_matrix_get_affine (const cairo_matrix_t *matrix,
01877                        double *xx, double *yx,
01878                        double *xy, double *yy,
01879                        double *x0, double *y0);
01880 
01881 cairo_private void
01882 _cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix,
01883                                   double *x, double *y,
01884                                   double *width, double *height);
01885 
01886 cairo_private void
01887 _cairo_matrix_compute_determinant (const cairo_matrix_t *matrix, double *det);
01888 
01889 cairo_private cairo_status_t
01890 _cairo_matrix_compute_scale_factors (const cairo_matrix_t *matrix,
01891                                  double *sx, double *sy, int x_major);
01892 
01893 cairo_private cairo_bool_t
01894 _cairo_matrix_is_integer_translation(const cairo_matrix_t *matrix,
01895                                  int *itx, int *ity);
01896 
01897 cairo_private double
01898 _cairo_matrix_transformed_circle_major_axis(cairo_matrix_t *matrix, double radius);
01899 
01900 /* cairo_traps.c */
01901 cairo_private void
01902 _cairo_traps_init (cairo_traps_t *traps);
01903 
01904 cairo_private cairo_status_t
01905 _cairo_traps_init_box (cairo_traps_t *traps,
01906                      cairo_box_t   *box);
01907 
01908 cairo_private void
01909 _cairo_traps_fini (cairo_traps_t *traps);
01910 
01911 cairo_private void
01912 _cairo_traps_translate (cairo_traps_t *traps, int x, int y);
01913 
01914 cairo_private cairo_status_t
01915 _cairo_traps_tessellate_triangle (cairo_traps_t *traps, cairo_point_t t[3]);
01916 
01917 cairo_private cairo_status_t
01918 _cairo_traps_tessellate_rectangle (cairo_traps_t *traps, cairo_point_t q[4]);
01919 
01920 cairo_private cairo_status_t
01921 _cairo_traps_tessellate_polygon (cairo_traps_t *traps,
01922                              cairo_polygon_t *poly,
01923                              cairo_fill_rule_t fill_rule);
01924 
01925 cairo_private int
01926 _cairo_traps_contain (cairo_traps_t *traps, double x, double y);
01927 
01928 cairo_private void
01929 _cairo_traps_extents (cairo_traps_t *traps, cairo_box_t *extents);
01930 
01931 cairo_private cairo_status_t
01932 _cairo_traps_extract_region (cairo_traps_t      *tr,
01933                           pixman_region16_t **region);
01934 
01935 /* cairo_slope.c */
01936 cairo_private void
01937 _cairo_slope_init (cairo_slope_t *slope, cairo_point_t *a, cairo_point_t *b);
01938 
01939 cairo_private int
01940 _cairo_slope_compare (cairo_slope_t *a, cairo_slope_t *b);
01941 
01942 cairo_private int
01943 _cairo_slope_clockwise (cairo_slope_t *a, cairo_slope_t *b);
01944 
01945 cairo_private int
01946 _cairo_slope_counter_clockwise (cairo_slope_t *a, cairo_slope_t *b);
01947 
01948 /* cairo_pattern.c */
01949 
01950 cairo_private void
01951 _cairo_pattern_init_copy (cairo_pattern_t *pattern,
01952                        const cairo_pattern_t *other);
01953 
01954 cairo_private void
01955 _cairo_pattern_init_solid (cairo_solid_pattern_t *pattern,
01956                         const cairo_color_t *color);
01957 
01958 cairo_private void
01959 _cairo_pattern_init_for_surface (cairo_surface_pattern_t *pattern,
01960                              cairo_surface_t *surface);
01961 
01962 cairo_private void
01963 _cairo_pattern_init_linear (cairo_linear_pattern_t *pattern,
01964                          double x0, double y0, double x1, double y1);
01965 
01966 cairo_private void
01967 _cairo_pattern_init_radial (cairo_radial_pattern_t *pattern,
01968                          double cx0, double cy0, double radius0,
01969                          double cx1, double cy1, double radius1);
01970 
01971 cairo_private void
01972 _cairo_pattern_fini (cairo_pattern_t *pattern);
01973 
01974 cairo_private cairo_pattern_t *
01975 _cairo_pattern_create_solid (const cairo_color_t *color);
01976 
01977 cairo_private void
01978 _cairo_pattern_transform (cairo_pattern_t      *pattern,
01979                        const cairo_matrix_t *ctm_inverse);
01980 
01981 cairo_private cairo_bool_t 
01982 _cairo_pattern_is_opaque_solid (cairo_pattern_t *pattern);
01983 
01984 cairo_private cairo_int_status_t
01985 _cairo_pattern_acquire_surface (cairo_pattern_t            *pattern,
01986                             cairo_surface_t                *dst,
01987                             int                     x,
01988                             int                     y,
01989                             unsigned int            width,
01990                             unsigned int            height,
01991                             cairo_surface_t                **surface_out,
01992                             cairo_surface_attributes_t *attributes);
01993 
01994 cairo_private void
01995 _cairo_pattern_release_surface (cairo_pattern_t            *pattern,
01996                             cairo_surface_t                *surface,
01997                             cairo_surface_attributes_t *attributes);
01998 
01999 cairo_private cairo_int_status_t
02000 _cairo_pattern_acquire_surfaces (cairo_pattern_t     *src,
02001                              cairo_pattern_t         *mask,
02002                              cairo_surface_t         *dst,
02003                              int                     src_x,
02004                              int                     src_y,
02005                              int                     mask_x,
02006                              int                     mask_y,
02007                              unsigned int            width,
02008                              unsigned int            height,
02009                              cairo_surface_t         **src_out,
02010                              cairo_surface_t         **mask_out,
02011                              cairo_surface_attributes_t *src_attributes,
02012                              cairo_surface_attributes_t *mask_attributes);
02013 
02014 cairo_private cairo_status_t
02015 _cairo_gstate_set_antialias (cairo_gstate_t *gstate,
02016                           cairo_antialias_t antialias);
02017 
02018 cairo_private cairo_antialias_t
02019 _cairo_gstate_get_antialias (cairo_gstate_t *gstate);
02020 
02021 /* cairo-region.c */
02022 
02023 cairo_private pixman_region16_t *
02024 _cairo_region_create_from_rectangle (cairo_rectangle_t *rect);
02025 
02026 cairo_private void
02027 _cairo_region_extents_rectangle (pixman_region16_t *region,
02028                              cairo_rectangle_t *rect);
02029 
02030 /* cairo_unicode.c */
02031 
02032 cairo_private cairo_status_t
02033 _cairo_utf8_to_ucs4 (const unsigned char *str,
02034                    int               len,
02035                    uint32_t         **result,
02036                    int              *items_written);
02037 
02038 cairo_private cairo_status_t
02039 _cairo_utf8_to_utf16 (const unsigned char *str,
02040                     int               len,
02041                     uint16_t               **result,
02042                     int              *items_written);
02043 
02044 /* cairo_output_stream.c */
02045 
02046 typedef struct _cairo_output_stream cairo_output_stream_t;
02047 
02048 cairo_private cairo_output_stream_t *
02049 _cairo_output_stream_create (cairo_write_func_t         write_func,
02050                           void                   *closure);
02051 
02052 cairo_private void
02053 _cairo_output_stream_destroy (cairo_output_stream_t *stream);
02054 
02055 cairo_private cairo_status_t
02056 _cairo_output_stream_write (cairo_output_stream_t *stream,
02057                          const void *data, size_t length);
02058 
02059 cairo_private void
02060 _cairo_output_stream_write_hex_string (cairo_output_stream_t *stream,
02061                                    const char *data,
02062                                    size_t length);
02063 
02064 cairo_private cairo_status_t
02065 _cairo_output_stream_vprintf (cairo_output_stream_t *stream,
02066                            const char *fmt, va_list ap);
02067 
02068 cairo_private cairo_status_t
02069 _cairo_output_stream_printf (cairo_output_stream_t *stream,
02070                           const char *fmt, ...) CAIRO_PRINTF_FORMAT(2, 3);
02071 
02072 cairo_private long
02073 _cairo_output_stream_get_position (cairo_output_stream_t *status);
02074 
02075 cairo_private cairo_status_t
02076 _cairo_output_stream_get_status (cairo_output_stream_t *stream);
02077 
02078 cairo_private cairo_output_stream_t *
02079 _cairo_output_stream_create_for_file (const char *filename);
02080 
02081 cairo_private void
02082 _cairo_error (cairo_status_t status);
02083 
02084 /* Avoid unnecessary PLT entries.  */
02085 
02086 slim_hidden_proto(cairo_get_current_point)
02087 slim_hidden_proto(cairo_fill_preserve)
02088 slim_hidden_proto(cairo_clip_preserve)
02089 slim_hidden_proto(cairo_close_path)
02090 slim_hidden_proto(cairo_matrix_invert)
02091 slim_hidden_proto(cairo_matrix_multiply)
02092 slim_hidden_proto(cairo_matrix_scale)
02093 slim_hidden_proto(cairo_matrix_init)
02094 slim_hidden_proto(cairo_matrix_init_identity)
02095 slim_hidden_proto(cairo_matrix_init_translate)
02096 slim_hidden_proto(cairo_matrix_init_scale)
02097 slim_hidden_proto(cairo_matrix_init_rotate)
02098 slim_hidden_proto(cairo_matrix_transform_distance)
02099 slim_hidden_proto(cairo_matrix_transform_point)
02100 slim_hidden_proto(cairo_move_to)
02101 slim_hidden_proto(cairo_new_path)
02102 slim_hidden_proto(cairo_rel_line_to)
02103 slim_hidden_proto(cairo_restore)
02104 slim_hidden_proto(cairo_save)
02105 slim_hidden_proto(cairo_stroke_preserve)
02106 slim_hidden_proto(cairo_surface_destroy)
02107 
02108 #endif