Debian Codegraph @

lib/common/usershape.h

raw
1 /// @file
2 /// @ingroup public_apis
3 /// @ingroup common_render
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 * https://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors: Details at https://graphviz.org
12 *************************************************************************/
13
14 #pragma once
15
16 #include "cdt.h"
17 #include <stdbool.h>
18 #include <stdio.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 typedef enum { FT_NULL,
25 FT_BMP, FT_GIF, FT_PNG, FT_JPEG,
26 FT_PDF, FT_PS, FT_EPS, FT_SVG, FT_XML,
27 FT_RIFF, FT_WEBP, FT_ICO, FT_TIFF
28 } imagetype_t;
29
30 typedef enum {
31 IMAGESCALE_FALSE, /* no image scaling */
32 IMAGESCALE_TRUE, /* scale image to fit but keep aspect ratio */
33 IMAGESCALE_WIDTH, /* scale image width to fit, keep height fixed */
34 IMAGESCALE_HEIGHT, /* scale image height to fit, keep width fixed */
35 IMAGESCALE_BOTH /* scale image to fit without regard for aspect ratio */
36 } imagescale_t;
37
38 typedef enum {
39 IMAGEPOS_TOP_LEFT, /* top left */
40 IMAGEPOS_TOP_CENTER, /* top center */
41 IMAGEPOS_TOP_RIGHT, /* top right */
42 IMAGEPOS_MIDDLE_LEFT, /* middle left */
43 IMAGEPOS_MIDDLE_CENTER, /* middle center (true center, the default)*/
44 IMAGEPOS_MIDDLE_RIGHT, /* middle right */
45 IMAGEPOS_BOTTOM_LEFT, /* bottom left */
46 IMAGEPOS_BOTTOM_CENTER, /* bottom center */
47 IMAGEPOS_BOTTOM_RIGHT /* bottom right */
48 } imagepos_t;
49
50 typedef struct usershape_s usershape_t;
51
52 struct usershape_s {
53 Dtlink_t link;
54 const char *name;
55 int macro_id;
56 bool must_inline;
57 bool nocache;
58 FILE *f;
59 imagetype_t type;
60 char *stringtype;
61 double x, y, w, h;
62 int dpi;
63 void *data; /* data loaded by a renderer */
64 size_t datasize; /* size of data (if mmap'ed) */
65 void (*datafree)(usershape_t *us); /* renderer's function for freeing data */
66 };
67
68 #ifdef __cplusplus
69 }
70 #endif