Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gvplugin_quartz.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include "config.h"
12
13#include <common/types.h>
14#include <gvc/gvplugin.h>
15#include "gvplugin_quartz.h"
16#include <gvc/gvio.h>
17
22
23#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
24extern gvplugin_installed_t gvdevice_quartz_types_for_cairo;
25#endif
26/* data consumer backed by the gvdevice */
27
28static size_t device_data_consumer_put_bytes (void *info, const void *buffer, size_t count)
29{
30 return gvwrite(info, buffer, count);
31}
32
37
38#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
39
40CFStringRef format_to_uti(format_type format)
41{
42 switch (format) {
43 case FORMAT_BMP:
44 return CFSTR("com.microsoft.bmp");
45 case FORMAT_EXR:
46 return CFSTR("com.ilm.openexr-image");
47 case FORMAT_GIF:
48 return CFSTR("com.compuserve.gif");
49 case FORMAT_ICNS:
50 return CFSTR("com.apple.icns");
51 case FORMAT_ICO:
52 return CFSTR("com.microsoft.ico");
53 case FORMAT_JPEG:
54 return CFSTR("public.jpeg");
55 case FORMAT_JPEG2000:
56 return CFSTR("public.jpeg-2000");
57 case FORMAT_PICT:
58 return CFSTR("com.apple.pict");
59 case FORMAT_PNG:
60 return CFSTR("public.png");
61 case FORMAT_PSD:
62 return CFSTR("com.adobe.photoshop-image");
63 case FORMAT_SGI:
64 return CFSTR("com.sgi.sgi-image");
65 case FORMAT_TIFF:
66 return CFSTR("public.tiff");
67 case FORMAT_TGA:
68 return CFSTR("com.truevision.tga-image");
69 default:
70 return NULL;
71 }
72}
73
74#endif
75
76static gvplugin_api_t apis[] = {
77 {API_render, &gvrender_quartz_types},
78 {API_textlayout, &gvtextlayout_quartz_types},
79 {API_loadimage, &gvloadimage_quartz_types},
80 {API_device, &gvdevice_quartz_types},
81#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 && defined(HAVE_PANGOCAIRO)
82 {API_device, &gvdevice_quartz_types_for_cairo},
83#endif
84 {(api_t)0, 0},
85};
86
node NULL
Definition grammar.y:163
api_t
Definition gvcext.h:32
size_t gvwrite(GVJ_t *job, const char *s, size_t len)
Definition gvdevice.c:180
GVIO_API const char * format
Definition gvio.h:51
format_type
@ FORMAT_TIFF
@ FORMAT_BMP
static size_t device_data_consumer_put_bytes(void *info, const void *buffer, size_t count)
gvplugin_installed_t gvtextlayout_quartz_types
gvplugin_installed_t gvloadimage_quartz_types
gvplugin_installed_t gvrender_quartz_types
gvplugin_installed_t gvdevice_quartz_types
static gvplugin_api_t apis[]
gvplugin_library_t gvplugin_quartz_LTX_library
CGDataConsumerCallbacks device_data_consumer_callbacks
@ FORMAT_ICO
@ FORMAT_PICT
@ FORMAT_EXR
@ FORMAT_JPEG2000
@ FORMAT_TGA
@ FORMAT_ICNS
@ FORMAT_PSD
@ FORMAT_SGI
@ FORMAT_JPEG
Definition gvrender_gd.c:37
@ FORMAT_GIF
Definition gvrender_gd.c:36
@ FORMAT_PNG
Definition gvrender_gd.c:38
ingroup plugin_api
Definition gvplugin.h:35
graphs, nodes and edges info: Agraphinfo_t, Agnodeinfo_t and Agedgeinfo_t