-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreGraphics.framework.h
More file actions
5962 lines (4362 loc) · 223 KB
/
Copy pathCoreGraphics.framework.h
File metadata and controls
5962 lines (4362 loc) · 223 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== CoreGraphics.framework/Headers/CGGeometry.h
/* CoreGraphics - CGGeometry.h
Copyright (c) 1998-2011 Apple Inc.
All rights reserved. */
#ifndef CGGEOMETRY_H_
#define CGGEOMETRY_H_
#include <CoreGraphics/CGBase.h>
#include <CoreFoundation/CFDictionary.h>
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
/* Points. */
struct
CGPoint {
CGFloat x;
CGFloat y;
};
typedef struct CG_BOXABLE CGPoint CGPoint;
/* Sizes. */
struct CGSize {
CGFloat width;
CGFloat height;
};
typedef struct CG_BOXABLE CGSize CGSize;
/* Vectors. */
#define CGVECTOR_DEFINED 1
struct CGVector {
CGFloat dx;
CGFloat dy;
};
typedef struct CG_BOXABLE CGVector CGVector;
/* Rectangles. */
struct CGRect {
CGPoint origin;
CGSize size;
};
typedef struct CG_BOXABLE CGRect CGRect;
/* Rectangle edges. */
typedef CF_CLOSED_ENUM(uint32_t, CGRectEdge) {
CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, CGRectMaxYEdge
};
/* The "zero" point -- equivalent to CGPointMake(0, 0). */
CG_EXTERN const CGPoint CGPointZero
CG_AVAILABLE_STARTING(10.0, 2.0);
/* The "zero" size -- equivalent to CGSizeMake(0, 0). */
CG_EXTERN const CGSize CGSizeZero
CG_AVAILABLE_STARTING(10.0, 2.0);
/* The "zero" rectangle -- equivalent to CGRectMake(0, 0, 0, 0). */
CG_EXTERN const CGRect CGRectZero
CG_AVAILABLE_STARTING(10.0, 2.0);
/* The "empty" rect. This is the rectangle returned when, for example, we
intersect two disjoint rectangles. Note that the null rect is not the
same as the zero rect. */
CG_EXTERN const CGRect CGRectNull
CG_AVAILABLE_STARTING(10.0, 2.0);
/* The infinite rectangle. */
CG_EXTERN const CGRect CGRectInfinite
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Make a point from `(x, y)'. */
CG_INLINE CGPoint CGPointMake(CGFloat x, CGFloat y);
/* Make a size from `(width, height)'. */
CG_INLINE CGSize CGSizeMake(CGFloat width, CGFloat height);
/* Make a vector from `(dx, dy)'. */
CG_INLINE CGVector CGVectorMake(CGFloat dx, CGFloat dy);
/* Make a rect from `(x, y; width, height)'. */
CG_INLINE CGRect CGRectMake(CGFloat x, CGFloat y, CGFloat width,
CGFloat height);
/* Return the leftmost x-value of `rect'. */
CG_EXTERN CGFloat CGRectGetMinX(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the midpoint x-value of `rect'. */
CG_EXTERN CGFloat CGRectGetMidX(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the rightmost x-value of `rect'. */
CG_EXTERN CGFloat CGRectGetMaxX(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the bottommost y-value of `rect'. */
CG_EXTERN CGFloat CGRectGetMinY(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the midpoint y-value of `rect'. */
CG_EXTERN CGFloat CGRectGetMidY(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the topmost y-value of `rect'. */
CG_EXTERN CGFloat CGRectGetMaxY(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the width of `rect'. */
CG_EXTERN CGFloat CGRectGetWidth(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the height of `rect'. */
CG_EXTERN CGFloat CGRectGetHeight(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `point1' and `point2' are the same, false otherwise. */
CG_EXTERN bool CGPointEqualToPoint(CGPoint point1, CGPoint point2)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `size1' and `size2' are the same, false otherwise. */
CG_EXTERN bool CGSizeEqualToSize(CGSize size1, CGSize size2)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `rect1' and `rect2' are the same, false otherwise. */
CG_EXTERN bool CGRectEqualToRect(CGRect rect1, CGRect rect2)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Standardize `rect' -- i.e., convert it to an equivalent rect which has
positive width and height. */
CG_EXTERN CGRect CGRectStandardize(CGRect rect) __attribute__ ((warn_unused_result))
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `rect' is empty (that is, if it has zero width or height),
false otherwise. A null rect is defined to be empty. */
CG_EXTERN bool CGRectIsEmpty(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `rect' is the null rectangle, false otherwise. */
CG_EXTERN bool CGRectIsNull(CGRect rect)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `rect' is the infinite rectangle, false otherwise. */
CG_EXTERN bool CGRectIsInfinite(CGRect rect)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Inset `rect' by `(dx, dy)' -- i.e., offset its origin by `(dx, dy)', and
decrease its size by `(2*dx, 2*dy)'. */
CG_EXTERN CGRect CGRectInset(CGRect rect, CGFloat dx, CGFloat dy) __attribute__ ((warn_unused_result))
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Expand `rect' to the smallest rect containing it with integral origin and
size. */
CG_EXTERN CGRect CGRectIntegral(CGRect rect) __attribute__ ((warn_unused_result))
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the union of `r1' and `r2'. */
CG_EXTERN CGRect CGRectUnion(CGRect r1, CGRect r2) __attribute__ ((warn_unused_result))
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return the intersection of `r1' and `r2'. This may return a null rect. */
CG_EXTERN CGRect CGRectIntersection(CGRect r1, CGRect r2) __attribute__ ((warn_unused_result))
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Offset `rect' by `(dx, dy)'. */
CG_EXTERN CGRect CGRectOffset(CGRect rect, CGFloat dx, CGFloat dy) __attribute__ ((warn_unused_result))
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Make two new rectangles, `slice' and `remainder', by dividing `rect' with
a line that's parallel to one of its sides, specified by `edge' -- either
`CGRectMinXEdge', `CGRectMinYEdge', `CGRectMaxXEdge', or
`CGRectMaxYEdge'. The size of `slice' is determined by `amount', which
measures the distance from the specified edge. */
CG_EXTERN void CGRectDivide(CGRect rect, CGRect * slice,
CGRect * remainder, CGFloat amount, CGRectEdge edge)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `point' is contained in `rect', false otherwise. */
CG_EXTERN bool CGRectContainsPoint(CGRect rect, CGPoint point)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `rect2' is contained in `rect1', false otherwise. `rect2'
is contained in `rect1' if the union of `rect1' and `rect2' is equal to
`rect1'. */
CG_EXTERN bool CGRectContainsRect(CGRect rect1, CGRect rect2)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return true if `rect1' intersects `rect2', false otherwise. `rect1'
intersects `rect2' if the intersection of `rect1' and `rect2' is not the
null rect. */
CG_EXTERN bool CGRectIntersectsRect(CGRect rect1, CGRect rect2)
CG_AVAILABLE_STARTING(10.0, 2.0);
/*** Persistent representations. ***/
/* Return a dictionary representation of `point'. */
CG_EXTERN CFDictionaryRef CGPointCreateDictionaryRepresentation(
CGPoint point)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* Make a CGPoint from the contents of `dict' (presumably returned earlier
from `CGPointCreateDictionaryRepresentation') and store the value in
`point'. Returns true on success; false otherwise. */
CG_EXTERN bool CGPointMakeWithDictionaryRepresentation(
CFDictionaryRef cg_nullable dict, CGPoint * cg_nullable point)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* Return a dictionary representation of `size'. */
CG_EXTERN CFDictionaryRef CGSizeCreateDictionaryRepresentation(CGSize size)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* Make a CGSize from the contents of `dict' (presumably returned earlier
from `CGSizeCreateDictionaryRepresentation') and store the value in
`size'. Returns true on success; false otherwise. */
CG_EXTERN bool CGSizeMakeWithDictionaryRepresentation(
CFDictionaryRef cg_nullable dict, CGSize * cg_nullable size)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* Return a dictionary representation of `rect'. */
CG_EXTERN CFDictionaryRef CGRectCreateDictionaryRepresentation(CGRect)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* Make a CGRect from the contents of `dict' (presumably returned earlier
from `CGRectCreateDictionaryRepresentation') and store the value in
`rect'. Returns true on success; false otherwise. */
CG_EXTERN bool CGRectMakeWithDictionaryRepresentation(
CFDictionaryRef cg_nullable dict, CGRect * cg_nullable rect)
CG_AVAILABLE_STARTING(10.5, 2.0);
/*** Definitions of inline functions. ***/
CG_INLINE CGPoint
CGPointMake(CGFloat x, CGFloat y)
{
CGPoint p; p.x = x; p.y = y; return p;
}
CG_INLINE CGSize
CGSizeMake(CGFloat width, CGFloat height)
{
CGSize size; size.width = width; size.height = height; return size;
}
CG_INLINE CGVector
CGVectorMake(CGFloat dx, CGFloat dy)
{
CGVector vector; vector.dx = dx; vector.dy = dy; return vector;
}
CG_INLINE CGRect
CGRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height)
{
CGRect rect;
rect.origin.x = x; rect.origin.y = y;
rect.size.width = width; rect.size.height = height;
return rect;
}
CG_INLINE bool
__CGPointEqualToPoint(CGPoint point1, CGPoint point2)
{
return point1.x == point2.x && point1.y == point2.y;
}
#define CGPointEqualToPoint __CGPointEqualToPoint
CG_INLINE bool
__CGSizeEqualToSize(CGSize size1, CGSize size2)
{
return size1.width == size2.width && size1.height == size2.height;
}
#define CGSizeEqualToSize __CGSizeEqualToSize
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGGEOMETRY_H_ */
// ========== CoreGraphics.framework/Headers/CGPDFOperatorTable.h
/* CoreGraphics - CGPDFOperatorTable.h
* Copyright (c) 2004-2008 Apple Inc.
* All rights reserved. */
#ifndef CGPDFOPERATORTABLE_H_
#define CGPDFOPERATORTABLE_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
typedef struct CGPDFOperatorTable *CGPDFOperatorTableRef;
#include <CoreGraphics/CGPDFScanner.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
typedef void (*CGPDFOperatorCallback)(CGPDFScannerRef scanner,
void * __nullable info);
/* Return an empty operator table. */
CG_EXTERN CGPDFOperatorTableRef __nullable CGPDFOperatorTableCreate(void)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Increment the retain count of `table'. */
CG_EXTERN CGPDFOperatorTableRef cg_nullable CGPDFOperatorTableRetain(
CGPDFOperatorTableRef cg_nullable table)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Decrement the retain count of `table'. */
CG_EXTERN void CGPDFOperatorTableRelease(
CGPDFOperatorTableRef cg_nullable table)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Set the callback for the operator named `name' to `callback' */
CG_EXTERN void CGPDFOperatorTableSetCallback(
CGPDFOperatorTableRef cg_nullable table,
const char * cg_nullable name, CGPDFOperatorCallback cg_nullable callback)
CG_AVAILABLE_STARTING(10.4, 2.0);
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGPDFOPERATORTABLE_H_ */
// ========== CoreGraphics.framework/Headers/CGError.h
/* CoreGraphics - CGError.h
Copyright (c) 2000-2011 Apple Inc.
All rights reserved. */
#ifndef CGERROR_H_
#define CGERROR_H_
#include <CoreGraphics/CGBase.h>
#include <stdint.h>
#include <CoreFoundation/CFAvailability.h>
/* Types used for errors and error handlers. */
typedef CF_ENUM (int32_t, CGError) {
kCGErrorSuccess = 0,
kCGErrorFailure = 1000,
kCGErrorIllegalArgument = 1001,
kCGErrorInvalidConnection = 1002,
kCGErrorInvalidContext = 1003,
kCGErrorCannotComplete = 1004,
kCGErrorNotImplemented = 1006,
kCGErrorRangeCheck = 1007,
kCGErrorTypeCheck = 1008,
kCGErrorInvalidOperation = 1010,
kCGErrorNoneAvailable = 1011,
};
#endif /* CGERROR_H_ */
// ========== CoreGraphics.framework/Headers/CGFunction.h
/* CoreGraphics - CGFunction.h
Copyright (c) 1999-2011 Apple Inc.
All rights reserved. */
#ifndef CGFUNCTION_H_
#define CGFUNCTION_H_
#include <CoreFoundation/CFBase.h>
/* A CGFunction is a general floating-point function evaluator which uses a
user-specified callback to map an arbitrary number of inputs to an
arbitrary number of outputs. */
typedef struct CF_BRIDGED_TYPE(id) CGFunction *CGFunctionRef;
#include <CoreGraphics/CGBase.h>
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
/* This callback evaluates a function, using `in' as inputs, and places the
result in `out'. `info' is the info parameter passed to the CGFunction
creation functions. */
typedef void (*CGFunctionEvaluateCallback)(void * __nullable info,
const CGFloat * in, CGFloat * out);
/* When a function is deallocated, this callback releases `info', the info
parameter passed to the CGFunction creation functions. */
typedef void (*CGFunctionReleaseInfoCallback)(void * __nullable info);
/* Callbacks for a CGFunction.
`version' is the version number of this structure. This structure is
version 0.
`evaluate' is the callback used to evaluate the function.
`releaseInfo', if non-NULL, is the callback used to release the info
parameter passed to the CGFunction creation functions when the
function is deallocated. */
struct CGFunctionCallbacks {
unsigned int version;
CGFunctionEvaluateCallback __nullable evaluate;
CGFunctionReleaseInfoCallback __nullable releaseInfo;
};
typedef struct CGFunctionCallbacks CGFunctionCallbacks;
/* Return the CFTypeID for CGFunctionRefs. */
CG_EXTERN CFTypeID CGFunctionGetTypeID(void)
CG_AVAILABLE_STARTING(10.2, 2.0);
/* Create a CGFunction using `callbacks' to evaluate the function. `info' is
passed to each of the callback functions. `domainDimension' is the number
of input values to the function; `rangeDimension' is the number of output
values from the function.
`domain' is an array of 2M values, where M is the number of input values.
For each k from 0 to M-1, domain[2*k] must be less than or equal to
domain[2*k+1]. The k'th input value (in[k]) will be clipped to lie in
this interval, so that domain[2*k] <= in[k] <= domain[2*k+1]. If `domain'
is NULL, then the input values will not be clipped. However, it's
strongly recommended that `domain' be specified; each domain interval
should specify reasonable values for the minimum and maximum in that
dimension.
`range' is an array of 2N values, where N is the number of output values.
For each k from 0 to N-1, range[2*k] must be less than or equal to
range[2*k+1]. The k'th output value (out[k]) will be clipped to lie in
this interval, so that range[2*k] <= out[k] <= range[2*k+1]. If `range'
is NULL, then the output values will not be clipped. However, it's
strongly recommended that `range' be specified; each range interval
should specify reasonable values for the minimum and maximum in that
dimension.
The contents of the callbacks structure is copied, so, for example, a
pointer to a structure on the stack can be passed to this function. */
CG_EXTERN CGFunctionRef __nullable CGFunctionCreate(void * __nullable info,
size_t domainDimension, const CGFloat *__nullable domain,
size_t rangeDimension, const CGFloat * __nullable range,
const CGFunctionCallbacks * cg_nullable callbacks)
CG_AVAILABLE_STARTING(10.2, 2.0);
/* Equivalent to `CFRetain(function)', except it doesn't crash (as CFRetain
does) if `function' is NULL. */
CG_EXTERN CGFunctionRef cg_nullable CGFunctionRetain(
CGFunctionRef cg_nullable function)
CG_AVAILABLE_STARTING(10.2, 2.0);
/* Equivalent to `CFRelease(function)', except it doesn't crash (as
CFRelease does) if `function' is NULL. */
CG_EXTERN void CGFunctionRelease(CGFunctionRef cg_nullable function)
CG_AVAILABLE_STARTING(10.2, 2.0);
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGFUNCTION_H_ */
// ========== CoreGraphics.framework/Headers/CGPDFStream.h
/* CoreGraphics - CGPDFStream.h
* Copyright (c) 2002-2008 Apple Inc.
* All rights reserved. */
#ifndef CGPDFSTREAM_H_
#define CGPDFSTREAM_H_
typedef struct CGPDFStream *CGPDFStreamRef;
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
typedef CF_ENUM (int32_t, CGPDFDataFormat) {
CGPDFDataFormatRaw, CGPDFDataFormatJPEGEncoded, CGPDFDataFormatJPEG2000
};
#include <CoreGraphics/CGBase.h>
#include <CoreGraphics/CGPDFDictionary.h>
#include <CoreGraphics/CGPDFStream.h>
#include <CoreFoundation/CFData.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
/* Return the dictionary of `stream'. */
CG_EXTERN CGPDFDictionaryRef __nullable CGPDFStreamGetDictionary(
CGPDFStreamRef cg_nullable stream)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Return the data of `stream'. */
CG_EXTERN CFDataRef __nullable CGPDFStreamCopyData(
CGPDFStreamRef cg_nullable stream,
CGPDFDataFormat * cg_nullable format)
CG_AVAILABLE_STARTING(10.3, 2.0);
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGPDFSTREAM_H_ */
// ========== CoreGraphics.framework/Headers/CGDataProvider.h
/* CoreGraphics - CGDataProvider.h
Copyright (c) 1999-2011 Apple Inc.
All rights reserved. */
#ifndef CGDATAPROVIDER_H_
#define CGDATAPROVIDER_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
typedef struct CF_BRIDGED_TYPE(id) CGDataProvider *CGDataProviderRef;
#include <CoreGraphics/CGBase.h>
#include <CoreFoundation/CFURL.h>
#include <sys/types.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
/* This callback is called to copy `count' bytes from the sequential data
stream to `buffer'. */
typedef size_t (*CGDataProviderGetBytesCallback)(void * __nullable info,
void * buffer, size_t count);
/* This callback is called to skip `count' bytes forward in the sequential
data stream. It should return the number of bytes that were actually
skipped. */
typedef off_t (*CGDataProviderSkipForwardCallback)(void * __nullable info,
off_t count);
/* This callback is called to rewind to the beginning of sequential data
stream. */
typedef void (*CGDataProviderRewindCallback)(void * __nullable info);
/* This callback is called to release the `info' pointer when the data
provider is freed. */
typedef void (*CGDataProviderReleaseInfoCallback)(void * __nullable info);
/* Callbacks for sequentially accessing data.
`version' is the version of this structure. It should be set to 0.
`getBytes' is called to copy `count' bytes from the sequential data
stream to `buffer'. It should return the number of bytes copied, or 0
if there's no more data.
`skipForward' is called to skip ahead in the sequential data stream by
`count' bytes.
`rewind' is called to rewind the sequential data stream to the beginning
of the data.
`releaseInfo', if non-NULL, is called to release the `info' pointer when
the provider is freed. */
struct CGDataProviderSequentialCallbacks {
unsigned int version;
CGDataProviderGetBytesCallback __nullable getBytes;
CGDataProviderSkipForwardCallback __nullable skipForward;
CGDataProviderRewindCallback __nullable rewind;
CGDataProviderReleaseInfoCallback __nullable releaseInfo;
};
typedef struct CGDataProviderSequentialCallbacks
CGDataProviderSequentialCallbacks;
/* This callback is called to get a pointer to the entire block of data. */
typedef const void * __nullable(*CGDataProviderGetBytePointerCallback)(
void * __nullable info);
/* This callback is called to release the pointer to entire block of
data. */
typedef void (*CGDataProviderReleaseBytePointerCallback)(
void * __nullable info, const void * pointer);
/* This callback is called to copy `count' bytes at byte offset `position'
into `buffer'. */
typedef size_t (*CGDataProviderGetBytesAtPositionCallback)(
void * __nullable info, void * buffer, off_t pos, size_t cnt);
/* Callbacks for directly accessing data.
`version' is the version of this structure. It should be set to 0.
`getBytePointer', if non-NULL, is called to return a pointer to the
provider's entire block of data. This callback may be called multiple
times in proper sequence with `releaseBytePointer'. Data block does not
need to be available until this callback is invoked.
`releaseBytePointer', if non-NULL, is called to release a pointer to the
provider's entire block of data. This callback may be called multiple
times in proper sequence with `getBytePointer'. If possible, data should
be purged with this callback and refilled with `getBytePointer'.
`getBytesAtPosition', if non-NULL, is called to copy `count' bytes at
offset `position' from the provider's data to `buffer'. It should
return the number of bytes copied, or 0 if there's no more data.
`releaseInfo', if non-NULL, is called to release the `info' pointer when
the provider is freed.
At least one of `getBytePointer' or `getBytesAtPosition' must be
non-NULL.
If both `getBytePointer' are present `getBytesAtPosition', the latter one
may be ignored. */
struct CGDataProviderDirectCallbacks {
unsigned int version;
CGDataProviderGetBytePointerCallback __nullable getBytePointer;
CGDataProviderReleaseBytePointerCallback __nullable releaseBytePointer;
CGDataProviderGetBytesAtPositionCallback __nullable getBytesAtPosition;
CGDataProviderReleaseInfoCallback __nullable releaseInfo;
};
typedef struct CGDataProviderDirectCallbacks CGDataProviderDirectCallbacks;
/* Return the CFTypeID for CGDataProviderRefs. */
CG_EXTERN CFTypeID CGDataProviderGetTypeID(void)
CG_AVAILABLE_STARTING(10.2, 2.0);
/* Create a sequential-access data provider using `callbacks' to provide the
data. `info' is passed to each of the callback functions. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderCreateSequential(
void * __nullable info,
const CGDataProviderSequentialCallbacks * cg_nullable callbacks)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* Create a direct-access data provider using `callbacks' to supply `size'
bytes of data. `info' is passed to each of the callback functions.
The underlying data must not change for the life of the data provider. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderCreateDirect(
void * __nullable info, off_t size,
const CGDataProviderDirectCallbacks * cg_nullable callbacks)
CG_AVAILABLE_STARTING(10.5, 2.0);
/* The callback used by `CGDataProviderCreateWithData'. */
typedef void (*CGDataProviderReleaseDataCallback)(void * __nullable info,
const void * data, size_t size);
/* Create a direct-access data provider using `data', an array of `size'
bytes. `releaseData' is called when the data provider is freed, and is
passed `info' as its first argument. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderCreateWithData(
void * __nullable info, const void * cg_nullable data, size_t size,
CGDataProviderReleaseDataCallback cg_nullable releaseData)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Create a direct-access data provider which reads from `data'. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderCreateWithCFData(
CFDataRef cg_nullable data)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Create a data provider reading from `url'. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderCreateWithURL(
CFURLRef cg_nullable url)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Create a data provider reading from `filename'. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderCreateWithFilename(
const char * cg_nullable filename)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Equivalent to `CFRetain(provider)', but doesn't crash (as CFRetain does)
if `provider' is NULL. */
CG_EXTERN CGDataProviderRef __nullable CGDataProviderRetain(
CGDataProviderRef cg_nullable provider)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Equivalent to `CFRelease(provider)', but doesn't crash (as CFRelease
does) if `provider' is NULL. */
CG_EXTERN void CGDataProviderRelease(CGDataProviderRef cg_nullable provider)
CG_AVAILABLE_STARTING(10.0, 2.0);
/* Return a copy of the data specified by provider. Returns NULL if a
complete copy of the data can't be obtained (for example, if the
underlying data is too large to fit in memory). */
CG_EXTERN CFDataRef __nullable CGDataProviderCopyData(
CGDataProviderRef cg_nullable provider)
CG_AVAILABLE_STARTING(10.3, 2.0);
CG_EXTERN void* __nullable CGDataProviderGetInfo(CGDataProviderRef cg_nullable provider)
CG_AVAILABLE_STARTING(10.13, 11.0);
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGDATAPROVIDER_H_ */
// ========== CoreGraphics.framework/Headers/CGPDFArray.h
/* CoreGraphics - CGPDFArray.h
* Copyright (c) 2002-2008 Apple Inc.
* All rights reserved. */
#ifndef CGPDFARRAY_H_
#define CGPDFARRAY_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
typedef struct CGPDFArray *CGPDFArrayRef;
#include <CoreGraphics/CGPDFDictionary.h>
#include <CoreGraphics/CGPDFObject.h>
#include <CoreGraphics/CGPDFStream.h>
#include <CoreGraphics/CGPDFString.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
#/* Return the number of items in `array'. */
CG_EXTERN size_t CGPDFArrayGetCount(CGPDFArrayRef cg_nullable array)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and return the result in
`value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetObject(CGPDFArrayRef cg_nullable array, size_t index,
CGPDFObjectRef __nullable * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a null, return
true; otherwise, return false. */
CG_EXTERN bool CGPDFArrayGetNull(CGPDFArrayRef cg_nullable array, size_t index)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a boolean, return
the result in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetBoolean(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFBoolean * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's an integer, return
the result in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetInteger(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFInteger * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a number (real or
integer), return the result in `value'. Return true on success; false
otherwise. */
CG_EXTERN bool CGPDFArrayGetNumber(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFReal * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a name, return the
result in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetName(CGPDFArrayRef cg_nullable array,
size_t index, const char * __nullable * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a string, return
the result in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetString(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFStringRef __nullable * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's an array, return it
in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetArray(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFArrayRef __nullable * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a dictionary,
return it in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetDictionary(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFDictionaryRef __nullable * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* Look up the object at `index' in `array' and, if it's a stream, return it
in `value'. Return true on success; false otherwise. */
CG_EXTERN bool CGPDFArrayGetStream(CGPDFArrayRef cg_nullable array,
size_t index, CGPDFStreamRef __nullable * __nullable value)
CG_AVAILABLE_STARTING(10.3, 2.0);
/* The block function for `CGPDFArrayApplyBlock'. `index' is the current
iterator index, `value' is the CGPDFObject at this index. If the block
returns true, the iteration of the array will continue, otherwise if
the block returns false, the iterator will stop and return early. */
typedef bool (^CGPDFArrayApplierBlock)(size_t index,
CGPDFObjectRef value, void * __nullable info);
/* Enumerate all of the objects in `array', calling the block-function `block' once
for each value in the array. Passes the current iterator index, the current
value, and `info' to `block'. If `block' returns true, iteration will continue
over all values. If `block' returns false, iteration will stop and return
early. */
CG_EXTERN void CGPDFArrayApplyBlock(CGPDFArrayRef cg_nullable array,
CGPDFArrayApplierBlock cg_nullable block, void * __nullable info)
CG_AVAILABLE_STARTING(10.14, 12.0);
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGPDFARRAY_H_ */
// ========== CoreGraphics.framework/Headers/CGLayer.h
/* CoreGraphics - CGLayer.h
* Copyright (c) 2004-2008 Apple Inc.
* All rights reserved. */
#ifndef CGLAYER_H_
#define CGLAYER_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
typedef struct CF_BRIDGED_TYPE(id) CGLayer *CGLayerRef;
#include <CoreGraphics/CGBase.h>
#include <CoreGraphics/CGContext.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
/* Create a layer of size `size' relative to the context `context'. The
value of `size' is specified in default user space (base space) units.
The parameter `auxiliaryInfo' should be NULL; it is reserved for future
expansion. */
CG_EXTERN CGLayerRef __nullable CGLayerCreateWithContext(
CGContextRef cg_nullable context,
CGSize size, CFDictionaryRef __nullable auxiliaryInfo)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Equivalent to `CFRetain(layer)', except it doesn't crash (as CFRetain
does) if `layer' is NULL. */
CG_EXTERN CGLayerRef cg_nullable CGLayerRetain(CGLayerRef cg_nullable layer)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Equivalent to `CFRelease(layer)', except it doesn't crash (as CFRelease
does) if `layer' is NULL. */
CG_EXTERN void CGLayerRelease(CGLayerRef cg_nullable layer)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Return the size of the layer `layer'. CGSizeZero if invalid `layer'. */
CG_EXTERN CGSize CGLayerGetSize(CGLayerRef cg_nullable layer)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Return the context of `layer'. */
CG_EXTERN CGContextRef __nullable CGLayerGetContext(CGLayerRef cg_nullable layer)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Draw the contents of `layer' into `rect' of `context'. The contents are
scaled, if necessary, to fit into `rect'; the rectangle `rect' is in user
space. */
CG_EXTERN void CGContextDrawLayerInRect(CGContextRef cg_nullable context,
CGRect rect, CGLayerRef cg_nullable layer)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Draw the contents of `layer' at `point' in `context'. This is equivalent
to calling "CGContextDrawLayerInRect" with a rectangle having origin at
`point' and size equal to the size of `layer'. */
CG_EXTERN void CGContextDrawLayerAtPoint(CGContextRef cg_nullable context,
CGPoint point, CGLayerRef cg_nullable layer)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Return the CFTypeID for CGLayerRefs. */
CG_EXTERN CFTypeID CGLayerGetTypeID(void)
CG_AVAILABLE_STARTING(10.4, 2.0);
CF_ASSUME_NONNULL_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* CGLAYER_H_ */
// ========== CoreGraphics.framework/Headers/CGPDFScanner.h
/* CoreGraphics - CGPDFScanner.h
Copyright (c) 2004-2011 Apple Inc.
All rights reserved. */
#ifndef CGPDFSCANNER_H_
#define CGPDFSCANNER_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFAvailability.h>
#include <stdint.h>
typedef struct CGPDFScanner *CGPDFScannerRef;
#include <CoreGraphics/CGPDFContentStream.h>
#include <CoreGraphics/CGPDFOperatorTable.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_ASSUME_NONNULL_BEGIN
/* Create a scanner. */
CG_EXTERN CGPDFScannerRef CGPDFScannerCreate(
CGPDFContentStreamRef cs,
CGPDFOperatorTableRef __nullable table, void * __nullable info)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Retain `scanner'. */
CG_EXTERN CGPDFScannerRef cg_nullable CGPDFScannerRetain(
CGPDFScannerRef cg_nullable scanner)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Release `scanner'. */
CG_EXTERN void CGPDFScannerRelease(CGPDFScannerRef cg_nullable scanner)
CG_AVAILABLE_STARTING(10.4, 2.0);
/* Scan the content stream of `scanner'. Returns true if the entire stream
was scanned successfully; false if scanning failed for some reason (for