1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Details at https://graphviz.org
*************************************************************************/
#pragma once
#include <Availability.h>
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
#include <CoreGraphics/CoreGraphics.h>
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
#include <ApplicationServices/ApplicationServices.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
FORMAT_NONE,
FORMAT_CGIMAGE,
FORMAT_BMP,
FORMAT_EXR,
FORMAT_GIF,
FORMAT_ICNS,
FORMAT_ICO,
FORMAT_JPEG,
FORMAT_JPEG2000,
FORMAT_PDF,
FORMAT_PICT,
FORMAT_PNG,
FORMAT_PSD,
FORMAT_SGI,
FORMAT_TIFF,
FORMAT_TGA
} format_type;
static const int BITS_PER_COMPONENT = 8; /* bits per color component */
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000
CFStringRef format_to_uti(format_type format);
#endif
extern CGDataConsumerCallbacks device_data_consumer_callbacks;
/* gvtextlayout_quartz.c in Mac OS X: layout is a CoreText CTLineRef */
/* GVTextLayout.m in iPhoneOS: layout is a custom Objective-C GVTextLayout */
void *quartz_new_layout(char* fontname, double fontsize, char* text);
void quartz_size_layout(void *layout, double* width, double* height, double* yoffset_layout);
void quartz_draw_layout(void *layout, CGContextRef context, CGPoint position);
void quartz_free_layout(void *layout);
#ifdef __cplusplus
}
#endif
|