Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
usershape.h
Go to the documentation of this file.
1
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
21extern "C" {
22#endif
23
24 typedef enum { FT_NULL,
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 */
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 */
49
50 typedef struct usershape_s usershape_t;
51
52 struct usershape_s {
54 const char *name;
57 bool nocache;
58 FILE *f;
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
container data types API
const char * name
Definition usershape.h:54
char * stringtype
Definition usershape.h:60
FILE * f
Definition usershape.h:58
void(* datafree)(usershape_t *us)
Definition usershape.h:65
Dtlink_t link
Definition usershape.h:53
size_t datasize
Definition usershape.h:64
bool nocache
Definition usershape.h:57
bool must_inline
Definition usershape.h:56
void * data
Definition usershape.h:63
imagetype_t type
Definition usershape.h:59
double x
Definition usershape.h:61
double y
Definition usershape.h:61
double h
Definition usershape.h:61
double w
Definition usershape.h:61
imagepos_t
Definition usershape.h:38
@ IMAGEPOS_MIDDLE_CENTER
Definition usershape.h:43
@ IMAGEPOS_BOTTOM_RIGHT
Definition usershape.h:47
@ IMAGEPOS_TOP_RIGHT
Definition usershape.h:41
@ IMAGEPOS_MIDDLE_LEFT
Definition usershape.h:42
@ IMAGEPOS_TOP_CENTER
Definition usershape.h:40
@ IMAGEPOS_BOTTOM_LEFT
Definition usershape.h:45
@ IMAGEPOS_TOP_LEFT
Definition usershape.h:39
@ IMAGEPOS_BOTTOM_CENTER
Definition usershape.h:46
@ IMAGEPOS_MIDDLE_RIGHT
Definition usershape.h:44
imagescale_t
Definition usershape.h:30
@ IMAGESCALE_BOTH
Definition usershape.h:35
@ IMAGESCALE_WIDTH
Definition usershape.h:33
@ IMAGESCALE_FALSE
Definition usershape.h:31
@ IMAGESCALE_TRUE
Definition usershape.h:32
@ IMAGESCALE_HEIGHT
Definition usershape.h:34
imagetype_t
Definition usershape.h:24
@ FT_BMP
Definition usershape.h:25
@ FT_PS
Definition usershape.h:26
@ FT_ICO
Definition usershape.h:27
@ FT_NULL
Definition usershape.h:24
@ FT_TIFF
Definition usershape.h:27
@ FT_EPS
Definition usershape.h:26
@ FT_SVG
Definition usershape.h:26
@ FT_WEBP
Definition usershape.h:27
@ FT_GIF
Definition usershape.h:25
@ FT_JPEG
Definition usershape.h:25
@ FT_RIFF
Definition usershape.h:27
@ FT_PNG
Definition usershape.h:25
@ FT_XML
Definition usershape.h:26
@ FT_PDF
Definition usershape.h:26