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 enum {
38         IMAGEPOS_TOP_LEFT,      /* top left */
39         IMAGEPOS_TOP_CENTER,    /* top center */
40         IMAGEPOS_TOP_RIGHT,     /* top right */
41         IMAGEPOS_MIDDLE_LEFT,   /* middle left */
42         IMAGEPOS_MIDDLE_CENTER, /* middle center (true center, the default)*/
43         IMAGEPOS_MIDDLE_RIGHT,  /* middle right */
44         IMAGEPOS_BOTTOM_LEFT,   /* bottom left */
45         IMAGEPOS_BOTTOM_CENTER, /* bottom center */
46         IMAGEPOS_BOTTOM_RIGHT   /* bottom right */
47     } imagepos_t;
48 
49     typedef struct usershape_s usershape_t;
50 
51     struct usershape_s {
52 	Dtlink_t link;
53 	const char *name;
54 	int macro_id;
55 	boolean must_inline;
56 	boolean nocache;
57 	FILE *f;
58 	imagetype_t type;
59 	char *stringtype;
60 	int x, y, w, h, dpi;
61 	void *data;                   /* data loaded by a renderer */
62 	size_t datasize;              /* size of data (if mmap'ed) */
63 	void (*datafree)(usershape_t *us); /* renderer's function for freeing data */
64     };
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 #endif
70