Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* cairo - a vector graphics library with display and print output
  2.  *
  3.  * Copyright © 2005 Red Hat, Inc.
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it either under the terms of the GNU Lesser General Public
  7.  * License version 2.1 as published by the Free Software Foundation
  8.  * (the "LGPL") or, at your option, under the terms of the Mozilla
  9.  * Public License Version 1.1 (the "MPL"). If you do not alter this
  10.  * notice, a recipient may use your version of this file under either
  11.  * the MPL or the LGPL.
  12.  *
  13.  * You should have received a copy of the LGPL along with this library
  14.  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
  15.  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
  16.  * You should have received a copy of the MPL along with this library
  17.  * in the file COPYING-MPL-1.1
  18.  *
  19.  * The contents of this file are subject to the Mozilla Public License
  20.  * Version 1.1 (the "License"); you may not use this file except in
  21.  * compliance with the License. You may obtain a copy of the License at
  22.  * http://www.mozilla.org/MPL/
  23.  *
  24.  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
  25.  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
  26.  * the specific language governing rights and limitations.
  27.  *
  28.  * The Original Code is the cairo graphics library.
  29.  *
  30.  * The Initial Developer of the Original Code is Red Hat, Inc.
  31.  *
  32.  * Contributor(s):
  33.  *      Kristian Høgsberg <krh@redhat.com>
  34.  */
  35.  
  36. #ifndef CAIRO_CLIP_PRIVATE_H
  37. #define CAIRO_CLIP_PRIVATE_H
  38.  
  39. #include "cairo-types-private.h"
  40. #include "cairo-compiler-private.h"
  41. #include "cairo-path-fixed-private.h"
  42. #include "cairo-reference-count-private.h"
  43.  
  44. extern const cairo_private cairo_rectangle_list_t _cairo_rectangles_nil;
  45.  
  46. enum {
  47.     CAIRO_CLIP_PATH_HAS_REGION = 0x1,
  48.     CAIRO_CLIP_PATH_REGION_IS_UNSUPPORTED = 0x2,
  49.     CAIRO_CLIP_PATH_IS_BOX = 0x4
  50. };
  51.  
  52. struct _cairo_clip_path {
  53.     cairo_reference_count_t      ref_count;
  54.     cairo_path_fixed_t           path;
  55.     cairo_fill_rule_t            fill_rule;
  56.     double                       tolerance;
  57.     cairo_antialias_t            antialias;
  58.     cairo_clip_path_t           *prev;
  59.  
  60.     cairo_rectangle_int_t extents;
  61.  
  62.     /* partial caches */
  63.     unsigned int flags;
  64.     cairo_region_t *region;
  65.     cairo_surface_t *surface;
  66. };
  67.  
  68. struct _cairo_clip {
  69.     /* can be used as a cairo_hash_entry_t for live clips */
  70.     cairo_clip_path_t *path;
  71.  
  72.     cairo_bool_t all_clipped;
  73.  
  74. };
  75.  
  76. cairo_private void
  77. _cairo_clip_init (cairo_clip_t *clip);
  78.  
  79. cairo_private_no_warn cairo_clip_t *
  80. _cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other);
  81.  
  82. cairo_private cairo_status_t
  83. _cairo_clip_init_copy_transformed (cairo_clip_t    *clip,
  84.                                    cairo_clip_t    *other,
  85.                                    const cairo_matrix_t *matrix);
  86.  
  87. cairo_private void
  88. _cairo_clip_reset (cairo_clip_t *clip);
  89.  
  90. cairo_private cairo_bool_t
  91. _cairo_clip_equal (const cairo_clip_t *clip_a,
  92.                    const cairo_clip_t *clip_b);
  93.  
  94. #define _cairo_clip_fini(clip) _cairo_clip_reset (clip)
  95.  
  96. cairo_private cairo_status_t
  97. _cairo_clip_rectangle (cairo_clip_t       *clip,
  98.                        const cairo_rectangle_int_t *rectangle);
  99.  
  100. cairo_private cairo_status_t
  101. _cairo_clip_clip (cairo_clip_t       *clip,
  102.                   const cairo_path_fixed_t *path,
  103.                   cairo_fill_rule_t   fill_rule,
  104.                   double              tolerance,
  105.                   cairo_antialias_t   antialias);
  106.  
  107. cairo_private cairo_status_t
  108. _cairo_clip_apply_clip (cairo_clip_t *clip,
  109.                         const cairo_clip_t *other);
  110.  
  111. cairo_private const cairo_rectangle_int_t *
  112. _cairo_clip_get_extents (const cairo_clip_t *clip);
  113.  
  114. cairo_private cairo_surface_t *
  115. _cairo_clip_get_surface (cairo_clip_t *clip, cairo_surface_t *dst, int *tx, int *ty);
  116.  
  117. cairo_private cairo_status_t
  118. _cairo_clip_combine_with_surface (cairo_clip_t *clip,
  119.                                   cairo_surface_t *dst,
  120.                                   int dst_x, int dst_y);
  121.  
  122. cairo_private cairo_int_status_t
  123. _cairo_clip_get_region (cairo_clip_t *clip,
  124.                         cairo_region_t **region);
  125.  
  126. cairo_private cairo_int_status_t
  127. _cairo_clip_get_boxes (cairo_clip_t *clip,
  128.                        cairo_box_t **boxes,
  129.                        int *count);
  130.  
  131. cairo_private cairo_status_t
  132. _cairo_clip_to_boxes (cairo_clip_t **clip,
  133.                       cairo_composite_rectangles_t *extents,
  134.                       cairo_box_t **boxes,
  135.                       int *num_boxes);
  136.  
  137. cairo_private cairo_bool_t
  138. _cairo_clip_contains_rectangle (cairo_clip_t *clip,
  139.                                 const cairo_rectangle_int_t *rect);
  140.  
  141. cairo_private cairo_bool_t
  142. _cairo_clip_contains_extents (cairo_clip_t *clip,
  143.                                 const cairo_composite_rectangles_t *extents);
  144.  
  145. cairo_private void
  146. _cairo_clip_drop_cache (cairo_clip_t  *clip);
  147.  
  148. cairo_private cairo_rectangle_list_t*
  149. _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate);
  150.  
  151. #endif /* CAIRO_CLIP_PRIVATE_H */
  152.