Graphviz  2.29.20120524.0446
lib/common/usershape.h
Go to the documentation of this file.
00001 /* $Id$ $Revision$ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /*************************************************************************
00005  * Copyright (c) 2011 AT&T Intellectual Property 
00006  * All rights reserved. This program and the accompanying materials
00007  * are made available under the terms of the Eclipse Public License v1.0
00008  * which accompanies this distribution, and is available at
00009  * http://www.eclipse.org/legal/epl-v10.html
00010  *
00011  * Contributors: See CVS logs. Details at http://www.graphviz.org/
00012  *************************************************************************/
00013 
00014 #ifndef USERSHAPE_H
00015 #define USERSHAPE_H
00016 
00017 #include "cdt.h"
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023     typedef enum { FT_NULL,
00024                 FT_BMP, FT_GIF, FT_PNG, FT_JPEG,
00025                 FT_PDF, FT_PS, FT_EPS, FT_SVG, FT_XML, FT_RIFF, FT_WEBP
00026     } imagetype_t;
00027 
00028     typedef enum {
00029         IMAGESCALE_FALSE,  /* no image scaling */
00030         IMAGESCALE_TRUE,   /* scale image to fit but keep aspect ratio */
00031         IMAGESCALE_WIDTH,  /* scale image width to fit, keep height fixed */
00032         IMAGESCALE_HEIGHT, /* scale image height to fit, keep width fixed */
00033         IMAGESCALE_BOTH    /* scale image to fit without regard for aspect ratio */
00034     } imagescale_t;
00035 
00036     typedef struct usershape_s usershape_t;
00037 
00038     struct usershape_s {
00039         Dtlink_t link;
00040         const char *name;
00041         int macro_id;
00042         boolean must_inline;
00043         boolean nocache;
00044         FILE *f;
00045         imagetype_t type;
00046         char *stringtype;
00047         int x, y, w, h, dpi;
00048         void *data;                   /* data loaded by a renderer */
00049         size_t datasize;              /* size of data (if mmap'ed) */
00050         void (*datafree)(usershape_t *us); /* renderer's function for freeing data */
00051     };
00052 
00053 #ifdef __cplusplus
00054 }
00055 #endif
00056 #endif