1 | /* $Id$ $Revision$ */ |
2 | /* vim:set shiftwidth=4 ts=8: */ |
3 | |
4 | /************************************************************************* |
5 | * Copyright (c) 2011 AT&T Intellectual Property |
6 | * All rights reserved. This program and the accompanying materials |
7 | * are made available under the terms of the Eclipse Public License v1.0 |
8 | * which accompanies this distribution, and is available at |
9 | * http://www.eclipse.org/legal/epl-v10.html |
10 | * |
11 | * Contributors: See CVS logs. Details at http://www.graphviz.org/ |
12 | *************************************************************************/ |
13 | |
14 | #ifndef USERSHAPE_H |
15 | #define USERSHAPE_H |
16 | |
17 | #include "cdt.h" |
18 | |
19 | #ifdef __cplusplus |
20 | extern "C" { |
21 | #endif |
22 | |
23 | typedef enum { FT_NULL, |
24 | FT_BMP, FT_GIF, FT_PNG, FT_JPEG, |
25 | FT_PDF, FT_PS, FT_EPS, FT_SVG, FT_XML, |
26 | FT_RIFF, FT_WEBP, FT_ICO, FT_TIFF |
27 | } imagetype_t; |
28 | |
29 | typedef enum { |
30 | IMAGESCALE_FALSE, /* no image scaling */ |
31 | IMAGESCALE_TRUE, /* scale image to fit but keep aspect ratio */ |
32 | IMAGESCALE_WIDTH, /* scale image width to fit, keep height fixed */ |
33 | IMAGESCALE_HEIGHT, /* scale image height to fit, keep width fixed */ |
34 | IMAGESCALE_BOTH /* scale image to fit without regard for aspect ratio */ |
35 | } imagescale_t; |
36 | |
37 | typedef struct usershape_s usershape_t; |
38 | |
39 | struct usershape_s { |
40 | Dtlink_t link; |
41 | const char *name; |
42 | int macro_id; |
43 | boolean must_inline; |
44 | boolean nocache; |
45 | FILE *f; |
46 | imagetype_t type; |
47 | char *stringtype; |
48 | int x, y, w, h, dpi; |
49 | void *data; /* data loaded by a renderer */ |
50 | size_t datasize; /* size of data (if mmap'ed) */ |
51 | void (*datafree)(usershape_t *us); /* renderer's function for freeing data */ |
52 | }; |
53 | |
54 | #ifdef __cplusplus |
55 | } |
56 | #endif |
57 | #endif |
58 | |