diff --git a/src/cairo-pdf-operators-private.h b/src/cairo-pdf-operators-private.h index 835d39516..83ef73cd0 100644 --- a/src/cairo-pdf-operators-private.h +++ b/src/cairo-pdf-operators-private.h @@ -42,7 +42,8 @@ #ifndef CAIRO_PDF_OPERATORS_H #define CAIRO_PDF_OPERATORS_H -#include "cairoint.h" +#include "cairo-compiler-private.h" +#include "cairo-types-private.h" typedef cairo_status_t (*cairo_pdf_operators_use_font_subset_t) (unsigned int font_id, diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h index 3954f13b2..8580bebd4 100644 --- a/src/cairo-types-private.h +++ b/src/cairo-types-private.h @@ -41,6 +41,7 @@ /* This is the only header file not including cairoint.h. It only contains * typedefs.*/ #include "cairo.h" +#include "cairo-fixed-private.h" typedef struct _cairo_array cairo_array_t; typedef struct _cairo_hash_table cairo_hash_table_t; @@ -149,4 +150,172 @@ typedef enum _cairo_internal_surface_type { CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED } cairo_internal_surface_type_t; +typedef struct _cairo_region cairo_region_t; + +typedef struct _cairo_point { + cairo_fixed_t x; + cairo_fixed_t y; +} cairo_point_t; + +typedef struct _cairo_slope +{ + cairo_fixed_t dx; + cairo_fixed_t dy; +} cairo_slope_t, cairo_distance_t; + +typedef struct _cairo_point_double { + double x; + double y; +} cairo_point_double_t; + +typedef struct _cairo_distance_double { + double dx; + double dy; +} cairo_distance_double_t; + +typedef struct _cairo_line { + cairo_point_t p1; + cairo_point_t p2; +} cairo_line_t, cairo_box_t; + +typedef struct _cairo_trapezoid { + cairo_fixed_t top, bottom; + cairo_line_t left, right; +} cairo_trapezoid_t; + +typedef struct _cairo_rectangle_int16 { + int16_t x, y; + uint16_t width, height; +} cairo_rectangle_int16_t, cairo_glyph_size_t; + +typedef struct _cairo_rectangle_int32 { + int32_t x, y; + uint32_t width, height; +} cairo_rectangle_int32_t; + +typedef struct _cairo_point_int16 { + int16_t x, y; +} cairo_point_int16_t; + +typedef struct _cairo_point_int32 { + int16_t x, y; +} cairo_point_int32_t; + +typedef struct _cairo_box_int16 { + cairo_point_int16_t p1; + cairo_point_int16_t p2; +} cairo_box_int16_t; + +typedef struct _cairo_box_int32 { + cairo_point_int32_t p1; + cairo_point_int32_t p2; +} cairo_box_int32_t; + + +#if CAIRO_FIXED_BITS == 32 && CAIRO_FIXED_FRAC_BITS >= 16 +typedef cairo_rectangle_int16_t cairo_rectangle_int_t; +typedef cairo_point_int16_t cairo_point_int_t; +typedef cairo_box_int16_t cairo_box_int_t; +#define CAIRO_RECT_INT_MIN INT16_MIN +#define CAIRO_RECT_INT_MAX INT16_MAX +#elif CAIRO_FIXED_BITS == 32 +typedef cairo_rectangle_int32_t cairo_rectangle_int_t; +typedef cairo_point_int32_t cairo_point_int_t; +typedef cairo_box_int32_t cairo_box_int_t; +#define CAIRO_RECT_INT_MIN INT32_MIN +#define CAIRO_RECT_INT_MAX INT32_MAX +#else +#error Not sure how to pick a cairo_rectangle_int_t for your CAIRO_FIXED_BITS! +#endif + +typedef enum _cairo_direction { + CAIRO_DIRECTION_FORWARD, + CAIRO_DIRECTION_REVERSE +} cairo_direction_t; + +typedef struct _cairo_path_fixed cairo_path_fixed_t; +typedef enum _cairo_clip_mode { + CAIRO_CLIP_MODE_PATH, + CAIRO_CLIP_MODE_REGION, + CAIRO_CLIP_MODE_MASK +} cairo_clip_mode_t; +typedef struct _cairo_clip_path cairo_clip_path_t; + +typedef struct _cairo_edge { + cairo_line_t edge; + int clockWise; + + cairo_fixed_t current_x; +} cairo_edge_t; + +typedef struct _cairo_polygon { + cairo_status_t status; + + cairo_point_t first_point; + cairo_point_t current_point; + cairo_bool_t has_current_point; + + int num_edges; + int edges_size; + cairo_edge_t *edges; + cairo_edge_t edges_embedded[8]; +} cairo_polygon_t; + +typedef struct _cairo_spline_knots { + cairo_point_t a, b, c, d; +} cairo_spline_knots_t; +typedef struct _cairo_spline { + cairo_spline_knots_t knots; + + cairo_slope_t initial_slope; + cairo_slope_t final_slope; + + int num_points; + int points_size; + cairo_point_t *points; + cairo_point_t points_embedded[8]; +} cairo_spline_t; + +typedef struct _cairo_pen_vertex { + cairo_point_t point; + + cairo_slope_t slope_ccw; + cairo_slope_t slope_cw; +} cairo_pen_vertex_t; + +typedef struct _cairo_pen { + double radius; + double tolerance; + + cairo_pen_vertex_t *vertices; + int num_vertices; +} cairo_pen_t; + +typedef struct _cairo_color cairo_color_t; +typedef struct _cairo_image_surface cairo_image_surface_t; + +typedef struct _cairo_stroke_style { + double line_width; + cairo_line_cap_t line_cap; + cairo_line_join_t line_join; + double miter_limit; + double *dash; + unsigned int num_dashes; + double dash_offset; +} cairo_stroke_style_t; + +typedef struct _cairo_format_masks { + int bpp; + unsigned long alpha_mask; + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; +} cairo_format_masks_t; + +typedef enum { + CAIRO_STOCK_WHITE, + CAIRO_STOCK_BLACK, + CAIRO_STOCK_TRANSPARENT +} cairo_stock_t; + #endif /* CAIRO_TYPES_PRIVATE_H */ diff --git a/src/cairoint.h b/src/cairoint.h index 19513a754..ce74db00e 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -178,152 +178,8 @@ be32_to_cpu(uint32_t v) #include "cairo-types-private.h" #include "cairo-cache-private.h" -#include "cairo-fixed-private.h" #include "cairo-reference-count-private.h" -typedef struct _cairo_region cairo_region_t; - -typedef struct _cairo_point { - cairo_fixed_t x; - cairo_fixed_t y; -} cairo_point_t; - -typedef struct _cairo_slope -{ - cairo_fixed_t dx; - cairo_fixed_t dy; -} cairo_slope_t, cairo_distance_t; - -typedef struct _cairo_point_double { - double x; - double y; -} cairo_point_double_t; - -typedef struct _cairo_distance_double { - double dx; - double dy; -} cairo_distance_double_t; - -typedef struct _cairo_line { - cairo_point_t p1; - cairo_point_t p2; -} cairo_line_t, cairo_box_t; - -typedef struct _cairo_trapezoid { - cairo_fixed_t top, bottom; - cairo_line_t left, right; -} cairo_trapezoid_t; - -typedef struct _cairo_rectangle_int16 { - int16_t x, y; - uint16_t width, height; -} cairo_rectangle_int16_t, cairo_glyph_size_t; - -typedef struct _cairo_rectangle_int32 { - int32_t x, y; - uint32_t width, height; -} cairo_rectangle_int32_t; - -typedef struct _cairo_point_int16 { - int16_t x, y; -} cairo_point_int16_t; - -typedef struct _cairo_point_int32 { - int16_t x, y; -} cairo_point_int32_t; - -typedef struct _cairo_box_int16 { - cairo_point_int16_t p1; - cairo_point_int16_t p2; -} cairo_box_int16_t; - -typedef struct _cairo_box_int32 { - cairo_point_int32_t p1; - cairo_point_int32_t p2; -} cairo_box_int32_t; - -#if CAIRO_FIXED_BITS == 32 && CAIRO_FIXED_FRAC_BITS >= 16 -typedef cairo_rectangle_int16_t cairo_rectangle_int_t; -typedef cairo_point_int16_t cairo_point_int_t; -typedef cairo_box_int16_t cairo_box_int_t; -#define CAIRO_RECT_INT_MIN INT16_MIN -#define CAIRO_RECT_INT_MAX INT16_MAX -#elif CAIRO_FIXED_BITS == 32 -typedef cairo_rectangle_int32_t cairo_rectangle_int_t; -typedef cairo_point_int32_t cairo_point_int_t; -typedef cairo_box_int32_t cairo_box_int_t; -#define CAIRO_RECT_INT_MIN INT32_MIN -#define CAIRO_RECT_INT_MAX INT32_MAX -#else -#error Not sure how to pick a cairo_rectangle_int_t for your CAIRO_FIXED_BITS! -#endif - -typedef enum _cairo_direction { - CAIRO_DIRECTION_FORWARD, - CAIRO_DIRECTION_REVERSE -} cairo_direction_t; - -typedef struct _cairo_path_fixed cairo_path_fixed_t; -typedef enum _cairo_clip_mode { - CAIRO_CLIP_MODE_PATH, - CAIRO_CLIP_MODE_REGION, - CAIRO_CLIP_MODE_MASK -} cairo_clip_mode_t; -typedef struct _cairo_clip_path cairo_clip_path_t; - -typedef struct _cairo_edge { - cairo_line_t edge; - int clockWise; - - cairo_fixed_t current_x; -} cairo_edge_t; - -typedef struct _cairo_polygon { - cairo_status_t status; - - cairo_point_t first_point; - cairo_point_t current_point; - cairo_bool_t has_current_point; - - int num_edges; - int edges_size; - cairo_edge_t *edges; - cairo_edge_t edges_embedded[8]; -} cairo_polygon_t; - -typedef struct _cairo_spline_knots { - cairo_point_t a, b, c, d; -} cairo_spline_knots_t; -typedef struct _cairo_spline { - cairo_spline_knots_t knots; - - cairo_slope_t initial_slope; - cairo_slope_t final_slope; - - int num_points; - int points_size; - cairo_point_t *points; - cairo_point_t points_embedded[8]; -} cairo_spline_t; - -typedef struct _cairo_pen_vertex { - cairo_point_t point; - - cairo_slope_t slope_ccw; - cairo_slope_t slope_cw; -} cairo_pen_vertex_t; - -typedef struct _cairo_pen { - double radius; - double tolerance; - - cairo_pen_vertex_t *vertices; - int num_vertices; -} cairo_pen_t; - -typedef struct _cairo_color cairo_color_t; -typedef struct _cairo_image_surface cairo_image_surface_t; - cairo_private void _cairo_box_round_to_rectangle (cairo_box_t *box, cairo_rectangle_int_t *rectangle); @@ -571,16 +427,6 @@ extern const cairo_private struct _cairo_scaled_font_backend cairo_atsui_scaled_ #endif -typedef struct _cairo_stroke_style { - double line_width; - cairo_line_cap_t line_cap; - cairo_line_join_t line_join; - double miter_limit; - double *dash; - unsigned int num_dashes; - double dash_offset; -} cairo_stroke_style_t; - struct _cairo_surface_backend { cairo_surface_type_t type; @@ -841,14 +687,6 @@ struct _cairo_surface_backend { cairo_antialias_t stroke_antialias); }; -typedef struct _cairo_format_masks { - int bpp; - unsigned long alpha_mask; - unsigned long red_mask; - unsigned long green_mask; - unsigned long blue_mask; -} cairo_format_masks_t; - #include "cairo-surface-private.h" struct _cairo_image_surface { @@ -888,12 +726,6 @@ struct _cairo_color { unsigned short alpha_short; }; -typedef enum { - CAIRO_STOCK_WHITE, - CAIRO_STOCK_BLACK, - CAIRO_STOCK_TRANSPARENT -} cairo_stock_t; - #define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE #define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_BEST @@ -1521,7 +1353,7 @@ _cairo_path_fixed_interpret (cairo_path_fixed_t *path, cairo_path_fixed_close_path_func_t *close_path, void *closure); -cairo_private cairo_status_t +cairo_private void _cairo_path_fixed_bounds (cairo_path_fixed_t *path, double *x1, double *y1, double *x2, double *y2);