1 /* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */ 2 /* cairo - a vector graphics library with display and print output 3 * 4 * Copyright © 2016 Adrian Johnson 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it either under the terms of the GNU Lesser General Public 8 * License version 2.1 as published by the Free Software Foundation 9 * (the "LGPL") or, at your option, under the terms of the Mozilla 10 * Public License Version 1.1 (the "MPL"). If you do not alter this 11 * notice, a recipient may use your version of this file under either 12 * the MPL or the LGPL. 13 * 14 * You should have received a copy of the LGPL along with this library 15 * in the file COPYING-LGPL-2.1; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA 17 * You should have received a copy of the MPL along with this library 18 * in the file COPYING-MPL-1.1 19 * 20 * The contents of this file are subject to the Mozilla Public License 21 * Version 1.1 (the "License"); you may not use this file except in 22 * compliance with the License. You may obtain a copy of the License at 23 * http://www.mozilla.org/MPL/ 24 * 25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY 26 * OF ANY KIND, either express or implied. See the LGPL or the MPL for 27 * the specific language governing rights and limitations. 28 * 29 * The Original Code is the cairo graphics library. 30 * 31 * The Initial Developer of the Original Code is Adrian Johnson. 32 * 33 * Contributor(s): 34 * Adrian Johnson <ajohnson@redneon.com> 35 */ 36 37 #ifndef CAIRO_TAG_ATTRIBUTES_PRIVATE_H 38 #define CAIRO_TAG_ATTRIBUTES_PRIVATE_H 39 40 #include "cairo-array-private.h" 41 #include "cairo-error-private.h" 42 #include "cairo-types-private.h" 43 44 typedef enum { 45 TAG_LINK_INVALID = 0, 46 TAG_LINK_EMPTY, 47 TAG_LINK_DEST, 48 TAG_LINK_URI, 49 TAG_LINK_FILE, 50 } cairo_tag_link_type_t; 51 52 typedef struct _cairo_link_attrs { 53 cairo_tag_link_type_t link_type; 54 cairo_array_t rects; 55 char *dest; 56 char *uri; 57 char *file; 58 int page; 59 cairo_bool_t has_pos; 60 cairo_point_double_t pos; 61 } cairo_link_attrs_t; 62 63 typedef struct _cairo_dest_attrs { 64 char *name; 65 double x; 66 double y; 67 cairo_bool_t x_valid; 68 cairo_bool_t y_valid; 69 cairo_bool_t internal; 70 } cairo_dest_attrs_t; 71 72 typedef struct _cairo_ccitt_params { 73 int columns; 74 int rows; 75 int k; 76 cairo_bool_t end_of_line; 77 cairo_bool_t encoded_byte_align; 78 cairo_bool_t end_of_block; 79 cairo_bool_t black_is_1; 80 int damaged_rows_before_error; 81 } cairo_ccitt_params_t; 82 83 typedef struct _cairo_eps_params { 84 cairo_box_double_t bbox; 85 } cairo_eps_params_t; 86 87 cairo_private cairo_int_status_t 88 _cairo_tag_parse_link_attributes (const char *attributes, cairo_link_attrs_t *link_attrs); 89 90 cairo_private cairo_int_status_t 91 _cairo_tag_parse_dest_attributes (const char *attributes, cairo_dest_attrs_t *dest_attrs); 92 93 cairo_private cairo_int_status_t 94 _cairo_tag_parse_ccitt_params (const char *attributes, cairo_ccitt_params_t *dest_attrs); 95 96 cairo_private cairo_int_status_t 97 _cairo_tag_parse_eps_params (const char *attributes, cairo_eps_params_t *dest_attrs); 98 99 #endif /* CAIRO_TAG_ATTRIBUTES_PRIVATE_H */ 100