]> git.wh0rd.org - ICEs.git/blame - 148285/gdevpdfe.i.1
add bfin ice
[ICEs.git] / 148285 / gdevpdfe.i.1
CommitLineData
45516216 1# 1 "./src/gdevpdfe.c"
2# 1 "<built-in>"
3# 1 "<command line>"
4# 1 "./src/gdevpdfe.c"
5# 16 "./src/gdevpdfe.c"
6# 1 "./src/gx.h" 1
7# 20 "./src/gx.h"
8# 1 "./src/stdio_.h" 1
9# 24 "./src/stdio_.h"
10# 1 "./src/std.h" 1
11# 20 "./src/std.h"
12# 1 "./src/stdpre.h" 1
13# 244 "./src/stdpre.h"
14typedef unsigned char byte;
15typedef unsigned char uchar;
16typedef unsigned short ushort;
17typedef unsigned int uint;
18typedef unsigned long ulong;
19# 264 "./src/stdpre.h"
20# 1 "/usr/include/sys/types.h" 1 3 4
21# 27 "/usr/include/sys/types.h" 3 4
22# 1 "/usr/include/features.h" 1 3 4
23# 323 "/usr/include/features.h" 3 4
24# 1 "/usr/include/sys/cdefs.h" 1 3 4
25# 313 "/usr/include/sys/cdefs.h" 3 4
26# 1 "/usr/include/bits/wordsize.h" 1 3 4
27# 314 "/usr/include/sys/cdefs.h" 2 3 4
28# 324 "/usr/include/features.h" 2 3 4
29# 346 "/usr/include/features.h" 3 4
30# 1 "/usr/include/gnu/stubs.h" 1 3 4
31
32
33
34# 1 "/usr/include/bits/wordsize.h" 1 3 4
35# 5 "/usr/include/gnu/stubs.h" 2 3 4
36
37
38# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
39# 8 "/usr/include/gnu/stubs.h" 2 3 4
40# 347 "/usr/include/features.h" 2 3 4
41# 28 "/usr/include/sys/types.h" 2 3 4
42
43
44
45# 1 "/usr/include/bits/types.h" 1 3 4
46# 28 "/usr/include/bits/types.h" 3 4
47# 1 "/usr/include/bits/wordsize.h" 1 3 4
48# 29 "/usr/include/bits/types.h" 2 3 4
49
50
51# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
52# 214 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4
53typedef unsigned int size_t;
54# 32 "/usr/include/bits/types.h" 2 3 4
55
56
57typedef unsigned char __u_char;
58typedef unsigned short int __u_short;
59typedef unsigned int __u_int;
60typedef unsigned long int __u_long;
61
62
63typedef signed char __int8_t;
64typedef unsigned char __uint8_t;
65typedef signed short int __int16_t;
66typedef unsigned short int __uint16_t;
67typedef signed int __int32_t;
68typedef unsigned int __uint32_t;
69
70
71
72
73__extension__ typedef signed long long int __int64_t;
74__extension__ typedef unsigned long long int __uint64_t;
75
76
77
78
79
80
81
82__extension__ typedef long long int __quad_t;
83__extension__ typedef unsigned long long int __u_quad_t;
84# 134 "/usr/include/bits/types.h" 3 4
85# 1 "/usr/include/bits/typesizes.h" 1 3 4
86# 135 "/usr/include/bits/types.h" 2 3 4
87
88
89__extension__ typedef __u_quad_t __dev_t;
90__extension__ typedef unsigned int __uid_t;
91__extension__ typedef unsigned int __gid_t;
92__extension__ typedef unsigned long int __ino_t;
93__extension__ typedef __u_quad_t __ino64_t;
94__extension__ typedef unsigned int __mode_t;
95__extension__ typedef unsigned int __nlink_t;
96__extension__ typedef long int __off_t;
97__extension__ typedef __quad_t __off64_t;
98__extension__ typedef int __pid_t;
99__extension__ typedef struct { int __val[2]; } __fsid_t;
100__extension__ typedef long int __clock_t;
101__extension__ typedef unsigned long int __rlim_t;
102__extension__ typedef __u_quad_t __rlim64_t;
103__extension__ typedef unsigned int __id_t;
104__extension__ typedef long int __time_t;
105__extension__ typedef unsigned int __useconds_t;
106__extension__ typedef long int __suseconds_t;
107
108__extension__ typedef int __daddr_t;
109__extension__ typedef long int __swblk_t;
110__extension__ typedef int __key_t;
111
112
113__extension__ typedef int __clockid_t;
114
115
116__extension__ typedef void * __timer_t;
117
118
119__extension__ typedef long int __blksize_t;
120
121
122
123
124__extension__ typedef long int __blkcnt_t;
125__extension__ typedef __quad_t __blkcnt64_t;
126
127
128__extension__ typedef unsigned long int __fsblkcnt_t;
129__extension__ typedef __u_quad_t __fsblkcnt64_t;
130
131
132__extension__ typedef unsigned long int __fsfilcnt_t;
133__extension__ typedef __u_quad_t __fsfilcnt64_t;
134
135__extension__ typedef int __ssize_t;
136
137
138
139typedef __off64_t __loff_t;
140typedef __quad_t *__qaddr_t;
141typedef char *__caddr_t;
142
143
144__extension__ typedef int __intptr_t;
145
146
147__extension__ typedef unsigned int __socklen_t;
148# 32 "/usr/include/sys/types.h" 2 3 4
149
150
151
152typedef __u_char u_char;
153typedef __u_short u_short;
154typedef __u_int u_int;
155typedef __u_long u_long;
156typedef __quad_t quad_t;
157typedef __u_quad_t u_quad_t;
158typedef __fsid_t fsid_t;
159
160
161
162
163typedef __loff_t loff_t;
164
165
166
167typedef __ino_t ino_t;
168# 62 "/usr/include/sys/types.h" 3 4
169typedef __dev_t dev_t;
170
171
172
173
174typedef __gid_t gid_t;
175
176
177
178
179typedef __mode_t mode_t;
180
181
182
183
184typedef __nlink_t nlink_t;
185
186
187
188
189typedef __uid_t uid_t;
190
191
192
193
194
195typedef __off_t off_t;
196# 100 "/usr/include/sys/types.h" 3 4
197typedef __pid_t pid_t;
198
199
200
201
202typedef __id_t id_t;
203
204
205
206
207typedef __ssize_t ssize_t;
208
209
210
211
212
213typedef __daddr_t daddr_t;
214typedef __caddr_t caddr_t;
215
216
217
218
219
220typedef __key_t key_t;
221# 133 "/usr/include/sys/types.h" 3 4
222# 1 "/usr/include/time.h" 1 3 4
223# 75 "/usr/include/time.h" 3 4
224
225
226typedef __time_t time_t;
227
228
229
230# 93 "/usr/include/time.h" 3 4
231typedef __clockid_t clockid_t;
232# 105 "/usr/include/time.h" 3 4
233typedef __timer_t timer_t;
234# 134 "/usr/include/sys/types.h" 2 3 4
235# 147 "/usr/include/sys/types.h" 3 4
236# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
237# 148 "/usr/include/sys/types.h" 2 3 4
238
239
240
241typedef unsigned long int ulong_;
242typedef unsigned short int ushort_;
243typedef unsigned int uint_;
244# 195 "/usr/include/sys/types.h" 3 4
245typedef int int8_t __attribute__ ((__mode__ (__QI__)));
246typedef int int16_t __attribute__ ((__mode__ (__HI__)));
247typedef int int32_t __attribute__ ((__mode__ (__SI__)));
248typedef int int64_t __attribute__ ((__mode__ (__DI__)));
249
250
251typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
252typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
253typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
254typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
255
256typedef int register_t __attribute__ ((__mode__ (__word__)));
257# 217 "/usr/include/sys/types.h" 3 4
258# 1 "/usr/include/endian.h" 1 3 4
259# 37 "/usr/include/endian.h" 3 4
260# 1 "/usr/include/bits/endian.h" 1 3 4
261# 38 "/usr/include/endian.h" 2 3 4
262# 218 "/usr/include/sys/types.h" 2 3 4
263
264
265# 1 "/usr/include/sys/select.h" 1 3 4
266# 31 "/usr/include/sys/select.h" 3 4
267# 1 "/usr/include/bits/select.h" 1 3 4
268# 32 "/usr/include/sys/select.h" 2 3 4
269
270
271# 1 "/usr/include/bits/sigset.h" 1 3 4
272# 23 "/usr/include/bits/sigset.h" 3 4
273typedef int __sig_atomic_t;
274
275
276
277
278typedef struct
279 {
280 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
281 } __sigset_t;
282# 35 "/usr/include/sys/select.h" 2 3 4
283
284
285
286typedef __sigset_t sigset_t;
287
288
289
290
291
292# 1 "/usr/include/time.h" 1 3 4
293# 121 "/usr/include/time.h" 3 4
294struct timespec
295 {
296 __time_t tv_sec;
297 long int tv_nsec;
298 };
299# 45 "/usr/include/sys/select.h" 2 3 4
300
301# 1 "/usr/include/bits/time.h" 1 3 4
302# 69 "/usr/include/bits/time.h" 3 4
303struct timeval
304 {
305 __time_t tv_sec;
306 __suseconds_t tv_usec;
307 };
308# 47 "/usr/include/sys/select.h" 2 3 4
309
310
311typedef __suseconds_t suseconds_t;
312
313
314
315
316
317typedef long int __fd_mask;
318# 67 "/usr/include/sys/select.h" 3 4
319typedef struct
320 {
321
322
323
324
325
326
327 __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
328
329
330 } fd_set;
331
332
333
334
335
336
337typedef __fd_mask fd_mask;
338# 99 "/usr/include/sys/select.h" 3 4
339
340# 109 "/usr/include/sys/select.h" 3 4
341extern int select (int __nfds, fd_set *__restrict __readfds,
342 fd_set *__restrict __writefds,
343 fd_set *__restrict __exceptfds,
344 struct timeval *__restrict __timeout);
345# 121 "/usr/include/sys/select.h" 3 4
346extern int pselect (int __nfds, fd_set *__restrict __readfds,
347 fd_set *__restrict __writefds,
348 fd_set *__restrict __exceptfds,
349 const struct timespec *__restrict __timeout,
350 const __sigset_t *__restrict __sigmask);
351
352
353
354# 221 "/usr/include/sys/types.h" 2 3 4
355
356
357# 1 "/usr/include/sys/sysmacros.h" 1 3 4
358# 29 "/usr/include/sys/sysmacros.h" 3 4
359__extension__
360extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
361 __attribute__ ((__nothrow__));
362__extension__
363extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
364 __attribute__ ((__nothrow__));
365__extension__
366extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
367 unsigned int __minor)
368 __attribute__ ((__nothrow__));
369
370
371__extension__ extern __inline unsigned int
372__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
373{
374 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
375}
376
377__extension__ extern __inline unsigned int
378__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
379{
380 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
381}
382
383__extension__ extern __inline unsigned long long int
384__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
385{
386 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
387 | (((unsigned long long int) (__minor & ~0xff)) << 12)
388 | (((unsigned long long int) (__major & ~0xfff)) << 32));
389}
390# 224 "/usr/include/sys/types.h" 2 3 4
391# 235 "/usr/include/sys/types.h" 3 4
392typedef __blkcnt_t blkcnt_t;
393
394
395
396typedef __fsblkcnt_t fsblkcnt_t;
397
398
399
400typedef __fsfilcnt_t fsfilcnt_t;
401# 270 "/usr/include/sys/types.h" 3 4
402# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
403# 36 "/usr/include/bits/pthreadtypes.h" 3 4
404typedef unsigned long int pthread_t;
405
406
407typedef union
408{
409 char __size[36];
410 long int __align;
411} pthread_attr_t;
412
413
414typedef struct __pthread_internal_slist
415{
416 struct __pthread_internal_slist *__next;
417} __pthread_slist_t;
418
419
420
421
422typedef union
423{
424 struct __pthread_mutex_s
425 {
426 int __lock;
427 unsigned int __count;
428 int __owner;
429
430
431 int __kind;
432 unsigned int __nusers;
433 __extension__ union
434 {
435 int __spins;
436 __pthread_slist_t __list;
437 };
438 } __data;
439 char __size[24];
440 long int __align;
441} pthread_mutex_t;
442
443typedef union
444{
445 char __size[4];
446 long int __align;
447} pthread_mutexattr_t;
448
449
450
451
452typedef union
453{
454 struct
455 {
456 int __lock;
457 unsigned int __futex;
458 __extension__ unsigned long long int __total_seq;
459 __extension__ unsigned long long int __wakeup_seq;
460 __extension__ unsigned long long int __woken_seq;
461 void *__mutex;
462 unsigned int __nwaiters;
463 unsigned int __broadcast_seq;
464 } __data;
465 char __size[48];
466 __extension__ long long int __align;
467} pthread_cond_t;
468
469typedef union
470{
471 char __size[4];
472 long int __align;
473} pthread_condattr_t;
474
475
476
477typedef unsigned int pthread_key_t;
478
479
480
481typedef int pthread_once_t;
482
483
484
485
486
487typedef union
488{
489 struct
490 {
491 int __lock;
492 unsigned int __nr_readers;
493 unsigned int __readers_wakeup;
494 unsigned int __writer_wakeup;
495 unsigned int __nr_readers_queued;
496 unsigned int __nr_writers_queued;
497
498
499 unsigned int __flags;
500 int __writer;
501 } __data;
502 char __size[32];
503 long int __align;
504} pthread_rwlock_t;
505
506typedef union
507{
508 char __size[8];
509 long int __align;
510} pthread_rwlockattr_t;
511
512
513
514
515
516typedef volatile int pthread_spinlock_t;
517
518
519
520
521typedef union
522{
523 char __size[20];
524 long int __align;
525} pthread_barrier_t;
526
527typedef union
528{
529 char __size[4];
530 int __align;
531} pthread_barrierattr_t;
532# 271 "/usr/include/sys/types.h" 2 3 4
533
534
535
536# 265 "./src/stdpre.h" 2
537# 285 "./src/stdpre.h"
538typedef int bool;
539# 322 "./src/stdpre.h"
540typedef const char *ptr_ord_t;
541# 363 "./src/stdpre.h"
542typedef double floatp;
543# 391 "./src/stdpre.h"
544typedef const char *client_name_t;
545# 419 "./src/stdpre.h"
546# 1 "./src/stdpn.h" 1
547# 420 "./src/stdpre.h" 2
548# 21 "./src/std.h" 2
549
550
551# 1 "./obj/../soobj/arch.h" 1
552# 24 "./src/std.h" 2
553# 68 "./src/std.h"
554typedef ushort bits16;
555
556
557typedef uint bits32;
558# 142 "./src/std.h"
559# 1 "/usr/include/stdio.h" 1 3 4
560# 30 "/usr/include/stdio.h" 3 4
561
562
563
564
565# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
566# 35 "/usr/include/stdio.h" 2 3 4
567# 44 "/usr/include/stdio.h" 3 4
568
569
570typedef struct _IO_FILE FILE;
571
572
573
574
575
576# 62 "/usr/include/stdio.h" 3 4
577typedef struct _IO_FILE __FILE;
578# 72 "/usr/include/stdio.h" 3 4
579# 1 "/usr/include/libio.h" 1 3 4
580# 32 "/usr/include/libio.h" 3 4
581# 1 "/usr/include/_G_config.h" 1 3 4
582# 14 "/usr/include/_G_config.h" 3 4
583# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
584# 326 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4
585typedef long int wchar_t;
586# 355 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4
587typedef unsigned int wint_t;
588# 15 "/usr/include/_G_config.h" 2 3 4
589# 24 "/usr/include/_G_config.h" 3 4
590# 1 "/usr/include/wchar.h" 1 3 4
591# 48 "/usr/include/wchar.h" 3 4
592# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
593# 49 "/usr/include/wchar.h" 2 3 4
594
595# 1 "/usr/include/bits/wchar.h" 1 3 4
596# 51 "/usr/include/wchar.h" 2 3 4
597# 76 "/usr/include/wchar.h" 3 4
598typedef struct
599{
600 int __count;
601 union
602 {
603 wint_t __wch;
604 char __wchb[4];
605 } __value;
606} __mbstate_t;
607# 25 "/usr/include/_G_config.h" 2 3 4
608
609typedef struct
610{
611 __off_t __pos;
612 __mbstate_t __state;
613} _G_fpos_t;
614typedef struct
615{
616 __off64_t __pos;
617 __mbstate_t __state;
618} _G_fpos64_t;
619# 44 "/usr/include/_G_config.h" 3 4
620# 1 "/usr/include/gconv.h" 1 3 4
621# 28 "/usr/include/gconv.h" 3 4
622# 1 "/usr/include/wchar.h" 1 3 4
623# 48 "/usr/include/wchar.h" 3 4
624# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
625# 49 "/usr/include/wchar.h" 2 3 4
626# 29 "/usr/include/gconv.h" 2 3 4
627
628
629# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
630# 32 "/usr/include/gconv.h" 2 3 4
631
632
633
634
635
636enum
637{
638 __GCONV_OK = 0,
639 __GCONV_NOCONV,
640 __GCONV_NODB,
641 __GCONV_NOMEM,
642
643 __GCONV_EMPTY_INPUT,
644 __GCONV_FULL_OUTPUT,
645 __GCONV_ILLEGAL_INPUT,
646 __GCONV_INCOMPLETE_INPUT,
647
648 __GCONV_ILLEGAL_DESCRIPTOR,
649 __GCONV_INTERNAL_ERROR
650};
651
652
653
654enum
655{
656 __GCONV_IS_LAST = 0x0001,
657 __GCONV_IGNORE_ERRORS = 0x0002
658};
659
660
661
662struct __gconv_step;
663struct __gconv_step_data;
664struct __gconv_loaded_object;
665struct __gconv_trans_data;
666
667
668
669typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
670 __const unsigned char **, __const unsigned char *,
671 unsigned char **, size_t *, int, int);
672
673
674typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);
675
676
677typedef int (*__gconv_init_fct) (struct __gconv_step *);
678typedef void (*__gconv_end_fct) (struct __gconv_step *);
679
680
681
682typedef int (*__gconv_trans_fct) (struct __gconv_step *,
683 struct __gconv_step_data *, void *,
684 __const unsigned char *,
685 __const unsigned char **,
686 __const unsigned char *, unsigned char **,
687 size_t *);
688
689
690typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
691 __const unsigned char *,
692 unsigned char *, unsigned char *);
693
694
695typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
696 size_t *);
697
698
699typedef int (*__gconv_trans_init_fct) (void **, const char *);
700typedef void (*__gconv_trans_end_fct) (void *);
701
702struct __gconv_trans_data
703{
704
705 __gconv_trans_fct __trans_fct;
706 __gconv_trans_context_fct __trans_context_fct;
707 __gconv_trans_end_fct __trans_end_fct;
708 void *__data;
709 struct __gconv_trans_data *__next;
710};
711
712
713
714struct __gconv_step
715{
716 struct __gconv_loaded_object *__shlib_handle;
717 __const char *__modname;
718
719 int __counter;
720
721 char *__from_name;
722 char *__to_name;
723
724 __gconv_fct __fct;
725 __gconv_btowc_fct __btowc_fct;
726 __gconv_init_fct __init_fct;
727 __gconv_end_fct __end_fct;
728
729
730
731 int __min_needed_from;
732 int __max_needed_from;
733 int __min_needed_to;
734 int __max_needed_to;
735
736
737 int __stateful;
738
739 void *__data;
740};
741
742
743
744struct __gconv_step_data
745{
746 unsigned char *__outbuf;
747 unsigned char *__outbufend;
748
749
750
751 int __flags;
752
753
754
755 int __invocation_counter;
756
757
758
759 int __internal_use;
760
761 __mbstate_t *__statep;
762 __mbstate_t __state;
763
764
765
766 struct __gconv_trans_data *__trans;
767};
768
769
770
771typedef struct __gconv_info
772{
773 size_t __nsteps;
774 struct __gconv_step *__steps;
775 __extension__ struct __gconv_step_data __data [];
776} *__gconv_t;
777# 45 "/usr/include/_G_config.h" 2 3 4
778typedef union
779{
780 struct __gconv_info __cd;
781 struct
782 {
783 struct __gconv_info __cd;
784 struct __gconv_step_data __data;
785 } __combined;
786} _G_iconv_t;
787
788typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
789typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
790typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
791typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
792# 33 "/usr/include/libio.h" 2 3 4
793# 53 "/usr/include/libio.h" 3 4
794# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stdarg.h" 1 3 4
795# 43 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stdarg.h" 3 4
796typedef __builtin_va_list __gnuc_va_list;
797# 54 "/usr/include/libio.h" 2 3 4
798# 166 "/usr/include/libio.h" 3 4
799struct _IO_jump_t; struct _IO_FILE;
800# 176 "/usr/include/libio.h" 3 4
801typedef void _IO_lock_t;
802
803
804
805
806
807struct _IO_marker {
808 struct _IO_marker *_next;
809 struct _IO_FILE *_sbuf;
810
811
812
813 int _pos;
814# 199 "/usr/include/libio.h" 3 4
815};
816
817
818enum __codecvt_result
819{
820 __codecvt_ok,
821 __codecvt_partial,
822 __codecvt_error,
823 __codecvt_noconv
824};
825# 267 "/usr/include/libio.h" 3 4
826struct _IO_FILE {
827 int _flags;
828
829
830
831
832 char* _IO_read_ptr;
833 char* _IO_read_end;
834 char* _IO_read_base;
835 char* _IO_write_base;
836 char* _IO_write_ptr;
837 char* _IO_write_end;
838 char* _IO_buf_base;
839 char* _IO_buf_end;
840
841 char *_IO_save_base;
842 char *_IO_backup_base;
843 char *_IO_save_end;
844
845 struct _IO_marker *_markers;
846
847 struct _IO_FILE *_chain;
848
849 int _fileno;
850
851
852
853 int _flags2;
854
855 __off_t _old_offset;
856
857
858
859 unsigned short _cur_column;
860 signed char _vtable_offset;
861 char _shortbuf[1];
862
863
864
865 _IO_lock_t *_lock;
866# 315 "/usr/include/libio.h" 3 4
867 __off64_t _offset;
868# 324 "/usr/include/libio.h" 3 4
869 void *__pad1;
870 void *__pad2;
871 void *__pad3;
872 void *__pad4;
873 size_t __pad5;
874
875 int _mode;
876
877 char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
878
879};
880
881
882typedef struct _IO_FILE _IO_FILE;
883
884
885struct _IO_FILE_plus;
886
887extern struct _IO_FILE_plus _IO_2_1_stdin_;
888extern struct _IO_FILE_plus _IO_2_1_stdout_;
889extern struct _IO_FILE_plus _IO_2_1_stderr_;
890# 360 "/usr/include/libio.h" 3 4
891typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
892
893
894
895
896
897
898
899typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
900 size_t __n);
901
902
903
904
905
906
907
908typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
909
910
911typedef int __io_close_fn (void *__cookie);
912# 412 "/usr/include/libio.h" 3 4
913extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__));
914extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__));
915extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__));
916extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__));
917extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__));
918extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__));
919# 450 "/usr/include/libio.h" 3 4
920extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__));
921extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__));
922extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
923extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
924
925extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__));
926
927
928
929
930
931extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
932extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
933extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
934# 480 "/usr/include/libio.h" 3 4
935extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
936 __gnuc_va_list, int *__restrict);
937extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
938 __gnuc_va_list);
939extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__));
940extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__));
941
942extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__));
943extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__));
944
945extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
946# 73 "/usr/include/stdio.h" 2 3 4
947# 86 "/usr/include/stdio.h" 3 4
948
949
950typedef _G_fpos_t fpos_t;
951
952
953
954
955# 138 "/usr/include/stdio.h" 3 4
956# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
957# 139 "/usr/include/stdio.h" 2 3 4
958
959
960
961extern struct _IO_FILE *stdin;
962extern struct _IO_FILE *stdout;
963extern struct _IO_FILE *stderr;
964
965
966
967
968
969
970
971extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
972
973extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988extern FILE *tmpfile (void);
989# 183 "/usr/include/stdio.h" 3 4
990extern char *tmpnam (char *__s) __attribute__ ((__nothrow__));
991
992
993
994
995
996extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__));
997# 201 "/usr/include/stdio.h" 3 4
998extern char *tempnam (__const char *__dir, __const char *__pfx)
999 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
1000
1001
1002
1003
1004
1005
1006
1007
1008extern int fclose (FILE *__stream);
1009
1010
1011
1012
1013extern int fflush (FILE *__stream);
1014
1015# 226 "/usr/include/stdio.h" 3 4
1016extern int fflush_unlocked (FILE *__stream);
1017# 240 "/usr/include/stdio.h" 3 4
1018
1019
1020
1021
1022
1023
1024extern FILE *fopen (__const char *__restrict __filename,
1025 __const char *__restrict __modes);
1026
1027
1028
1029
1030extern FILE *freopen (__const char *__restrict __filename,
1031 __const char *__restrict __modes,
1032 FILE *__restrict __stream);
1033# 267 "/usr/include/stdio.h" 3 4
1034
1035# 278 "/usr/include/stdio.h" 3 4
1036extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__));
1037# 304 "/usr/include/stdio.h" 3 4
1038
1039
1040
1041extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
1042
1043
1044
1045extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1046 int __modes, size_t __n) __attribute__ ((__nothrow__));
1047
1048
1049
1050
1051
1052extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
1053 size_t __size) __attribute__ ((__nothrow__));
1054
1055
1056extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
1057
1058
1059
1060
1061
1062
1063
1064
1065extern int fprintf (FILE *__restrict __stream,
1066 __const char *__restrict __format, ...);
1067
1068
1069
1070
1071extern int printf (__const char *__restrict __format, ...);
1072
1073extern int sprintf (char *__restrict __s,
1074 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1075
1076
1077
1078
1079
1080extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
1081 __gnuc_va_list __arg);
1082
1083
1084
1085
1086extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
1087
1088extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
1089 __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1090
1091
1092
1093
1094
1095extern int snprintf (char *__restrict __s, size_t __maxlen,
1096 __const char *__restrict __format, ...)
1097 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1098
1099extern int vsnprintf (char *__restrict __s, size_t __maxlen,
1100 __const char *__restrict __format, __gnuc_va_list __arg)
1101 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1102
1103# 398 "/usr/include/stdio.h" 3 4
1104
1105
1106
1107
1108
1109extern int fscanf (FILE *__restrict __stream,
1110 __const char *__restrict __format, ...) ;
1111
1112
1113
1114
1115extern int scanf (__const char *__restrict __format, ...) ;
1116
1117extern int sscanf (__const char *__restrict __s,
1118 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1119
1120# 440 "/usr/include/stdio.h" 3 4
1121
1122
1123
1124
1125
1126extern int fgetc (FILE *__stream);
1127extern int getc (FILE *__stream);
1128
1129
1130
1131
1132
1133extern int getchar (void);
1134
1135# 464 "/usr/include/stdio.h" 3 4
1136extern int getc_unlocked (FILE *__stream);
1137extern int getchar_unlocked (void);
1138# 475 "/usr/include/stdio.h" 3 4
1139extern int fgetc_unlocked (FILE *__stream);
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151extern int fputc (int __c, FILE *__stream);
1152extern int putc (int __c, FILE *__stream);
1153
1154
1155
1156
1157
1158extern int putchar (int __c);
1159
1160# 508 "/usr/include/stdio.h" 3 4
1161extern int fputc_unlocked (int __c, FILE *__stream);
1162
1163
1164
1165
1166
1167
1168
1169extern int putc_unlocked (int __c, FILE *__stream);
1170extern int putchar_unlocked (int __c);
1171
1172
1173
1174
1175
1176
1177extern int getw (FILE *__stream);
1178
1179
1180extern int putw (int __w, FILE *__stream);
1181
1182
1183
1184
1185
1186
1187
1188
1189extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1190 ;
1191
1192
1193
1194
1195
1196
1197extern char *gets (char *__s) ;
1198
1199# 589 "/usr/include/stdio.h" 3 4
1200
1201
1202
1203
1204
1205extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
1206
1207
1208
1209
1210
1211extern int puts (__const char *__s);
1212
1213
1214
1215
1216
1217
1218extern int ungetc (int __c, FILE *__stream);
1219
1220
1221
1222
1223
1224
1225extern size_t fread (void *__restrict __ptr, size_t __size,
1226 size_t __n, FILE *__restrict __stream) ;
1227
1228
1229
1230
1231extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
1232 size_t __n, FILE *__restrict __s) ;
1233
1234# 642 "/usr/include/stdio.h" 3 4
1235extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1236 size_t __n, FILE *__restrict __stream) ;
1237extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
1238 size_t __n, FILE *__restrict __stream) ;
1239
1240
1241
1242
1243
1244
1245
1246
1247extern int fseek (FILE *__stream, long int __off, int __whence);
1248
1249
1250
1251
1252extern long int ftell (FILE *__stream) ;
1253
1254
1255
1256
1257extern void rewind (FILE *__stream);
1258
1259# 678 "/usr/include/stdio.h" 3 4
1260extern int fseeko (FILE *__stream, __off_t __off, int __whence);
1261
1262
1263
1264
1265extern __off_t ftello (FILE *__stream) ;
1266# 697 "/usr/include/stdio.h" 3 4
1267
1268
1269
1270
1271
1272
1273extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
1274
1275
1276
1277
1278extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
1279# 720 "/usr/include/stdio.h" 3 4
1280
1281# 729 "/usr/include/stdio.h" 3 4
1282
1283
1284extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
1285
1286extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
1287
1288extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
1289
1290
1291
1292
1293extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1294extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1295extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1296
1297
1298
1299
1300
1301
1302
1303
1304extern void perror (__const char *__s);
1305
1306
1307
1308
1309
1310
1311# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
1312# 27 "/usr/include/bits/sys_errlist.h" 3 4
1313extern int sys_nerr;
1314extern __const char *__const sys_errlist[];
1315# 759 "/usr/include/stdio.h" 2 3 4
1316
1317
1318
1319
1320extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
1321
1322
1323
1324
1325extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1326# 778 "/usr/include/stdio.h" 3 4
1327extern FILE *popen (__const char *__command, __const char *__modes) ;
1328
1329
1330
1331
1332
1333extern int pclose (FILE *__stream);
1334
1335
1336
1337
1338
1339extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
1340# 818 "/usr/include/stdio.h" 3 4
1341extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
1342
1343
1344
1345extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
1346
1347
1348extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
1349# 848 "/usr/include/stdio.h" 3 4
1350
1351# 143 "./src/std.h" 2
1352
1353
1354
1355
1356
1357
1358typedef struct gs_memory_s gs_memory_t;
1359# 164 "./src/std.h"
1360int outwrite(const gs_memory_t *mem, const char *str, int len);
1361int errwrite(const char *str, int len);
1362void outflush(const gs_memory_t *mem);
1363void errflush(void);
1364# 181 "./src/std.h"
1365int outprintf(const gs_memory_t *mem, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3)));
1366int errprintf(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2)));
1367
1368
1369
1370
1371
1372
1373
1374void dprintf_file_and_line(const char *, int);
1375
1376
1377
1378
1379
1380
1381void dflush(void);
1382# 255 "./src/std.h"
1383void printf_program_ident(const gs_memory_t *mem, const char *program_name, long revision_number);
1384void eprintf_program_ident(const char *program_name, long revision_number);
1385const char *gs_program_name(void);
1386long gs_revision_number(void);
1387# 286 "./src/std.h"
1388void lprintf_file_and_line(const char *, int);
1389# 25 "./src/stdio_.h" 2
1390# 42 "./src/stdio_.h"
1391int unlink(const char *);
1392# 21 "./src/gx.h" 2
1393# 1 "./src/gserror.h" 1
1394# 20 "./src/gserror.h"
1395int gs_log_error(int, const char *, int);
1396# 43 "./src/gserror.h"
1397const char *gs_errstr(int code);
1398
1399int gs_throw_imp(const char *func, const char *file, int line,
1400 int op, int code, const char *fmt, ...) __attribute__((__format__ (__printf__, 6, 7)));
1401# 22 "./src/gx.h" 2
1402# 1 "./src/gsio.h" 1
1403# 23 "./src/gx.h" 2
1404# 1 "./src/gstypes.h" 1
1405# 26 "./src/gstypes.h"
1406typedef ulong gs_id;
1407# 43 "./src/gstypes.h"
1408typedef struct gs_string_s {
1409 byte *data; uint size;
1410} gs_string;
1411
1412
1413
1414typedef struct gs_const_string_s {
1415 const byte *data; uint size;
1416} gs_const_string;
1417typedef struct gs_param_string_s {
1418 const byte *data; uint size;
1419 bool persistent;
1420} gs_param_string;
1421# 69 "./src/gstypes.h"
1422typedef struct gs_bytestring_s {
1423 byte *data; uint size;
1424 byte *bytes;
1425} gs_bytestring;
1426typedef struct gs_const_bytestring_s {
1427 const byte *data; uint size;
1428 const byte *bytes;
1429} gs_const_bytestring;
1430# 86 "./src/gstypes.h"
1431typedef struct gs_point_s {
1432 double x, y;
1433} gs_point;
1434typedef struct gs_int_point_s {
1435 int x, y;
1436} gs_int_point;
1437
1438
1439
1440
1441
1442typedef struct gs_log2_scale_point_s {
1443 int x, y;
1444} gs_log2_scale_point;
1445
1446
1447
1448
1449
1450
1451
1452typedef struct gs_rect_s {
1453 gs_point p, q;
1454} gs_rect;
1455typedef struct gs_int_rect_s {
1456 gs_int_point p, q;
1457} gs_int_rect;
1458
1459
1460
1461
1462
1463
1464typedef struct gs_range_s {
1465 float rmin, rmax;
1466} gs_range_t;
1467# 24 "./src/gx.h" 2
1468# 1 "./src/gsmemory.h" 1
1469# 41 "./src/gsmemory.h"
1470# 1 "./src/gslibctx.h" 1
1471# 20 "./src/gslibctx.h"
1472# 1 "./src/gs_dll_call.h" 1
1473# 21 "./src/gslibctx.h" 2
1474
1475
1476typedef struct name_table_s *name_table_ptr;
1477
1478typedef struct gs_lib_ctx_s
1479{
1480 gs_memory_t *memory;
1481 FILE *fstdin;
1482 FILE *fstdout;
1483 FILE *fstderr;
1484 FILE *fstdout2;
1485 bool stdout_is_redirected;
1486 bool stdout_to_stderr;
1487 bool stdin_is_interactive;
1488 void *caller_handle;
1489 int ( *stdin_fn)(void *caller_handle, char *buf, int len);
1490 int ( *stdout_fn)(void *caller_handle, const char *str, int len);
1491 int ( *stderr_fn)(void *caller_handle, const char *str, int len);
1492 int ( *poll_fn)(void *caller_handle);
1493 ulong gs_next_id;
1494 void *top_of_system;
1495
1496
1497 name_table_ptr gs_name_table;
1498
1499
1500
1501 bool dict_auto_expand;
1502} gs_lib_ctx_t;
1503
1504
1505
1506
1507
1508int gs_lib_ctx_init( gs_memory_t *mem );
1509
1510void *gs_lib_ctx_get_interp_instance( gs_memory_t *mem );
1511
1512
1513
1514
1515const gs_memory_t * gs_lib_ctx_get_non_gc_memory_t(void);
1516# 42 "./src/gsmemory.h" 2
1517
1518
1519typedef struct gs_memory_struct_type_s gs_memory_struct_type_t;
1520typedef const gs_memory_struct_type_t *gs_memory_type_ptr_t;
1521# 55 "./src/gsmemory.h"
1522typedef struct gs_ptr_procs_s gs_ptr_procs_t;
1523typedef const gs_ptr_procs_t *gs_ptr_type_t;
1524
1525
1526typedef struct gs_gc_root_s gs_gc_root_t;
1527
1528
1529
1530typedef client_name_t struct_name_t;
1531
1532
1533uint gs_struct_type_size(gs_memory_type_ptr_t);
1534
1535
1536struct_name_t gs_struct_type_name(gs_memory_type_ptr_t);
1537
1538
1539
1540
1541
1542
1543
1544typedef struct gs_memory_status_s {
1545
1546
1547
1548
1549
1550 ulong allocated;
1551
1552
1553
1554
1555 ulong used;
1556} gs_memory_status_t;
1557# 222 "./src/gsmemory.h"
1558typedef struct gs_memory_procs_s {
1559
1560 byte *(*alloc_bytes_immovable)(gs_memory_t *mem, uint nbytes, client_name_t cname); void *(*resize_object)(gs_memory_t *mem, void *obj, uint new_num_elements, client_name_t cname); void (*free_object)(gs_memory_t *mem, void *data, client_name_t cname); gs_memory_t *(*stable)(gs_memory_t *mem); void (*status)(gs_memory_t *mem, gs_memory_status_t *status); void (*free_all)(gs_memory_t *mem, uint free_mask, client_name_t cname); void (*consolidate_free)(gs_memory_t *mem);
1561# 250 "./src/gsmemory.h"
1562 byte *(*alloc_bytes)(gs_memory_t *mem, uint nbytes, client_name_t cname);
1563# 261 "./src/gsmemory.h"
1564 void *(*alloc_struct)(gs_memory_t *mem, gs_memory_type_ptr_t pstype, client_name_t cname);
1565
1566
1567 void *(*alloc_struct_immovable)(gs_memory_t *mem, gs_memory_type_ptr_t pstype, client_name_t cname);
1568# 275 "./src/gsmemory.h"
1569 byte *(*alloc_byte_array)(gs_memory_t *mem, uint num_elements, uint elt_size, client_name_t cname);
1570
1571
1572 byte *(*alloc_byte_array_immovable)(gs_memory_t *mem, uint num_elements, uint elt_size, client_name_t cname);
1573# 289 "./src/gsmemory.h"
1574 void *(*alloc_struct_array)(gs_memory_t *mem, uint num_elements, gs_memory_type_ptr_t pstype, client_name_t cname);
1575
1576
1577 void *(*alloc_struct_array_immovable)(gs_memory_t *mem, uint num_elements, gs_memory_type_ptr_t pstype, client_name_t cname);
1578# 302 "./src/gsmemory.h"
1579 uint (*object_size)(gs_memory_t *mem, const void *obj);
1580# 314 "./src/gsmemory.h"
1581 gs_memory_type_ptr_t (*object_type)(gs_memory_t *mem, const void *obj);
1582# 324 "./src/gsmemory.h"
1583 byte *(*alloc_string)(gs_memory_t *mem, uint nbytes, client_name_t cname);
1584
1585
1586 byte *(*alloc_string_immovable)(gs_memory_t *mem, uint nbytes, client_name_t cname);
1587# 339 "./src/gsmemory.h"
1588 byte *(*resize_string)(gs_memory_t *mem, byte *data, uint old_num, uint new_num, client_name_t cname);
1589# 350 "./src/gsmemory.h"
1590 void (*free_string)(gs_memory_t *mem, byte *data, uint nbytes, client_name_t cname);
1591# 364 "./src/gsmemory.h"
1592 int (*register_root)(gs_memory_t *mem, gs_gc_root_t *root, gs_ptr_type_t ptype, void **pp, client_name_t cname);
1593# 375 "./src/gsmemory.h"
1594 void (*unregister_root)(gs_memory_t *mem, gs_gc_root_t *root, client_name_t cname);
1595# 390 "./src/gsmemory.h"
1596 void (*enable_free)(gs_memory_t *mem, bool enable);
1597
1598} gs_memory_procs_t;
1599
1600
1601
1602
1603
1604
1605
1606void gs_free_const_object(gs_memory_t *mem, const void *data,
1607 client_name_t cname);
1608void gs_free_const_string(gs_memory_t *mem, const byte *data, uint nbytes,
1609 client_name_t cname);
1610
1611
1612
1613
1614
1615void gs_free_bytestring(gs_memory_t *mem, gs_bytestring *pbs,
1616 client_name_t cname);
1617void gs_free_const_bytestring(gs_memory_t *mem, gs_const_bytestring *pbs,
1618 client_name_t cname);
1619
1620
1621
1622
1623
1624void *gs_resize_struct_array(gs_memory_t *mem, void *obj, uint num_elements,
1625 gs_memory_type_ptr_t pstype,
1626 client_name_t cname);
1627
1628
1629int gs_register_struct_root(gs_memory_t *mem, gs_gc_root_t *root,
1630 void **pp, client_name_t cname);
1631
1632
1633void gs_ignore_free_object(gs_memory_t *mem, void *data, client_name_t cname);
1634void gs_ignore_free_string(gs_memory_t *mem, byte *data, uint nbytes, client_name_t cname);
1635
1636
1637void gs_ignore_consolidate_free(gs_memory_t *mem);
1638
1639
1640
1641
1642
1643
1644
1645void *gs_raw_alloc_struct_immovable(gs_memory_t * rmem,
1646 gs_memory_type_ptr_t pstype,
1647 client_name_t cname);
1648
1649typedef struct pl_mem_node_s pl_mem_node_t;
1650# 468 "./src/gsmemory.h"
1651struct gs_memory_s {
1652 gs_memory_t *stable_memory; gs_memory_procs_t procs; gs_lib_ctx_t *gs_lib_ctx; pl_mem_node_t *head; gs_memory_t *non_gc_memory;
1653};
1654# 25 "./src/gx.h" 2
1655# 1 "./src/gdebug.h" 1
1656# 50 "./src/gdebug.h"
1657extern char gs_debug[128];
1658bool gs_debug_c(int );
1659# 60 "./src/gdebug.h"
1660extern FILE *gs_debug_out;
1661# 114 "./src/gdebug.h"
1662void debug_dump_bytes(const byte * from, const byte * to,
1663 const char *msg);
1664void debug_dump_bitmap(const byte * from, uint raster, uint height,
1665 const char *msg);
1666void debug_print_string(const byte * str, uint len);
1667void debug_print_string_hex(const byte * str, uint len);
1668# 26 "./src/gx.h" 2
1669
1670
1671
1672
1673
1674
1675typedef struct gs_imager_state_s gs_imager_state;
1676
1677
1678
1679
1680typedef struct gs_state_s gs_state;
1681# 17 "./src/gdevpdfe.c" 2
1682# 1 "./src/string_.h" 1
1683# 30 "./src/string_.h"
1684# 1 "/usr/include/string.h" 1 3 4
1685# 28 "/usr/include/string.h" 3 4
1686
1687
1688
1689
1690
1691# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
1692# 34 "/usr/include/string.h" 2 3 4
1693
1694
1695
1696
1697extern void *memcpy (void *__restrict __dest,
1698 __const void *__restrict __src, size_t __n)
1699 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1700
1701
1702extern void *memmove (void *__dest, __const void *__src, size_t __n)
1703 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1704
1705
1706
1707
1708
1709
1710extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
1711 int __c, size_t __n)
1712 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1713
1714
1715
1716
1717
1718extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1719
1720
1721extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
1722 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1723
1724
1725extern void *memchr (__const void *__s, int __c, size_t __n)
1726 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1727
1728# 82 "/usr/include/string.h" 3 4
1729
1730
1731extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
1732 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1733
1734extern char *strncpy (char *__restrict __dest,
1735 __const char *__restrict __src, size_t __n)
1736 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1737
1738
1739extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
1740 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1741
1742extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
1743 size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1744
1745
1746extern int strcmp (__const char *__s1, __const char *__s2)
1747 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1748
1749extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
1750 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1751
1752
1753extern int strcoll (__const char *__s1, __const char *__s2)
1754 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1755
1756extern size_t strxfrm (char *__restrict __dest,
1757 __const char *__restrict __src, size_t __n)
1758 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1759
1760# 130 "/usr/include/string.h" 3 4
1761extern char *strdup (__const char *__s)
1762 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
1763# 165 "/usr/include/string.h" 3 4
1764
1765
1766extern char *strchr (__const char *__s, int __c)
1767 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1768
1769extern char *strrchr (__const char *__s, int __c)
1770 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1771
1772# 181 "/usr/include/string.h" 3 4
1773
1774
1775
1776extern size_t strcspn (__const char *__s, __const char *__reject)
1777 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1778
1779
1780extern size_t strspn (__const char *__s, __const char *__accept)
1781 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1782
1783extern char *strpbrk (__const char *__s, __const char *__accept)
1784 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1785
1786extern char *strstr (__const char *__haystack, __const char *__needle)
1787 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1788
1789
1790
1791extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
1792 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1793
1794
1795
1796
1797extern char *__strtok_r (char *__restrict __s,
1798 __const char *__restrict __delim,
1799 char **__restrict __save_ptr)
1800 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
1801
1802extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
1803 char **__restrict __save_ptr)
1804 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
1805# 240 "/usr/include/string.h" 3 4
1806
1807
1808extern size_t strlen (__const char *__s)
1809 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1810
1811# 254 "/usr/include/string.h" 3 4
1812
1813
1814extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
1815
1816# 270 "/usr/include/string.h" 3 4
1817extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1818# 288 "/usr/include/string.h" 3 4
1819extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1820
1821
1822
1823extern void bcopy (__const void *__src, void *__dest, size_t __n)
1824 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1825
1826
1827extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1828
1829
1830extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
1831 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1832
1833
1834extern char *index (__const char *__s, int __c)
1835 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1836
1837
1838extern char *rindex (__const char *__s, int __c)
1839 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1840
1841
1842
1843extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1844# 325 "/usr/include/string.h" 3 4
1845extern int strcasecmp (__const char *__s1, __const char *__s2)
1846 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1847
1848
1849extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
1850 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1851# 348 "/usr/include/string.h" 3 4
1852extern char *strsep (char **__restrict __stringp,
1853 __const char *__restrict __delim)
1854 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1855# 426 "/usr/include/string.h" 3 4
1856
1857# 31 "./src/string_.h" 2
1858# 18 "./src/gdevpdfe.c" 2
1859# 1 "./src/time_.h" 1
1860# 28 "./src/time_.h"
1861# 1 "./obj/../soobj/gconfig_.h" 1
1862# 29 "./src/time_.h" 2
1863
1864
1865
1866
1867
1868
1869# 1 "/usr/include/sys/time.h" 1 3 4
1870# 27 "/usr/include/sys/time.h" 3 4
1871# 1 "/usr/include/time.h" 1 3 4
1872# 28 "/usr/include/sys/time.h" 2 3 4
1873
1874# 1 "/usr/include/bits/time.h" 1 3 4
1875# 30 "/usr/include/sys/time.h" 2 3 4
1876# 39 "/usr/include/sys/time.h" 3 4
1877
1878# 57 "/usr/include/sys/time.h" 3 4
1879struct timezone
1880 {
1881 int tz_minuteswest;
1882 int tz_dsttime;
1883 };
1884
1885typedef struct timezone *__restrict __timezone_ptr_t;
1886# 73 "/usr/include/sys/time.h" 3 4
1887extern int gettimeofday (struct timeval *__restrict __tv,
1888 __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1889
1890
1891
1892
1893extern int settimeofday (__const struct timeval *__tv,
1894 __const struct timezone *__tz)
1895 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1896
1897
1898
1899
1900
1901extern int adjtime (__const struct timeval *__delta,
1902 struct timeval *__olddelta) __attribute__ ((__nothrow__));
1903
1904
1905
1906
1907enum __itimer_which
1908 {
1909
1910 ITIMER_REAL = 0,
1911
1912
1913 ITIMER_VIRTUAL = 1,
1914
1915
1916
1917 ITIMER_PROF = 2
1918
1919 };
1920
1921
1922
1923struct itimerval
1924 {
1925
1926 struct timeval it_interval;
1927
1928 struct timeval it_value;
1929 };
1930
1931
1932
1933
1934
1935
1936typedef int __itimer_which_t;
1937
1938
1939
1940
1941extern int getitimer (__itimer_which_t __which,
1942 struct itimerval *__value) __attribute__ ((__nothrow__));
1943
1944
1945
1946
1947extern int setitimer (__itimer_which_t __which,
1948 __const struct itimerval *__restrict __new,
1949 struct itimerval *__restrict __old) __attribute__ ((__nothrow__));
1950
1951
1952
1953
1954extern int utimes (__const char *__file, __const struct timeval __tvp[2])
1955 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1956
1957
1958
1959extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
1960 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1961
1962
1963extern int futimes (int __fd, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__));
1964# 191 "/usr/include/sys/time.h" 3 4
1965
1966# 36 "./src/time_.h" 2
1967
1968
1969
1970
1971
1972
1973# 1 "/usr/include/time.h" 1 3 4
1974# 31 "/usr/include/time.h" 3 4
1975
1976
1977
1978
1979
1980
1981
1982
1983# 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
1984# 40 "/usr/include/time.h" 2 3 4
1985
1986
1987
1988# 1 "/usr/include/bits/time.h" 1 3 4
1989# 44 "/usr/include/time.h" 2 3 4
1990# 59 "/usr/include/time.h" 3 4
1991
1992
1993typedef __clock_t clock_t;
1994
1995
1996
1997# 132 "/usr/include/time.h" 3 4
1998
1999
2000struct tm
2001{
2002 int tm_sec;
2003 int tm_min;
2004 int tm_hour;
2005 int tm_mday;
2006 int tm_mon;
2007 int tm_year;
2008 int tm_wday;
2009 int tm_yday;
2010 int tm_isdst;
2011
2012
2013 long int tm_gmtoff;
2014 __const char *tm_zone;
2015
2016
2017
2018
2019};
2020
2021
2022
2023
2024
2025
2026
2027
2028struct itimerspec
2029 {
2030 struct timespec it_interval;
2031 struct timespec it_value;
2032 };
2033
2034
2035struct sigevent;
2036# 181 "/usr/include/time.h" 3 4
2037
2038
2039
2040extern clock_t clock (void) __attribute__ ((__nothrow__));
2041
2042
2043extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
2044
2045
2046extern double difftime (time_t __time1, time_t __time0)
2047 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2048
2049
2050extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
2051
2052
2053
2054
2055
2056extern size_t strftime (char *__restrict __s, size_t __maxsize,
2057 __const char *__restrict __format,
2058 __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2059
2060# 229 "/usr/include/time.h" 3 4
2061
2062
2063
2064extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
2065
2066
2067
2068extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
2069
2070
2071
2072
2073
2074extern struct tm *gmtime_r (__const time_t *__restrict __timer,
2075 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2076
2077
2078
2079extern struct tm *localtime_r (__const time_t *__restrict __timer,
2080 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2081
2082
2083
2084
2085
2086extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
2087
2088
2089extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
2090
2091
2092
2093
2094
2095
2096
2097extern char *asctime_r (__const struct tm *__restrict __tp,
2098 char *__restrict __buf) __attribute__ ((__nothrow__));
2099
2100
2101extern char *ctime_r (__const time_t *__restrict __timer,
2102 char *__restrict __buf) __attribute__ ((__nothrow__));
2103
2104
2105
2106
2107extern char *__tzname[2];
2108extern int __daylight;
2109extern long int __timezone;
2110
2111
2112
2113
2114extern char *tzname[2];
2115
2116
2117
2118extern void tzset (void) __attribute__ ((__nothrow__));
2119
2120
2121
2122extern int daylight;
2123extern long int timezone;
2124
2125
2126
2127
2128
2129extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
2130# 312 "/usr/include/time.h" 3 4
2131extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
2132
2133
2134extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
2135
2136
2137extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2138# 327 "/usr/include/time.h" 3 4
2139extern int nanosleep (__const struct timespec *__requested_time,
2140 struct timespec *__remaining);
2141
2142
2143
2144extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
2145
2146
2147extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
2148
2149
2150extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
2151 __attribute__ ((__nothrow__));
2152
2153
2154
2155
2156
2157
2158extern int clock_nanosleep (clockid_t __clock_id, int __flags,
2159 __const struct timespec *__req,
2160 struct timespec *__rem);
2161
2162
2163extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
2164
2165
2166
2167
2168extern int timer_create (clockid_t __clock_id,
2169 struct sigevent *__restrict __evp,
2170 timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
2171
2172
2173extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
2174
2175
2176extern int timer_settime (timer_t __timerid, int __flags,
2177 __const struct itimerspec *__restrict __value,
2178 struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
2179
2180
2181extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
2182 __attribute__ ((__nothrow__));
2183
2184
2185extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
2186# 416 "/usr/include/time.h" 3 4
2187
2188# 43 "./src/time_.h" 2
2189# 78 "./src/time_.h"
2190# 1 "/usr/include/sys/times.h" 1 3 4
2191# 32 "/usr/include/sys/times.h" 3 4
2192
2193
2194
2195struct tms
2196 {
2197 clock_t tms_utime;
2198 clock_t tms_stime;
2199
2200 clock_t tms_cutime;
2201 clock_t tms_cstime;
2202 };
2203
2204
2205
2206
2207
2208
2209extern clock_t times (struct tms *__buffer) __attribute__ ((__nothrow__));
2210
2211
2212# 79 "./src/time_.h" 2
2213# 19 "./src/gdevpdfe.c" 2
2214# 1 "./src/stream.h" 1
2215# 21 "./src/stream.h"
2216# 1 "./src/scommon.h" 1
2217# 22 "./src/scommon.h"
2218# 1 "./src/gsstype.h" 1
2219# 21 "./src/gsstype.h"
2220typedef struct gc_state_s gc_state_t;
2221
2222
2223
2224
2225
2226typedef struct enum_ptr_s {
2227 const void *ptr;
2228 uint size;
2229} enum_ptr_t;
2230# 79 "./src/gsstype.h"
2231typedef struct struct_shared_procs_s struct_shared_procs_t;
2232
2233struct gs_memory_struct_type_s {
2234 uint ssize;
2235 struct_name_t sname;
2236
2237
2238
2239
2240 const struct_shared_procs_t *shared;
2241
2242
2243
2244 void (*clear_marks)(const gs_memory_t *cmem, void *pre, uint size, const gs_memory_struct_type_t *pstype);
2245 gs_ptr_type_t (*enum_ptrs)(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2246 void (*reloc_ptrs)(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2247 void (*finalize)(void *ptr);
2248
2249
2250
2251 const void *proc_data;
2252};
2253# 23 "./src/scommon.h" 2
2254# 34 "./src/scommon.h"
2255typedef struct stream_s stream;
2256
2257
2258
2259
2260
2261
2262typedef struct stream_state_s stream_state;
2263# 50 "./src/scommon.h"
2264typedef struct stream_template_s stream_template;
2265# 87 "./src/scommon.h"
2266typedef struct stream_cursor_read_s {
2267 const byte *ptr;
2268 const byte *limit;
2269 byte *_skip;
2270} stream_cursor_read;
2271typedef struct stream_cursor_write_s {
2272 const byte *_skip;
2273 byte *ptr;
2274 byte *limit;
2275} stream_cursor_write;
2276typedef union stream_cursor_s {
2277 stream_cursor_read r;
2278 stream_cursor_write w;
2279} stream_cursor;
2280# 134 "./src/scommon.h"
2281int s_no_report_error(stream_state *, const char *);
2282# 165 "./src/scommon.h"
2283struct stream_state_s {
2284 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
2285};
2286
2287extern const gs_memory_struct_type_t st_stream_state;
2288# 22 "./src/stream.h" 2
2289# 1 "./src/srdline.h" 1
2290# 43 "./src/srdline.h"
2291extern int sreadline(stream *s_in, stream *s_out, void *readline_data, gs_const_string *prompt, gs_string *buf, gs_memory_t *bufmem, uint *pcount, bool *pin_eol, bool (*is_stdin)(const stream *));
2292# 23 "./src/stream.h" 2
2293# 35 "./src/stream.h"
2294typedef struct {
2295
2296
2297
2298
2299
2300 int (*available)(stream *, long *);
2301
2302
2303
2304
2305
2306 int (*seek)(stream *, long);
2307
2308
2309
2310
2311
2312 void (*reset)(stream *);
2313
2314
2315
2316
2317
2318 int (*flush)(stream *);
2319
2320
2321
2322
2323
2324 int (*close)(stream *);
2325
2326
2327
2328 int (*process)(stream_state *, stream_cursor_read *, stream_cursor_write *, bool);
2329
2330
2331
2332
2333
2334
2335 int (*switch_mode)(stream *, bool);
2336
2337} stream_procs;
2338
2339
2340
2341struct stream_s {
2342
2343
2344
2345
2346
2347 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
2348# 110 "./src/stream.h"
2349 stream_cursor cursor;
2350 byte *cbuf;
2351 uint bsize;
2352 uint cbsize;
2353# 127 "./src/stream.h"
2354 short end_status;
2355
2356 byte foreign;
2357 byte modes;
2358# 139 "./src/stream.h"
2359 gs_string cbuf_string;
2360
2361 long position;
2362
2363 stream_procs procs;
2364 stream *strm;
2365
2366 int is_temp;
2367
2368
2369
2370
2371 int inline_temp;
2372
2373 stream_state *state;
2374
2375
2376
2377
2378
2379
2380 ushort read_id;
2381
2382
2383 ushort write_id;
2384 stream *prev, *next;
2385 bool close_strm;
2386 bool close_at_eod;
2387 int (*save_close)(stream *);
2388
2389
2390
2391
2392
2393 FILE *file;
2394 gs_const_string file_name;
2395
2396 uint file_modes;
2397
2398
2399 long file_offset;
2400 long file_limit;
2401};
2402
2403
2404extern const gs_memory_struct_type_t st_stream;
2405# 217 "./src/stream.h"
2406int savailable(stream *, long *);
2407
2408
2409
2410int sclose(stream *);
2411int sswitch(stream *, bool);
2412
2413
2414
2415
2416int spgetcc(stream *, bool);
2417# 240 "./src/stream.h"
2418int sgets(stream *, byte *, uint, uint *);
2419int sungetc(stream *, byte);
2420
2421
2422
2423
2424int spskip(stream *, long, long *);
2425
2426
2427
2428
2429
2430
2431
2432int s_process_read_buf(stream *);
2433
2434
2435
2436
2437int spputc(stream *, byte);
2438# 268 "./src/stream.h"
2439int sputs(stream *, const byte *, uint, uint *);
2440
2441
2442
2443
2444
2445int s_process_write_buf(stream *, bool);
2446
2447
2448long stell(stream *);
2449int spseek(stream *, long);
2450# 327 "./src/stream.h"
2451stream *s_alloc(gs_memory_t *, client_name_t);
2452stream_state *s_alloc_state(gs_memory_t *, gs_memory_type_ptr_t, client_name_t);
2453
2454
2455
2456
2457void s_init(stream *, gs_memory_t *);
2458void s_init_state(stream_state *, const stream_template *, gs_memory_t *);
2459
2460
2461void sread_string(stream *, const byte *, uint),
2462 sread_string_reusable(stream *, const byte *, uint),
2463 swrite_string(stream *, byte *, uint);
2464void sread_file(stream *, FILE *, byte *, uint),
2465 swrite_file(stream *, FILE *, byte *, uint),
2466 sappend_file(stream *, FILE *, byte *, uint);
2467
2468
2469int sread_subfile(stream *s, long start, long length);
2470
2471
2472
2473int ssetfilename(stream *, const byte *, uint);
2474
2475
2476
2477int sfilename(stream *, gs_const_string *);
2478
2479
2480
2481void swrite_position_only(stream *);
2482
2483
2484void s_std_init(stream *, byte *, uint, const stream_procs *, int );
2485
2486
2487void s_disable(stream *);
2488
2489
2490int s_std_null(stream *);
2491void s_std_read_reset(stream *), s_std_write_reset(stream *);
2492int s_std_read_flush(stream *), s_std_write_flush(stream *), s_std_noavailable(stream *, long *),
2493 s_std_noseek(stream *, long), s_std_close(stream *), s_std_switch_mode(stream *, bool);
2494
2495
2496int s_filter_write_flush(stream *), s_filter_close(stream *);
2497
2498
2499extern const stream_procs s_filter_read_procs, s_filter_write_procs;
2500# 385 "./src/stream.h"
2501int s_init_filter(stream *fs, stream_state *fss, byte *buf, uint bsize,
2502 stream *target);
2503stream *s_add_filter(stream **ps, const stream_template *template,
2504 stream_state *ss, gs_memory_t *mem);
2505
2506
2507
2508
2509
2510int s_close_filters(stream **ps, stream *target);
2511
2512
2513
2514extern const stream_template s_NullE_template;
2515extern const stream_template s_NullD_template;
2516# 20 "./src/gdevpdfe.c" 2
2517# 1 "./src/gp.h" 1
2518# 32 "./src/gp.h"
2519# 1 "./src/gpgetenv.h" 1
2520# 37 "./src/gpgetenv.h"
2521int gp_getenv(const char *key, char *ptr, int *plen);
2522# 33 "./src/gp.h" 2
2523# 47 "./src/gp.h"
2524void gp_init(void);
2525
2526
2527
2528
2529
2530void gp_exit(int exit_status, int code);
2531
2532
2533
2534
2535
2536void gp_do_exit(int exit_status);
2537# 68 "./src/gp.h"
2538const char *gp_strerror(int);
2539
2540
2541
2542
2543
2544
2545
2546void gp_get_realtime(long ptm[2]);
2547
2548
2549
2550
2551
2552void gp_get_usertime(long ptm[2]);
2553# 97 "./src/gp.h"
2554int gp_readline_init(void **preadline_data, gs_memory_t *mem);
2555
2556
2557
2558
2559int gp_readline(stream *s_in, stream *s_out, void *readline_data,
2560 gs_const_string *prompt, gs_string *buf,
2561 gs_memory_t *bufmem, uint *pcount, bool *pin_eol,
2562 bool (*is_stdin)(const stream *));
2563
2564
2565
2566
2567void gp_readline_finit(void *readline_data);
2568# 122 "./src/gp.h"
2569int gp_stdin_read(char *buf, int len, int interactive, FILE *f);
2570# 131 "./src/gp.h"
2571const char *gp_getenv_display(void);
2572# 145 "./src/gp.h"
2573extern const char gp_file_name_list_separator;
2574
2575
2576extern const char gp_scratch_file_name_prefix[];
2577
2578
2579extern const char gp_null_file_name[];
2580
2581
2582extern const char gp_current_directory_name[];
2583
2584
2585
2586
2587extern const char gp_fmode_binary_suffix[];
2588
2589
2590
2591extern const char gp_fmode_rb[];
2592extern const char gp_fmode_wb[];
2593# 182 "./src/gp.h"
2594FILE *gp_open_scratch_file(const char *prefix,
2595 char fname[260],
2596 const char *mode);
2597
2598
2599FILE *gp_fopen(const char *fname, const char *mode);
2600
2601
2602
2603int gp_setmode_binary(FILE * pfile, bool mode);
2604
2605typedef enum {
2606 gp_combine_small_buffer = -1,
2607 gp_combine_cant_handle = 0,
2608 gp_combine_success = 1
2609} gp_file_name_combine_result;
2610# 206 "./src/gp.h"
2611gp_file_name_combine_result gp_file_name_combine(const char *prefix, uint plen,
2612 const char *fname, uint flen, bool no_sibling, char *buffer, uint *blen);
2613# 218 "./src/gp.h"
2614uint gp_file_name_root(const char *fname, uint len);
2615# 227 "./src/gp.h"
2616uint gs_file_name_check_separator(const char *fname, int len, const char *item);
2617
2618
2619
2620
2621
2622bool gp_file_name_is_parent(const char *fname, uint len);
2623
2624
2625
2626
2627
2628bool gp_file_name_is_current(const char *fname, uint len);
2629
2630
2631
2632
2633
2634const char *gp_file_name_current(void);
2635
2636
2637
2638
2639
2640const char *gp_file_name_separator(void);
2641
2642
2643
2644
2645
2646const char *gp_file_name_directory_separator(void);
2647
2648
2649
2650
2651
2652const char *gp_file_name_parent(void);
2653
2654
2655
2656
2657bool gp_file_name_is_partent_allowed(void);
2658
2659
2660
2661
2662
2663bool gp_file_name_is_empty_item_meanful(void);
2664
2665
2666
2667
2668
2669int gp_read_macresource(byte *buf, const char *fname,
2670 const uint type, const ushort id);
2671# 304 "./src/gp.h"
2672int gp_cache_insert(int type, byte *key, int keylen, void *buffer, int buflen);
2673
2674
2675typedef void *(*gp_cache_alloc)(void *userdata, int bytes);
2676int gp_cache_query(int type, byte* key, int keylen, void **buffer,
2677 gp_cache_alloc alloc, void *userdata);
2678# 334 "./src/gp.h"
2679FILE *gp_open_printer(char fname[260], int binary_mode);
2680# 343 "./src/gp.h"
2681void gp_close_printer(FILE * pfile, const char *fname);
2682
2683
2684
2685
2686
2687typedef struct file_enum_s file_enum;
2688# 363 "./src/gp.h"
2689file_enum *gp_enumerate_files_init(const char *pat, uint patlen,
2690 gs_memory_t * memory);
2691# 373 "./src/gp.h"
2692uint gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen);
2693
2694
2695
2696
2697
2698
2699
2700void gp_enumerate_files_close(file_enum * pfen);
2701# 393 "./src/gp.h"
2702void *gp_enumerate_fonts_init(gs_memory_t *mem);
2703# 402 "./src/gp.h"
2704int gp_enumerate_fonts_next(void *enum_state, char **fontname, char **path);
2705
2706
2707void gp_enumerate_fonts_free(void *enum_state);
2708# 21 "./src/gdevpdfe.c" 2
2709# 1 "./src/smd5.h" 1
2710# 21 "./src/smd5.h"
2711# 1 "./src/md5.h" 1
2712# 52 "./src/md5.h"
2713typedef unsigned char md5_byte_t;
2714typedef unsigned int md5_word_t;
2715
2716
2717typedef struct md5_state_s {
2718 md5_word_t count[2];
2719 md5_word_t abcd[4];
2720 md5_byte_t buf[64];
2721} md5_state_t;
2722
2723
2724
2725
2726
2727
2728
2729void md5_init(md5_state_t *pms);
2730
2731
2732void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
2733
2734
2735void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
2736# 22 "./src/smd5.h" 2
2737
2738
2739
2740
2741
2742typedef struct stream_MD5E_state_s {
2743 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
2744 md5_state_t md5;
2745} stream_MD5E_state;
2746
2747
2748
2749
2750extern const stream_template s_MD5E_template;
2751
2752stream *s_MD5E_make_stream(gs_memory_t *mem, byte *digest, int digest_size);
2753
2754
2755
2756
2757
2758
2759stream *s_MD5C_make_stream(gs_memory_t *mem, stream *strm);
2760
2761int s_MD5C_get_digest(stream *s, byte *buf, int buf_length);
2762# 22 "./src/gdevpdfe.c" 2
2763# 1 "./src/gscdefs.h" 1
2764# 20 "./src/gscdefs.h"
2765# 1 "./obj/../soobj/gconfigv.h" 1
2766# 21 "./src/gscdefs.h" 2
2767# 39 "./src/gscdefs.h"
2768extern const long gs_buildtime;
2769extern const char *const gs_copyright;
2770extern const char *const gs_product;
2771extern const char *const gs_productfamily;
2772extern const long gs_revision;
2773extern const long gs_revisiondate;
2774extern const long gs_serialnumber;
2775
2776
2777extern const char *const gs_doc_directory;
2778extern const char *const gs_lib_default_path;
2779extern const char *const gs_init_file;
2780# 61 "./src/gscdefs.h"
2781extern const unsigned gx_image_class_table_count;
2782
2783
2784
2785extern const unsigned gx_image_type_table_count;
2786# 74 "./src/gscdefs.h"
2787extern const unsigned gx_io_device_table_count;
2788# 23 "./src/gdevpdfe.c" 2
2789# 1 "./src/gdevpdfx.h" 1
2790# 20 "./src/gdevpdfx.h"
2791# 1 "./src/gsparam.h" 1
2792# 34 "./src/gsparam.h"
2793typedef struct gs_param_list_s gs_param_list;
2794
2795
2796
2797typedef const char *gs_param_name;
2798# 48 "./src/gsparam.h"
2799typedef enum {
2800
2801 gs_param_type_null, gs_param_type_bool, gs_param_type_int,
2802 gs_param_type_long, gs_param_type_float,
2803
2804 gs_param_type_string, gs_param_type_name,
2805 gs_param_type_int_array, gs_param_type_float_array,
2806 gs_param_type_string_array, gs_param_type_name_array,
2807
2808 gs_param_type_dict, gs_param_type_dict_int_keys, gs_param_type_array
2809} gs_param_type;
2810# 73 "./src/gsparam.h"
2811typedef struct gs_param_int_array_s { const int *data; uint size; bool persistent; } gs_param_int_array;
2812typedef struct gs_param_float_array_s { const float *data; uint size; bool persistent; } gs_param_float_array;
2813typedef struct gs_param_string_array_s { const gs_param_string *data; uint size; bool persistent; } gs_param_string_array;
2814# 91 "./src/gsparam.h"
2815typedef struct gs_param_collection_s {
2816 gs_param_list *list;
2817 uint size;
2818} gs_param_collection;
2819typedef gs_param_collection gs_param_dict;
2820typedef gs_param_collection gs_param_array;
2821# 118 "./src/gsparam.h"
2822extern const byte gs_param_type_sizes[];
2823extern const byte gs_param_type_base_sizes[];
2824# 134 "./src/gsparam.h"
2825typedef union gs_param_value_s {
2826 bool b; int i; long l; float f; gs_param_string s; gs_param_string n; gs_param_int_array ia; gs_param_float_array fa; gs_param_string_array sa; gs_param_string_array na; gs_param_collection d;
2827} gs_param_value;
2828
2829
2830
2831
2832
2833typedef struct gs_param_typed_value_s {
2834 gs_param_value value;
2835 gs_param_type type;
2836} gs_param_typed_value;
2837
2838
2839
2840
2841
2842
2843gs_ptr_type_t gs_param_typed_value_enum_ptrs(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2844void gs_param_typed_value_reloc_ptrs(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2845
2846
2847
2848
2849
2850
2851typedef enum {
2852
2853
2854
2855 gs_param_collection_dict_any = 0,
2856
2857
2858
2859
2860
2861 gs_param_collection_dict_int_keys = 1,
2862
2863
2864
2865
2866 gs_param_collection_array = 2
2867
2868} gs_param_collection_type_t;
2869# 193 "./src/gsparam.h"
2870typedef union gs_param_enumerator_s {
2871 int intval;
2872 long longval;
2873 void *pvoid;
2874 char *pchar;
2875} gs_param_enumerator_t;
2876typedef gs_param_string gs_param_key_t;
2877# 254 "./src/gsparam.h"
2878typedef struct gs_param_list_procs_s {
2879# 266 "./src/gsparam.h"
2880 int (*xmit_typed)(gs_param_list *, gs_param_name, gs_param_typed_value *);
2881# 276 "./src/gsparam.h"
2882 int (*begin_xmit_collection)(gs_param_list *, gs_param_name, gs_param_dict *, gs_param_collection_type_t);
2883# 294 "./src/gsparam.h"
2884 int (*end_xmit_collection)(gs_param_list *, gs_param_name, gs_param_dict *);
2885# 310 "./src/gsparam.h"
2886 int (*next_key)(gs_param_list *, gs_param_enumerator_t *, gs_param_key_t *);
2887# 324 "./src/gsparam.h"
2888 int (*request)(gs_param_list *, gs_param_name);
2889# 339 "./src/gsparam.h"
2890 int (*requested)(const gs_param_list *, gs_param_name);
2891# 348 "./src/gsparam.h"
2892 int (*get_policy)(gs_param_list *, gs_param_name);
2893# 360 "./src/gsparam.h"
2894 int (*signal_error)(gs_param_list *, gs_param_name, int);
2895# 373 "./src/gsparam.h"
2896 int (*commit)(gs_param_list *);
2897
2898
2899
2900} gs_param_list_procs;
2901
2902
2903int param_read_requested_typed(gs_param_list *, gs_param_name,
2904 gs_param_typed_value *);
2905
2906
2907
2908
2909
2910
2911int param_read_null(gs_param_list *, gs_param_name);
2912int param_write_null(gs_param_list *, gs_param_name);
2913int param_read_bool(gs_param_list *, gs_param_name, bool *);
2914int param_write_bool(gs_param_list *, gs_param_name, const bool *);
2915int param_read_int(gs_param_list *, gs_param_name, int *);
2916int param_write_int(gs_param_list *, gs_param_name, const int *);
2917int param_read_long(gs_param_list *, gs_param_name, long *);
2918int param_write_long(gs_param_list *, gs_param_name, const long *);
2919int param_read_float(gs_param_list *, gs_param_name, float *);
2920int param_write_float(gs_param_list *, gs_param_name, const float *);
2921int param_read_string(gs_param_list *, gs_param_name, gs_param_string *);
2922int param_write_string(gs_param_list *, gs_param_name,
2923 const gs_param_string *);
2924int param_read_name(gs_param_list *, gs_param_name, gs_param_string *);
2925int param_write_name(gs_param_list *, gs_param_name,
2926 const gs_param_string *);
2927int param_read_int_array(gs_param_list *, gs_param_name,
2928 gs_param_int_array *);
2929int param_write_int_array(gs_param_list *, gs_param_name,
2930 const gs_param_int_array *);
2931int param_write_int_values(gs_param_list *, gs_param_name,
2932 const int *, uint, bool);
2933int param_read_float_array(gs_param_list *, gs_param_name,
2934 gs_param_float_array *);
2935int param_write_float_array(gs_param_list *, gs_param_name,
2936 const gs_param_float_array *);
2937int param_write_float_values(gs_param_list *, gs_param_name,
2938 const float *, uint, bool);
2939int param_read_string_array(gs_param_list *, gs_param_name,
2940 gs_param_string_array *);
2941int param_write_string_array(gs_param_list *, gs_param_name,
2942 const gs_param_string_array *);
2943int param_read_name_array(gs_param_list *, gs_param_name,
2944 gs_param_string_array *);
2945int param_write_name_array(gs_param_list *, gs_param_name,
2946 const gs_param_string_array *);
2947# 437 "./src/gsparam.h"
2948struct gs_param_list_s {
2949 const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
2950};
2951
2952
2953
2954
2955void gs_param_list_set_persist_keys(gs_param_list *, bool);
2956
2957
2958void param_init_enumerator(gs_param_enumerator_t * penum);
2959
2960
2961
2962
2963
2964
2965typedef struct gs_param_item_s {
2966 const char *key;
2967 byte type;
2968 short offset;
2969} gs_param_item_t;
2970
2971
2972
2973
2974
2975
2976int gs_param_read_items(gs_param_list * plist, void *obj,
2977 const gs_param_item_t * items);
2978int gs_param_write_items(gs_param_list * plist, const void *obj,
2979 const void *default_obj,
2980 const gs_param_item_t * items);
2981
2982
2983void gs_param_list_init(gs_param_list *, const gs_param_list_procs *,
2984 gs_memory_t *);
2985
2986
2987
2988
2989
2990
2991int param_coerce_typed(gs_param_typed_value * pvalue,
2992 gs_param_type req_type, gs_memory_t * mem);
2993
2994
2995
2996
2997
2998
2999
3000int gs_param_request_default(gs_param_list *, gs_param_name);
3001int gs_param_requested_default(const gs_param_list *, gs_param_name);
3002# 518 "./src/gsparam.h"
3003typedef struct gs_c_param_s gs_c_param;
3004typedef struct gs_c_param_list_s {
3005 const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
3006 gs_c_param *head;
3007 gs_param_list *target;
3008 uint count;
3009 bool any_requested;
3010 gs_param_collection_type_t coll_type;
3011} gs_c_param_list;
3012# 538 "./src/gsparam.h"
3013void gs_c_param_list_set_target(gs_c_param_list *, gs_param_list *);
3014
3015
3016
3017
3018
3019gs_c_param_list *gs_c_param_list_alloc(gs_memory_t *, client_name_t);
3020void gs_c_param_list_write(gs_c_param_list *, gs_memory_t *);
3021void gs_c_param_list_write_more(gs_c_param_list *);
3022void gs_c_param_list_read(gs_c_param_list *);
3023void gs_c_param_list_release(gs_c_param_list *);
3024# 21 "./src/gdevpdfx.h" 2
3025# 1 "./src/gsuid.h" 1
3026# 24 "./src/gsuid.h"
3027typedef struct gs_uid_s gs_uid;
3028
3029struct gs_uid_s {
3030
3031
3032 long id;
3033 long *xvalues;
3034};
3035# 60 "./src/gsuid.h"
3036bool uid_equal(const gs_uid *, const gs_uid *);
3037
3038
3039int uid_copy(gs_uid *puid, gs_memory_t *mem, client_name_t cname);
3040# 22 "./src/gdevpdfx.h" 2
3041# 1 "./src/gxdevice.h" 1
3042# 21 "./src/gxdevice.h"
3043# 1 "./src/gxdevcli.h" 1
3044# 21 "./src/gxdevcli.h"
3045# 1 "./src/stdint_.h" 1
3046# 41 "./src/stdint_.h"
3047# 1 "/usr/include/stdint.h" 1 3 4
3048# 28 "/usr/include/stdint.h" 3 4
3049# 1 "/usr/include/bits/wordsize.h" 1 3 4
3050# 29 "/usr/include/stdint.h" 2 3 4
3051# 49 "/usr/include/stdint.h" 3 4
3052typedef unsigned char uint8_t;
3053typedef unsigned short int uint16_t;
3054
3055typedef unsigned int uint32_t;
3056
3057
3058
3059
3060
3061__extension__
3062typedef unsigned long long int uint64_t;
3063
3064
3065
3066
3067
3068
3069typedef signed char int_least8_t;
3070typedef short int int_least16_t;
3071typedef int int_least32_t;
3072
3073
3074
3075__extension__
3076typedef long long int int_least64_t;
3077
3078
3079
3080typedef unsigned char uint_least8_t;
3081typedef unsigned short int uint_least16_t;
3082typedef unsigned int uint_least32_t;
3083
3084
3085
3086__extension__
3087typedef unsigned long long int uint_least64_t;
3088
3089
3090
3091
3092
3093
3094typedef signed char int_fast8_t;
3095
3096
3097
3098
3099
3100typedef int int_fast16_t;
3101typedef int int_fast32_t;
3102__extension__
3103typedef long long int int_fast64_t;
3104
3105
3106
3107typedef unsigned char uint_fast8_t;
3108
3109
3110
3111
3112
3113typedef unsigned int uint_fast16_t;
3114typedef unsigned int uint_fast32_t;
3115__extension__
3116typedef unsigned long long int uint_fast64_t;
3117# 126 "/usr/include/stdint.h" 3 4
3118typedef int intptr_t;
3119
3120
3121typedef unsigned int uintptr_t;
3122# 138 "/usr/include/stdint.h" 3 4
3123__extension__
3124typedef long long int intmax_t;
3125__extension__
3126typedef unsigned long long int uintmax_t;
3127# 42 "./src/stdint_.h" 2
3128# 22 "./src/gxdevcli.h" 2
3129# 1 "./src/gscompt.h" 1
3130# 39 "./src/gscompt.h"
3131typedef struct gs_composite_s gs_composite_t;
3132
3133
3134
3135
3136
3137
3138gs_id gs_composite_id(const gs_composite_t * pcte);
3139# 23 "./src/gxdevcli.h" 2
3140# 1 "./src/gsdcolor.h" 1
3141# 20 "./src/gsdcolor.h"
3142# 1 "./src/gsccolor.h" 1
3143# 25 "./src/gsccolor.h"
3144typedef struct gs_pattern_instance_s gs_pattern_instance_t;
3145# 37 "./src/gsccolor.h"
3146typedef struct gs_paint_color_s {
3147 float values[(8 * 8)];
3148} gs_paint_color;
3149
3150
3151
3152
3153typedef struct gs_client_color_s gs_client_color;
3154
3155
3156struct gs_client_color_s {
3157 gs_paint_color paint;
3158 gs_pattern_instance_t *pattern;
3159};
3160
3161extern const gs_memory_struct_type_t st_client_color;
3162# 21 "./src/gsdcolor.h" 2
3163# 1 "./src/gxarith.h" 1
3164# 25 "./src/gxarith.h"
3165int imod(int m, int n);
3166
3167
3168int igcd(int x, int y);
3169
3170
3171
3172
3173
3174int idivmod(int a, int b, int m);
3175
3176
3177
3178
3179int ilog2(int n);
3180# 22 "./src/gsdcolor.h" 2
3181# 1 "./src/gxbitmap.h" 1
3182# 21 "./src/gxbitmap.h"
3183# 1 "./src/gsbitmap.h" 1
3184# 52 "./src/gsbitmap.h"
3185typedef gs_id gs_bitmap_id;
3186# 73 "./src/gsbitmap.h"
3187typedef struct gs_bitmap_s {
3188 byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3189} gs_bitmap;
3190typedef struct gs_const_bitmap_s {
3191 const byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3192} gs_const_bitmap;
3193# 94 "./src/gsbitmap.h"
3194typedef struct gs_tile_bitmap_s {
3195 byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3196} gs_tile_bitmap;
3197typedef struct gs_const_tile_bitmap_s {
3198 const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3199} gs_const_tile_bitmap;
3200# 122 "./src/gsbitmap.h"
3201typedef struct gs_depth_bitmap_s {
3202 byte * data; int raster; gs_int_point size; gs_bitmap_id id; byte pix_depth; byte num_comps;
3203} gs_depth_bitmap;
3204typedef struct gs_const_depth_bitmap_s {
3205 const byte * data; int raster; gs_int_point size; gs_bitmap_id id; byte pix_depth; byte num_comps;
3206} gs_const_depth_bitmap;
3207
3208
3209
3210
3211
3212
3213typedef struct gs_tile_depth_bitmap_s {
3214 byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; byte pix_depth; byte num_comps;
3215} gs_tile_depth_bitmap;
3216typedef struct gs_const_tile_depth_bitmap_s {
3217 const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; byte pix_depth; byte num_comps;
3218} gs_const_tile_depth_bitmap;
3219# 153 "./src/gsbitmap.h"
3220extern const gs_memory_struct_type_t st_gs_bitmap;
3221extern const gs_memory_struct_type_t st_gs_tile_bitmap;
3222extern const gs_memory_struct_type_t st_gs_depth_bitmap;
3223extern const gs_memory_struct_type_t st_gs_tile_depth_bitmap;
3224# 22 "./src/gxbitmap.h" 2
3225
3226
3227typedef gs_bitmap_id gx_bitmap_id;
3228# 74 "./src/gxbitmap.h"
3229typedef struct gx_bitmap_s {
3230 byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3231} gx_bitmap;
3232typedef struct gx_const_bitmap_s {
3233 const byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3234} gx_const_bitmap;
3235
3236
3237
3238
3239
3240
3241
3242typedef struct gx_tile_bitmap_s {
3243 byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3244} gx_tile_bitmap;
3245typedef struct gx_const_tile_bitmap_s {
3246 const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3247} gx_const_tile_bitmap;
3248# 135 "./src/gxbitmap.h"
3249typedef struct gx_strip_bitmap_s {
3250 byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; ushort rep_shift; ushort shift;
3251} gx_strip_bitmap;
3252typedef struct gx_const_strip_bitmap_s {
3253 const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; ushort rep_shift; ushort shift;
3254} gx_const_strip_bitmap;
3255
3256extern const gs_memory_struct_type_t st_gx_strip_bitmap;
3257# 23 "./src/gsdcolor.h" 2
3258# 1 "./src/gxhttile.h" 1
3259# 30 "./src/gxhttile.h"
3260typedef struct gx_ht_tile_s gx_ht_tile;
3261
3262
3263
3264struct gx_ht_tile_s {
3265 gx_strip_bitmap tiles;
3266 int level;
3267
3268
3269 uint index;
3270
3271};
3272# 24 "./src/gsdcolor.h" 2
3273# 1 "./src/gxcindex.h" 1
3274# 20 "./src/gxcindex.h"
3275# 1 "./src/gsbitops.h" 1
3276# 270 "./src/gsbitops.h"
3277void bits_fill_rectangle(byte * dest, int dest_bit, uint raster,
3278 uint pattern, int width_bits, int height);
3279void bits_fill_rectangle_masked(byte * dest, int dest_bit, uint raster,
3280 uint pattern, uint src_mask,
3281 int width_bits, int height);
3282
3283
3284void bits_replicate_horizontally(byte * data, uint width, uint height,
3285 uint raster, uint replicated_width, uint replicated_raster);
3286
3287
3288void bits_replicate_vertically(byte * data, uint height, uint raster,
3289 uint replicated_height);
3290
3291
3292void bits_bounding_box(const byte * data, uint height, uint raster,
3293 gs_int_rect * pbox);
3294
3295
3296
3297
3298void bits_compress_scaled(const byte * src, int srcx, uint width,
3299 uint height, uint sraster, byte * dest, uint draster,
3300 const gs_log2_scale_point * plog2_scale, int log2_out_bits);
3301
3302
3303typedef struct bits_plane_s {
3304 union bpd_ {
3305 byte *write;
3306 const byte *read;
3307 } data;
3308 int raster;
3309 int depth;
3310 int x;
3311} bits_plane_t;
3312int bits_extract_plane(const bits_plane_t *dest ,
3313 const bits_plane_t *source , int shift, int width, int height);
3314
3315
3316int bits_expand_plane(const bits_plane_t *dest ,
3317 const bits_plane_t *source , int shift, int width, int height);
3318
3319
3320void bytes_fill_rectangle(byte * dest, uint raster,
3321 byte value, int width_bytes, int height);
3322
3323
3324void bytes_copy_rectangle(byte * dest, uint dest_raster,
3325 const byte * src, uint src_raster, int width_bytes, int height);
3326# 21 "./src/gxcindex.h" 2
3327# 55 "./src/gxcindex.h"
3328typedef unsigned long long gx_color_index_data;
3329# 79 "./src/gxcindex.h"
3330typedef gx_color_index_data gx_color_index;
3331# 25 "./src/gsdcolor.h" 2
3332# 1 "./src/gxwts.h" 1
3333# 17 "./src/gxwts.h"
3334typedef bits16 wts_screen_sample_t;
3335
3336
3337
3338typedef struct wts_screen_s wts_screen_t;
3339
3340
3341typedef enum {
3342 WTS_SCREEN_RAT,
3343 WTS_SCREEN_J,
3344 WTS_SCREEN_H
3345} wts_screen_type;
3346
3347struct wts_screen_s {
3348 wts_screen_type type;
3349 int cell_width;
3350 int cell_height;
3351 int cell_shift;
3352 wts_screen_sample_t *samples;
3353};
3354
3355typedef struct {
3356 wts_screen_t base;
3357
3358
3359
3360
3361 int pa;
3362 int pb;
3363 int pc;
3364 int pd;
3365
3366 int XA;
3367 int YA;
3368 int XB;
3369 int YB;
3370 int XC;
3371 int YC;
3372 int XD;
3373 int YD;
3374} wts_screen_j_t;
3375
3376typedef struct {
3377 wts_screen_t base;
3378
3379
3380 double px;
3381
3382 double py;
3383
3384 int x1;
3385 int y1;
3386} wts_screen_h_t;
3387
3388int wts_get_samples(const wts_screen_t *ws, int x, int y,
3389 wts_screen_sample_t **samples, int *p_nsamples);
3390# 26 "./src/gsdcolor.h" 2
3391
3392
3393
3394typedef struct gx_device_color_s gx_device_color;
3395
3396
3397
3398
3399typedef struct gx_device_color_saved_s gx_device_color_saved;
3400
3401
3402
3403
3404typedef struct gx_device_halftone_s gx_device_halftone;
3405# 87 "./src/gsdcolor.h"
3406bool gx_device_color_equal(const gx_device_color *pdevc1,
3407 const gx_device_color *pdevc2);
3408# 157 "./src/gsdcolor.h"
3409void gx_complete_halftone(gx_device_color *pdevc, int num_comps,
3410 gx_device_halftone *pdht);
3411# 183 "./src/gsdcolor.h"
3412typedef struct gx_color_tile_s gx_color_tile;
3413# 253 "./src/gsdcolor.h"
3414typedef struct gx_device_color_type_s gx_device_color_type_t;
3415typedef const gx_device_color_type_t *gx_device_color_type;
3416
3417struct gx_device_color_s {
3418
3419
3420
3421
3422 gx_device_color_type type;
3423
3424
3425
3426
3427
3428
3429 union _c {
3430 gx_color_index pure;
3431 struct _bin {
3432 const gx_device_halftone *b_ht;
3433 gx_color_index color[2];
3434 uint b_level;
3435 int b_index;
3436 gx_ht_tile *b_tile;
3437 } binary;
3438 struct _col {
3439 gx_device_halftone *c_ht;
3440 ushort num_components;
3441 byte c_base[(8 * 8)];
3442 uint c_level[(8 * 8)];
3443 ushort alpha;
3444
3445
3446
3447
3448
3449
3450 gx_color_index plane_mask;
3451
3452
3453 } colored;
3454 struct _wts {
3455 const gx_device_halftone *w_ht;
3456 wts_screen_sample_t levels[(8 * 8)];
3457 ushort num_components;
3458
3459
3460 gx_color_index plane_vector[(8 * 8)];
3461 } wts;
3462 struct _pat {
3463 gx_color_tile *p_tile;
3464 } pattern;
3465 } colors;
3466 gs_int_point phase;
3467
3468
3469
3470
3471
3472
3473
3474 bool ccolor_valid;
3475
3476
3477
3478
3479
3480
3481 gs_client_color ccolor;
3482
3483 struct _mask {
3484 struct mp_ {
3485 short x, y;
3486 } m_phase;
3487 gx_bitmap_id id;
3488 gx_color_tile *m_tile;
3489 } mask;
3490};
3491# 374 "./src/gsdcolor.h"
3492struct gx_device_color_saved_s {
3493 gx_device_color_type type;
3494 union _svc {
3495 gx_color_index pure;
3496 struct _svbin {
3497 gx_color_index b_color[2];
3498 uint b_level;
3499 int b_index;
3500 } binary;
3501 struct _svcol {
3502 byte c_base[(8 * 8)];
3503 uint c_level[(8 * 8)];
3504 ushort alpha;
3505 } colored;
3506 struct _swts {
3507 wts_screen_sample_t levels[(8 * 8)];
3508 } wts;
3509 struct _pattern {
3510 gs_id id;
3511 gs_int_point phase;
3512 } pattern;
3513 struct _pattern2 {
3514 gs_id id;
3515 bool shfill;
3516 } pattern2;
3517 } colors;
3518 gs_int_point phase;
3519};
3520# 414 "./src/gsdcolor.h"
3521extern const gx_device_color_type_t *const gx_dc_type_none;
3522
3523
3524extern const gx_device_color_type_t *const gx_dc_type_null;
3525
3526
3527extern const gx_device_color_type_t *const gx_dc_type_pure;
3528# 430 "./src/gsdcolor.h"
3529extern const gx_device_color_type_t *const gx_dc_type_ht_binary;
3530
3531
3532extern const gx_device_color_type_t *const gx_dc_type_ht_colored;
3533
3534
3535extern const gx_device_color_type_t *const gx_dc_type_wts;
3536# 24 "./src/gxdevcli.h" 2
3537# 1 "./src/gsmatrix.h" 1
3538# 26 "./src/gsmatrix.h"
3539struct gs_matrix_s {
3540 float xx, xy, yx, yy, tx, ty;
3541};
3542
3543
3544
3545typedef struct gs_matrix_s gs_matrix;
3546# 50 "./src/gsmatrix.h"
3547void gs_make_identity(gs_matrix *);
3548int gs_make_translation(floatp, floatp, gs_matrix *),
3549 gs_make_scaling(floatp, floatp, gs_matrix *),
3550 gs_make_rotation(floatp, gs_matrix *);
3551
3552
3553int gs_matrix_multiply(const gs_matrix *, const gs_matrix *, gs_matrix *),
3554 gs_matrix_invert(const gs_matrix *, gs_matrix *),
3555 gs_matrix_translate(const gs_matrix *, floatp, floatp, gs_matrix *),
3556 gs_matrix_scale(const gs_matrix *, floatp, floatp, gs_matrix *),
3557 gs_matrix_rotate(const gs_matrix *, floatp, gs_matrix *);
3558
3559
3560int gs_point_transform(floatp, floatp, const gs_matrix *, gs_point *),
3561 gs_point_transform_inverse(floatp, floatp, const gs_matrix *, gs_point *),
3562 gs_distance_transform(floatp, floatp, const gs_matrix *, gs_point *),
3563 gs_distance_transform_inverse(floatp, floatp, const gs_matrix *, gs_point *),
3564 gs_points_bbox(const gs_point[4], gs_rect *),
3565 gs_bbox_transform_only(const gs_rect *, const gs_matrix *, gs_point[4]),
3566 gs_bbox_transform(const gs_rect *, const gs_matrix *, gs_rect *),
3567 gs_bbox_transform_inverse(const gs_rect *, const gs_matrix *, gs_rect *);
3568
3569
3570
3571
3572
3573
3574int sget_matrix(stream *, gs_matrix *);
3575int sput_matrix(stream *, const gs_matrix *);
3576# 25 "./src/gxdevcli.h" 2
3577# 1 "./src/gsiparam.h" 1
3578# 43 "./src/gsiparam.h"
3579typedef struct gx_image_type_s gx_image_type_t;
3580# 52 "./src/gsiparam.h"
3581typedef struct gs_image_common_s {
3582 const gx_image_type_t *type; gs_matrix ImageMatrix;
3583} gs_image_common_t;
3584# 120 "./src/gsiparam.h"
3585typedef struct gs_data_image_s {
3586 const gx_image_type_t *type; gs_matrix ImageMatrix; int Width; int Height; int BitsPerComponent; float Decode[((8 * 8) + 1) * 2]; bool Interpolate;
3587} gs_data_image_t;
3588# 143 "./src/gsiparam.h"
3589typedef enum {
3590
3591 gs_image_format_chunky = 0,
3592
3593 gs_image_format_component_planar = 1,
3594
3595 gs_image_format_bit_planar = 2
3596} gs_image_format_t;
3597
3598
3599
3600
3601typedef struct gs_color_space_s gs_color_space;
3602# 175 "./src/gsiparam.h"
3603typedef struct gs_pixel_image_s {
3604 const gx_image_type_t *type; gs_matrix ImageMatrix; int Width; int Height; int BitsPerComponent; float Decode[((8 * 8) + 1) * 2]; bool Interpolate; gs_image_format_t format; const gs_color_space *ColorSpace; bool CombineWithColor;
3605} gs_pixel_image_t;
3606
3607extern const gs_memory_struct_type_t st_gs_pixel_image;
3608# 189 "./src/gsiparam.h"
3609typedef enum {
3610
3611 gs_image_alpha_none = 0,
3612
3613 gs_image_alpha_first,
3614
3615 gs_image_alpha_last
3616} gs_image_alpha_t;
3617
3618typedef struct gs_image1_s {
3619 const gx_image_type_t *type; gs_matrix ImageMatrix; int Width; int Height; int BitsPerComponent; float Decode[((8 * 8) + 1) * 2]; bool Interpolate; gs_image_format_t format; const gs_color_space *ColorSpace; bool CombineWithColor;
3620
3621
3622
3623
3624 bool ImageMask;
3625
3626
3627
3628
3629 bool adjust;
3630
3631
3632
3633
3634
3635 gs_image_alpha_t Alpha;
3636} gs_image1_t;
3637
3638
3639extern const gs_memory_struct_type_t st_gs_image1;
3640
3641
3642
3643
3644
3645
3646
3647typedef gs_image1_t gs_image_t;
3648# 236 "./src/gsiparam.h"
3649void
3650
3651
3652
3653 gs_image_common_t_init(gs_image_common_t * pic),
3654
3655
3656
3657
3658
3659
3660
3661 gs_data_image_t_init(gs_data_image_t * pim, int num_components),
3662
3663
3664
3665
3666
3667
3668 gs_pixel_image_t_init(gs_pixel_image_t * pim,
3669 const gs_color_space * color_space);
3670# 270 "./src/gsiparam.h"
3671void gs_image_t_init_adjust(gs_image_t * pim, const gs_color_space * pcs,
3672 bool adjust);
3673
3674
3675void gs_image_t_init_mask_adjust(gs_image_t * pim, bool write_1s,
3676 bool adjust);
3677# 26 "./src/gxdevcli.h" 2
3678# 1 "./src/gsrefct.h" 1
3679# 34 "./src/gsrefct.h"
3680typedef struct rc_header_s rc_header;
3681struct rc_header_s {
3682 long ref_count;
3683 gs_memory_t *memory;
3684
3685
3686 void (*free)(gs_memory_t *, void *, client_name_t);
3687};
3688# 56 "./src/gsrefct.h"
3689void rc_free_struct_only(gs_memory_t *, void *, client_name_t);
3690# 27 "./src/gxdevcli.h" 2
3691# 1 "./src/gsropt.h" 1
3692# 41 "./src/gsropt.h"
3693typedef enum {
3694 rop2_0 = 0,
3695 rop2_S = 0xc,
3696
3697 rop2_D = 0xa,
3698
3699 rop2_1 = 0xf,
3700
3701
3702 rop2_default = rop2_S
3703} gs_rop2_t;
3704# 60 "./src/gsropt.h"
3705typedef enum {
3706 rop3_0 = 0,
3707 rop3_T = 0xf0,
3708
3709 rop3_S = 0xcc,
3710
3711 rop3_D = 0xaa,
3712
3713 rop3_1 = 0xff,
3714 rop3_default = rop3_T | rop3_S
3715} gs_rop3_t;
3716# 159 "./src/gsropt.h"
3717typedef uint gs_logical_operation_t;
3718# 198 "./src/gsropt.h"
3719typedef unsigned long rop_operand;
3720typedef rop_operand (*rop_proc)(rop_operand D, rop_operand S, rop_operand T);
3721
3722
3723typedef enum {
3724 rop_usage_none = 0,
3725 rop_usage_D = 1,
3726 rop_usage_S = 2,
3727 rop_usage_DS = 3,
3728 rop_usage_T = 4,
3729 rop_usage_DT = 5,
3730 rop_usage_ST = 6,
3731 rop_usage_DST = 7
3732} rop_usage_t;
3733
3734
3735extern const rop_proc rop_proc_table[256];
3736
3737
3738extern const byte rop_usage_table[256];
3739# 28 "./src/gxdevcli.h" 2
3740# 1 "./src/gsstruct.h" 1
3741# 83 "./src/gsstruct.h"
3742typedef struct obj_header_s obj_header_t;
3743
3744
3745
3746
3747
3748
3749
3750struct gs_ptr_procs_s {
3751
3752
3753
3754
3755
3756 void (*unmark)(enum_ptr_t *, gc_state_t *);
3757
3758
3759
3760
3761
3762
3763 bool (*mark)(enum_ptr_t *, gc_state_t *);
3764# 114 "./src/gsstruct.h"
3765 void *(*reloc)(const void *, gc_state_t *);
3766
3767};
3768
3769
3770
3771extern const gs_ptr_procs_t ptr_struct_procs;
3772
3773
3774
3775extern const gs_ptr_procs_t ptr_string_procs;
3776
3777extern const gs_ptr_procs_t ptr_const_string_procs;
3778
3779
3780
3781
3782
3783
3784struct gs_gc_root_s {
3785 gs_gc_root_t *next;
3786 gs_ptr_type_t ptype;
3787 void **p;
3788 bool free_on_unregister;
3789};
3790# 174 "./src/gsstruct.h"
3791typedef struct gc_procs_common_s {
3792 void *(*reloc_struct_ptr)(const void *, gc_state_t *); void (*reloc_string)(gs_string *, gc_state_t *); void (*reloc_const_string)(gs_const_string *, gc_state_t *); void (*reloc_param_string)(gs_param_string *, gc_state_t *);
3793} gc_procs_common_t;
3794
3795
3796
3797
3798
3799
3800
3801gs_ptr_type_t gs_no_struct_enum_ptrs(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3802void gs_no_struct_reloc_ptrs(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3803
3804
3805
3806
3807
3808extern const gs_memory_struct_type_t st_free;
3809
3810
3811
3812extern const gs_memory_struct_type_t st_bytes;
3813
3814
3815
3816extern const gs_memory_struct_type_t st_gc_root_t;
3817# 210 "./src/gsstruct.h"
3818extern const gs_memory_struct_type_t st_const_string_element;
3819# 231 "./src/gsstruct.h"
3820typedef enum {
3821 GC_ELT_OBJ,
3822 GC_ELT_STRING,
3823 GC_ELT_CONST_STRING
3824} gc_ptr_type_index_t;
3825
3826typedef struct gc_ptr_element_s {
3827 ushort type;
3828 ushort offset;
3829} gc_ptr_element_t;
3830# 255 "./src/gsstruct.h"
3831typedef struct gc_struct_data_s {
3832 ushort num_ptrs;
3833 ushort super_offset;
3834 const gs_memory_struct_type_t *super_type;
3835 const gc_ptr_element_t *ptrs;
3836} gc_struct_data_t;
3837# 278 "./src/gsstruct.h"
3838gs_ptr_type_t basic_enum_ptrs(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3839void basic_reloc_ptrs(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3840# 360 "./src/gsstruct.h"
3841extern gs_ptr_type_t
3842 enum_bytestring(enum_ptr_t *pep, const gs_bytestring *pbs);
3843
3844
3845extern gs_ptr_type_t
3846 enum_const_bytestring(enum_ptr_t *pep, const gs_const_bytestring *pbs);
3847# 418 "./src/gsstruct.h"
3848extern void reloc_bytestring(gs_bytestring *pbs, gc_state_t *gcst);
3849
3850
3851extern void reloc_const_bytestring(gs_const_bytestring *pbs, gc_state_t *gcst);
3852# 29 "./src/gxdevcli.h" 2
3853# 1 "./src/gstparam.h" 1
3854# 24 "./src/gstparam.h"
3855typedef enum {
3856 BLEND_MODE_Compatible,
3857 BLEND_MODE_Normal,
3858 BLEND_MODE_Multiply,
3859 BLEND_MODE_Screen,
3860 BLEND_MODE_Difference,
3861 BLEND_MODE_Darken,
3862 BLEND_MODE_Lighten,
3863 BLEND_MODE_ColorDodge,
3864 BLEND_MODE_ColorBurn,
3865 BLEND_MODE_Exclusion,
3866 BLEND_MODE_HardLight,
3867 BLEND_MODE_Overlay,
3868 BLEND_MODE_SoftLight,
3869 BLEND_MODE_Luminosity,
3870 BLEND_MODE_Hue,
3871 BLEND_MODE_Saturation,
3872 BLEND_MODE_Color
3873
3874} gs_blend_mode_t;
3875
3876
3877
3878
3879
3880
3881
3882typedef enum {
3883 TRANSPARENCY_STATE_Group = 1,
3884 TRANSPARENCY_STATE_Mask
3885} gs_transparency_state_type_t;
3886
3887
3888
3889typedef struct gs_transparency_state_s gs_transparency_state_t;
3890struct gs_transparency_state_s {
3891 gs_transparency_state_t *saved; gs_transparency_state_type_t type;
3892};
3893
3894
3895
3896
3897typedef struct gs_transparency_mask_s {
3898 rc_header rc;
3899} gs_transparency_mask_t;
3900
3901
3902
3903
3904
3905
3906
3907typedef struct gs_function_s gs_function_t;
3908
3909
3910
3911
3912typedef struct gs_transparency_group_params_s {
3913 const gs_color_space *ColorSpace;
3914 bool Isolated;
3915 bool Knockout;
3916} gs_transparency_group_params_t;
3917
3918
3919typedef enum {
3920 TRANSPARENCY_MASK_Alpha,
3921 TRANSPARENCY_MASK_Luminosity
3922} gs_transparency_mask_subtype_t;
3923
3924
3925
3926
3927
3928
3929typedef struct gs_transparency_mask_params_s {
3930 gs_transparency_mask_subtype_t subtype;
3931 int Background_components;
3932 float Background[(8 * 8)];
3933 float GrayBackground;
3934 int (*TransferFunction)(floatp in, float *out, void *proc_data);
3935 gs_function_t *TransferFunction_data;
3936} gs_transparency_mask_params_t;
3937
3938
3939
3940
3941typedef struct gx_transparency_mask_params_s {
3942 gs_transparency_mask_subtype_t subtype;
3943 int Background_components;
3944 float Background[(8 * 8)];
3945 float GrayBackground;
3946 bool function_is_identity;
3947 byte transfer_fn[256];
3948} gx_transparency_mask_params_t;
3949
3950
3951typedef enum {
3952 TRANSPARENCY_CHANNEL_Opacity = 0,
3953 TRANSPARENCY_CHANNEL_Shape = 1
3954} gs_transparency_channel_selector_t;
3955# 30 "./src/gxdevcli.h" 2
3956# 1 "./src/gsxfont.h" 1
3957# 22 "./src/gsxfont.h"
3958typedef ulong gx_xglyph;
3959
3960
3961
3962
3963struct gx_xfont_procs_s;
3964typedef struct gx_xfont_procs_s gx_xfont_procs;
3965
3966
3967struct gx_xfont_s;
3968typedef struct gx_xfont_s gx_xfont;
3969# 31 "./src/gxdevcli.h" 2
3970
3971
3972# 1 "./src/gxcvalue.h" 1
3973# 21 "./src/gxcvalue.h"
3974typedef unsigned short gx_color_value;
3975# 34 "./src/gxdevcli.h" 2
3976# 1 "./src/gxfixed.h" 1
3977# 25 "./src/gxfixed.h"
3978typedef long fixed;
3979typedef ulong ufixed;
3980# 159 "./src/gxfixed.h"
3981fixed fixed_mult_quo(fixed A, fixed B, fixed C);
3982# 263 "./src/gxfixed.h"
3983typedef struct gs_fixed_point_s {
3984 fixed x, y;
3985} gs_fixed_point;
3986
3987
3988typedef struct gs_fixed_rect_s {
3989 gs_fixed_point p, q;
3990} gs_fixed_rect;
3991# 35 "./src/gxdevcli.h" 2
3992# 1 "./src/gxtext.h" 1
3993# 20 "./src/gxtext.h"
3994# 1 "./src/gstext.h" 1
3995# 20 "./src/gstext.h"
3996# 1 "./src/gsccode.h" 1
3997# 25 "./src/gsccode.h"
3998typedef ulong gs_char;
3999# 72 "./src/gsccode.h"
4000typedef ulong gs_glyph;
4001# 90 "./src/gsccode.h"
4002typedef bool (*gs_glyph_mark_proc_t)(const gs_memory_t *mem, gs_glyph glyph, void *proc_data);
4003
4004
4005typedef enum {
4006 ENCODING_INDEX_UNKNOWN = -1,
4007
4008 ENCODING_INDEX_STANDARD = 0,
4009 ENCODING_INDEX_ISOLATIN1,
4010 ENCODING_INDEX_SYMBOL,
4011 ENCODING_INDEX_DINGBATS,
4012 ENCODING_INDEX_WINANSI,
4013 ENCODING_INDEX_MACROMAN,
4014 ENCODING_INDEX_MACEXPERT,
4015
4016
4017 ENCODING_INDEX_MACGLYPH,
4018 ENCODING_INDEX_ALOGLYPH,
4019 ENCODING_INDEX_ALXGLYPH,
4020 ENCODING_INDEX_CFFSTRINGS
4021
4022} gs_encoding_index_t;
4023# 123 "./src/gsccode.h"
4024typedef enum gs_glyph_space_s {
4025 GLYPH_SPACE_NAME,
4026 GLYPH_SPACE_INDEX,
4027 GLYPH_SPACE_NOGEN
4028} gs_glyph_space_t;
4029
4030
4031
4032
4033
4034
4035typedef int (*gs_glyph_name_proc_t)(const gs_memory_t *mem,
4036 gs_glyph glyph, gs_const_string *pstr,
4037 void *proc_data);
4038# 21 "./src/gstext.h" 2
4039# 1 "./src/gscpm.h" 1
4040# 20 "./src/gscpm.h"
4041typedef enum {
4042 cpm_show,
4043 cpm_charwidth,
4044 cpm_false_charpath,
4045 cpm_true_charpath,
4046 cpm_false_charboxpath,
4047 cpm_true_charboxpath
4048} gs_char_path_mode;
4049
4050typedef enum {
4051 CACHE_DEVICE_NONE = 0,
4052 CACHE_DEVICE_NOT_CACHING,
4053 CACHE_DEVICE_NONE_AND_CLIP,
4054 CACHE_DEVICE_CACHING
4055} gs_in_cache_device_t;
4056# 22 "./src/gstext.h" 2
4057# 95 "./src/gstext.h"
4058typedef struct gs_text_params_s {
4059
4060 uint operation;
4061 union sd_ {
4062 const byte *bytes;
4063 const gs_char *chars;
4064 const gs_glyph *glyphs;
4065 gs_char d_char;
4066 gs_glyph d_glyph;
4067 } data;
4068 uint size;
4069
4070
4071 gs_point delta_all;
4072 gs_point delta_space;
4073 union s_ {
4074 gs_char s_char;
4075 gs_glyph s_glyph;
4076 } space;
4077
4078
4079 const float *x_widths;
4080 const float *y_widths;
4081 uint widths_size;
4082} gs_text_params_t;
4083# 128 "./src/gstext.h"
4084int gs_text_replaced_width(const gs_text_params_t *text, uint index,
4085 gs_point *pwidth);
4086
4087
4088
4089
4090
4091
4092
4093typedef struct gs_text_enum_s gs_text_enum_t;
4094
4095
4096
4097
4098
4099typedef struct gx_device_s gx_device;
4100# 155 "./src/gstext.h"
4101typedef struct gs_font_s gs_font;
4102
4103
4104
4105typedef struct gx_path_s gx_path;
4106
4107
4108
4109typedef struct gx_clip_path_s gx_clip_path;
4110# 187 "./src/gstext.h"
4111int gx_device_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
4112
4113
4114
4115
4116
4117
4118int gs_text_begin(gs_state * pgs, const gs_text_params_t * text,
4119 gs_memory_t * mem, gs_text_enum_t ** ppenum);
4120
4121
4122
4123
4124
4125int gs_text_update_dev_color(gs_state * pgs, gs_text_enum_t * pte);
4126
4127
4128
4129int
4130gs_show_begin(gs_state *, const byte *, uint,
4131 gs_memory_t *, gs_text_enum_t **),
4132 gs_ashow_begin(gs_state *, floatp, floatp, const byte *, uint,
4133 gs_memory_t *, gs_text_enum_t **),
4134 gs_widthshow_begin(gs_state *, floatp, floatp, gs_char,
4135 const byte *, uint,
4136 gs_memory_t *, gs_text_enum_t **),
4137 gs_awidthshow_begin(gs_state *, floatp, floatp, gs_char,
4138 floatp, floatp, const byte *, uint,
4139 gs_memory_t *, gs_text_enum_t **),
4140 gs_kshow_begin(gs_state *, const byte *, uint,
4141 gs_memory_t *, gs_text_enum_t **),
4142 gs_xyshow_begin(gs_state *, const byte *, uint,
4143 const float *, const float *, uint,
4144 gs_memory_t *, gs_text_enum_t **),
4145 gs_glyphshow_begin(gs_state *, gs_glyph,
4146 gs_memory_t *, gs_text_enum_t **),
4147 gs_cshow_begin(gs_state *, const byte *, uint,
4148 gs_memory_t *, gs_text_enum_t **),
4149 gs_stringwidth_begin(gs_state *, const byte *, uint,
4150 gs_memory_t *, gs_text_enum_t **),
4151 gs_charpath_begin(gs_state *, const byte *, uint, bool,
4152 gs_memory_t *, gs_text_enum_t **),
4153 gs_glyphpath_begin(gs_state *, gs_glyph, bool,
4154 gs_memory_t *, gs_text_enum_t **),
4155 gs_glyphwidth_begin(gs_state *, gs_glyph,
4156 gs_memory_t *, gs_text_enum_t **),
4157 gs_charboxpath_begin(gs_state *, const byte *, uint, bool,
4158 gs_memory_t *, gs_text_enum_t **);
4159
4160
4161
4162
4163int gs_text_restart(gs_text_enum_t *pte, const gs_text_params_t *text);
4164
4165
4166
4167
4168int gs_text_resync(gs_text_enum_t *pte, const gs_text_enum_t *pfrom);
4169# 276 "./src/gstext.h"
4170int gs_text_process(gs_text_enum_t *pte);
4171
4172
4173gs_font *gs_text_current_font(const gs_text_enum_t *pte);
4174gs_char gs_text_current_char(const gs_text_enum_t *pte);
4175gs_char gs_text_next_char(const gs_text_enum_t *pte);
4176gs_glyph gs_text_current_glyph(const gs_text_enum_t *pte);
4177int gs_text_total_width(const gs_text_enum_t *pte, gs_point *pwidth);
4178
4179
4180
4181
4182
4183
4184bool gs_text_is_width_only(const gs_text_enum_t *pte);
4185
4186
4187
4188
4189int gs_text_current_width(const gs_text_enum_t *pte, gs_point *pwidth);
4190
4191
4192
4193
4194
4195typedef enum {
4196 TEXT_SET_CHAR_WIDTH,
4197 TEXT_SET_CACHE_DEVICE,
4198 TEXT_SET_CACHE_DEVICE2
4199} gs_text_cache_control_t;
4200int
4201 gs_text_set_cache(gs_text_enum_t *pte, const double *values,
4202 gs_text_cache_control_t control),
4203 gs_text_setcharwidth(gs_text_enum_t *pte, const double wxy[2]),
4204 gs_text_setcachedevice(gs_text_enum_t *pte, const double wbox[6]),
4205 gs_text_setcachedevice2(gs_text_enum_t *pte, const double wbox2[10]);
4206
4207
4208int gs_text_retry(gs_text_enum_t *pte);
4209
4210
4211void gs_text_release(gs_text_enum_t *pte, client_name_t cname);
4212# 21 "./src/gxtext.h" 2
4213
4214
4215
4216typedef struct gs_text_enum_procs_s gs_text_enum_procs_t;
4217
4218
4219
4220typedef struct cached_fm_pair_s cached_fm_pair;
4221
4222
4223
4224
4225
4226typedef struct gs_text_returned_s {
4227 gs_char current_char;
4228 gs_glyph current_glyph;
4229 gs_point total_width;
4230} gs_text_returned_t;
4231# 54 "./src/gxtext.h"
4232typedef struct gx_font_stack_item_s {
4233 gs_font *font;
4234 uint index;
4235} gx_font_stack_item_t;
4236typedef struct gx_font_stack_s {
4237 int depth;
4238 gx_font_stack_item_t items[1 + 5];
4239} gx_font_stack_t;
4240# 74 "./src/gxtext.h"
4241void rc_free_text_enum(gs_memory_t *, void *, client_name_t);
4242# 111 "./src/gxtext.h"
4243struct gs_text_enum_s {
4244 gs_text_params_t text; gx_device *dev; gx_device *imaging_dev; gs_imager_state *pis; gs_font *orig_font; gx_path *path; const gx_device_color *pdcolor; const gx_clip_path *pcpath; gs_memory_t *memory; const gs_text_enum_procs_t *procs; rc_header rc; gs_font *current_font; gs_glyph outer_CID; bool is_pure_color; gs_log2_scale_point log2_scale; cached_fm_pair *pair; uint index; uint xy_index; gx_font_stack_t fstack; int cmap_code; gs_point FontBBox_as_Metrics2; ulong text_enum_id; bool device_disabled_grid_fitting; gs_text_returned_t returned;
4245};
4246# 163 "./src/gxtext.h"
4247int gs_text_enum_init(gs_text_enum_t *pte,
4248 const gs_text_enum_procs_t *procs,
4249 gx_device *dev, gs_imager_state *pis,
4250 const gs_text_params_t *text,
4251 gs_font *font, gx_path *path,
4252 const gx_device_color *pdcolor,
4253 const gx_clip_path *pcpath,
4254 gs_memory_t *mem);
4255
4256
4257
4258
4259
4260
4261
4262void gs_text_enum_copy_dynamic(gs_text_enum_t *pto,
4263 const gs_text_enum_t *pfrom,
4264 bool for_return);
4265# 211 "./src/gxtext.h"
4266struct gs_text_enum_procs_s {
4267# 224 "./src/gxtext.h"
4268 int (*resync)(gs_text_enum_t *pte, const gs_text_enum_t *pfrom);
4269# 254 "./src/gxtext.h"
4270 int (*process)(gs_text_enum_t *pte);
4271# 265 "./src/gxtext.h"
4272 bool (*is_width_only)(const gs_text_enum_t *pte);
4273# 274 "./src/gxtext.h"
4274 int (*current_width)(const gs_text_enum_t *pte, gs_point *pwidth);
4275# 285 "./src/gxtext.h"
4276 int (*set_cache)(gs_text_enum_t *pte, const double *values, gs_text_cache_control_t control);
4277# 295 "./src/gxtext.h"
4278 int (*retry)(gs_text_enum_t *pte);
4279# 306 "./src/gxtext.h"
4280 void (*release)(gs_text_enum_t *pte, client_name_t cname);
4281
4282};
4283
4284
4285void gx_default_text_release(gs_text_enum_t *pte, client_name_t cname);
4286# 36 "./src/gxdevcli.h" 2
4287# 1 "./src/gxcmap.h" 1
4288# 21 "./src/gxcmap.h"
4289# 1 "./src/gscsel.h" 1
4290# 25 "./src/gscsel.h"
4291typedef enum {
4292 gs_color_select_all = -1,
4293 gs_color_select_texture = 0,
4294 gs_color_select_source = 1
4295} gs_color_select_t;
4296# 22 "./src/gxcmap.h" 2
4297# 1 "./src/gxfmap.h" 1
4298# 22 "./src/gxfmap.h"
4299# 1 "./src/gxfrac.h" 1
4300# 25 "./src/gxfrac.h"
4301typedef short frac;
4302typedef short signed_frac;
4303# 23 "./src/gxfmap.h" 2
4304# 1 "./src/gxtmap.h" 1
4305# 27 "./src/gxtmap.h"
4306typedef struct gx_transfer_map_s gx_transfer_map;
4307
4308
4309
4310
4311
4312typedef float (*gs_mapping_proc) (floatp, const gx_transfer_map *);
4313
4314
4315
4316
4317
4318typedef float (*gs_mapping_closure_proc_t) (floatp value,
4319 const gx_transfer_map * pmap,
4320 const void *proc_data);
4321typedef struct gs_mapping_closure_s {
4322 gs_mapping_closure_proc_t proc;
4323 const void *data;
4324} gs_mapping_closure_t;
4325# 24 "./src/gxfmap.h" 2
4326# 39 "./src/gxfmap.h"
4327struct gx_transfer_map_s {
4328 rc_header rc;
4329 gs_mapping_proc proc;
4330 gs_mapping_closure_t closure;
4331
4332 gs_id id;
4333 frac values[(1 << 8)];
4334};
4335
4336extern const gs_memory_struct_type_t st_transfer_map;
4337
4338
4339
4340
4341
4342void gx_set_identity_transfer(gx_transfer_map *);
4343# 63 "./src/gxfmap.h"
4344frac gx_color_frac_map(frac, const frac *);
4345# 97 "./src/gxfmap.h"
4346float gs_mapped_transfer(floatp, const gx_transfer_map *);
4347
4348
4349
4350
4351float gs_identity_transfer(floatp, const gx_transfer_map *);
4352# 23 "./src/gxcmap.h" 2
4353# 85 "./src/gxcmap.h"
4354struct gx_cm_color_map_procs_s {
4355 void (*map_gray) (gx_device * dev, frac gray, frac * out);
4356 void (*map_rgb) (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4357 void (*map_cmyk) (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4358};
4359
4360typedef struct gx_cm_color_map_procs_s gx_cm_color_map_procs;
4361
4362
4363
4364
4365void gray_cs_to_gray_cm (gx_device * dev, frac gray, frac * out);
4366void rgb_cs_to_rgb_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4367void cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4368# 112 "./src/gxcmap.h"
4369struct gx_color_map_procs_s {
4370 void (*map_gray)(frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4371 void (*map_rgb)(frac, frac, frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4372 void (*map_cmyk)(frac, frac, frac, frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4373 void (*map_rgb_alpha)(frac, frac, frac, frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4374 void (*map_separation)(frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4375 void (*map_devicen)(const frac *, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4376 bool (*is_halftoned)(const gs_imager_state *, gx_device *);
4377};
4378typedef struct gx_color_map_procs_s gx_color_map_procs;
4379
4380
4381
4382
4383
4384
4385const gx_color_map_procs *
4386 gx_get_cmap_procs(const gs_imager_state *, const gx_device *);
4387const gx_color_map_procs *
4388 gx_default_get_cmap_procs(const gs_imager_state *, const gx_device *);
4389
4390
4391
4392
4393
4394
4395void gx_set_cmap_procs(gs_imager_state *, const gx_device *);
4396# 163 "./src/gxcmap.h"
4397extern void gx_default_gray_cs_to_gray_cm (gx_device * dev, frac gray, frac * out);
4398extern void gx_default_rgb_cs_to_gray_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4399extern void gx_default_cmyk_cs_to_gray_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4400
4401extern void gx_default_gray_cs_to_rgb_cm (gx_device * dev, frac gray, frac * out);
4402extern void gx_default_rgb_cs_to_rgb_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4403extern void gx_default_cmyk_cs_to_rgb_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4404
4405extern void gx_default_gray_cs_to_cmyk_cm (gx_device * dev, frac gray, frac * out);
4406extern void gx_default_rgb_cs_to_cmyk_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4407extern void gx_default_cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4408
4409extern void gx_default_gray_cs_to_cmyk_cm (gx_device * dev, frac gray, frac * out);
4410extern void gx_default_rgb_cs_to_cmyk_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4411extern void gx_default_cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4412
4413extern void gx_error_gray_cs_to_cmyk_cm (gx_device * dev, frac gray, frac * out);
4414extern void gx_error_rgb_cs_to_cmyk_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4415extern void gx_error_cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4416# 238 "./src/gxcmap.h"
4417int (gx_error_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4418int (gx_default_DevGray_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4419int (gx_default_DevRGB_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4420int (gx_default_DevCMYK_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4421int (gx_default_DevRGBK_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4422
4423
4424
4425
4426
4427const gx_cm_color_map_procs * (gx_error_get_color_mapping_procs)(const gx_device * dev);
4428const gx_cm_color_map_procs * (gx_default_DevGray_get_color_mapping_procs)(const gx_device * dev);
4429const gx_cm_color_map_procs * (gx_default_DevRGB_get_color_mapping_procs)(const gx_device * dev);
4430const gx_cm_color_map_procs * (gx_default_DevCMYK_get_color_mapping_procs)(const gx_device * dev);
4431const gx_cm_color_map_procs * (gx_default_DevRGBK_get_color_mapping_procs)(const gx_device * dev);
4432
4433
4434
4435
4436
4437gx_color_index (gx_error_encode_color)(gx_device * dev, const gx_color_value colors[]);
4438gx_color_index (gx_default_encode_color)(gx_device * dev, const gx_color_value colors[]);
4439
4440
4441
4442
4443
4444gx_color_index (gx_default_gray_fast_encode)(gx_device * dev, const gx_color_value colors[]);
4445gx_color_index (gx_default_gray_encode)(gx_device * dev, const gx_color_value colors[]);
4446
4447
4448
4449
4450
4451
4452gx_color_index (gx_backwards_compatible_gray_encode)(gx_device * dev, const gx_color_value colors[]);
4453
4454
4455
4456
4457
4458int (gx_error_decode_color)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
4459int (gx_default_decode_color)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
4460# 37 "./src/gxdevcli.h" 2
4461# 1 "./src/gsnamecl.h" 1
4462# 38 "./src/gsnamecl.h"
4463typedef struct named_color_params_s {
4464
4465
4466
4467
4468 bool use_named_color_callback;
4469# 52 "./src/gsnamecl.h"
4470 int color_index[(8 * 8)];
4471} named_color_params_t;
4472# 93 "./src/gsnamecl.h"
4473int named_color_put_params(gx_device * dev, gs_param_list * plist);
4474# 102 "./src/gsnamecl.h"
4475int named_color_get_params(gx_device * dev, gs_param_list * plist);
4476
4477
4478
4479
4480
4481bool named_color_install_Separation(gs_color_space * pcs, gs_state * pgs);
4482
4483
4484
4485
4486
4487bool named_color_install_DeviceN(gs_color_space * pcs, gs_state * pgs);
4488
4489
4490
4491
4492
4493int gx_remap_concrete_named_color_Separation(const frac * pconc,
4494 const gs_color_space * pcs, gx_device_color * pdc,
4495 const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
4496
4497
4498
4499
4500
4501int gx_remap_concrete_named_color_DeviceN(const frac * pconc,
4502 const gs_color_space * pcs, gx_device_color * pdc,
4503 const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
4504# 143 "./src/gsnamecl.h"
4505typedef struct client_named_color_params_s {
4506 struct client_named_color_procs_s * client_procs;
4507 void * data;
4508} client_named_color_params_t;
4509
4510
4511
4512
4513typedef struct client_named_color_procs_s {
4514
4515
4516
4517
4518 bool (* install_Separation)(client_named_color_params_t * pparams,
4519 gs_color_space * pcs, gs_state * pgs);
4520
4521
4522
4523 int (* remap_Separation)(client_named_color_params_t * pparams,
4524 const frac * pconc, const gs_color_space * pcs,
4525 gx_device_color * pdc, const gs_imager_state * pis,
4526 gx_device * dev, gs_color_select_t select);
4527
4528
4529
4530
4531 bool (* install_DeviceN)(client_named_color_params_t * pparams,
4532 gs_color_space * pcs, gs_state * pgs);
4533
4534
4535
4536 int (* remap_DeviceN)(client_named_color_params_t * pparams, const frac * pconc,
4537 const gs_color_space * pcs, gx_device_color * pdc,
4538 const gs_imager_state * pis, gx_device * dev,
4539 gs_color_select_t select);
4540
4541} client_named_color_procs_t;
4542# 38 "./src/gxdevcli.h" 2
4543# 134 "./src/gxdevcli.h"
4544typedef struct gx_fill_params_s gx_fill_params;
4545
4546
4547
4548typedef struct gx_stroke_params_s gx_stroke_params;
4549# 149 "./src/gxdevcli.h"
4550typedef struct gx_image_enum_common_s gx_image_enum_common_t;
4551
4552
4553
4554
4555
4556
4557typedef struct gs_pattern1_instance_s gs_pattern1_instance_t;
4558
4559
4560
4561
4562typedef gx_device_color gx_drawing_color;
4563
4564
4565
4566typedef enum {
4567 go_text,
4568 go_graphics
4569} graphics_object_type;
4570
4571
4572typedef struct gs_fixed_edge_s {
4573 gs_fixed_point start;
4574 gs_fixed_point end;
4575} gs_fixed_edge;
4576
4577
4578
4579
4580typedef struct gs_get_bits_params_s gs_get_bits_params_t;
4581
4582
4583
4584typedef struct gx_device_anti_alias_info_s {
4585 int text_bits;
4586 int graphics_bits;
4587} gx_device_anti_alias_info;
4588
4589typedef int32_t frac31;
4590
4591
4592
4593
4594typedef struct gs_linear_color_edge_s {
4595 gs_fixed_point start;
4596 gs_fixed_point end;
4597 const frac31 *c0, *c1;
4598 fixed clip_x;
4599} gs_linear_color_edge;
4600# 227 "./src/gxdevcli.h"
4601typedef enum {
4602 GX_CINFO_UNKNOWN_SEP_LIN = -1,
4603 GX_CINFO_SEP_LIN_NONE = 0,
4604 GX_CINFO_SEP_LIN
4605} gx_color_enc_sep_lin_t;
4606
4607
4608
4609
4610
4611typedef enum {
4612 GX_CINFO_POLARITY_UNKNOWN = -1,
4613 GX_CINFO_POLARITY_SUBTRACTIVE = 0,
4614 GX_CINFO_POLARITY_ADDITIVE
4615} gx_color_polarity_t;
4616# 261 "./src/gxdevcli.h"
4617typedef enum {
4618 GX_CINFO_OPMODE_UNKNOWN = -1,
4619 GX_CINFO_OPMODE_NOT = 0,
4620 GX_CINFO_OPMODE
4621} gx_cm_opmode_t;
4622# 294 "./src/gxdevcli.h"
4623typedef struct gx_device_color_info_s {
4624
4625
4626
4627
4628
4629
4630 int max_components;
4631
4632
4633
4634
4635
4636
4637
4638 int num_components;
4639
4640
4641
4642
4643
4644
4645
4646 gx_color_polarity_t polarity;
4647
4648
4649
4650
4651
4652 byte depth;
4653# 351 "./src/gxdevcli.h"
4654 byte gray_index;
4655# 373 "./src/gxdevcli.h"
4656 uint max_gray;
4657 uint max_color;
4658
4659 uint dither_grays;
4660 uint dither_colors;
4661
4662
4663
4664
4665
4666 gx_device_anti_alias_info anti_alias;
4667# 421 "./src/gxdevcli.h"
4668 gx_color_enc_sep_lin_t separable_and_linear;
4669 byte comp_shift[(8 * 8)];
4670 byte comp_bits[(8 * 8)];
4671 gx_color_index comp_mask[(8 * 8)];
4672
4673
4674
4675
4676 const char * cm_name;
4677# 443 "./src/gxdevcli.h"
4678 gx_cm_opmode_t opmode;
4679 gx_color_index process_comps;
4680} gx_device_color_info;
4681# 610 "./src/gxdevcli.h"
4682typedef struct gx_device_procs_s gx_device_procs;
4683
4684
4685
4686typedef struct gx_page_device_procs_s {
4687
4688
4689
4690 int (*install)(gx_device *dev, gs_state *pgs);
4691
4692
4693
4694 int (*begin_page)(gx_device *dev, gs_state *pgs);
4695
4696
4697
4698 int (*end_page)(gx_device *dev, int reason, gs_state *pgs);
4699
4700} gx_page_device_procs;
4701
4702
4703int gx_default_install(gx_device *dev, gs_state *pgs);
4704int gx_default_begin_page(gx_device *dev, gs_state *pgs);
4705int gx_default_end_page(gx_device *dev, int reason, gs_state *pgs);
4706# 671 "./src/gxdevcli.h"
4707typedef struct gx_device_cached_colors_s {
4708 gx_color_index black, white;
4709} gx_device_cached_colors_t;
4710# 1213 "./src/gxdevcli.h"
4711typedef enum {
4712 pattern_manage__can_accum,
4713 pattern_manage__start_accum,
4714 pattern_manage__finish_accum,
4715 pattern_manage__load,
4716 pattern_manage__shading_area
4717} pattern_manage_t;
4718# 1261 "./src/gxdevcli.h"
4719typedef struct gs_fill_attributes_s {
4720 const gs_fixed_rect *clip;
4721 bool swap_axes;
4722 const gx_device_halftone *ht;
4723 gs_logical_operation_t lop;
4724 fixed ystart, yend;
4725} gs_fill_attributes;
4726# 1407 "./src/gxdevcli.h"
4727typedef struct gx_image_plane_s {
4728 const byte *data;
4729 int data_x;
4730 uint raster;
4731} gx_image_plane_t;
4732# 1425 "./src/gxdevcli.h"
4733int gx_image_data(gx_image_enum_common_t *info, const byte **planes,
4734 int data_x, uint raster, int height);
4735
4736
4737
4738
4739int gx_image_plane_data(gx_image_enum_common_t *info,
4740 const gx_image_plane_t *planes, int height);
4741int gx_image_plane_data_rows(gx_image_enum_common_t *info,
4742 const gx_image_plane_t *planes, int height,
4743 int *rows_used);
4744int gx_image_flush(gx_image_enum_common_t *info);
4745bool gx_image_planes_wanted(const gx_image_enum_common_t *info, byte *wanted);
4746int gx_image_end(gx_image_enum_common_t *info, bool draw_last);
4747# 1455 "./src/gxdevcli.h"
4748struct gx_device_procs_s { int (*open_device)(gx_device *dev); void (*get_initial_matrix)(gx_device *dev, gs_matrix *pmat); int (*sync_output)(gx_device *dev); int (*output_page)(gx_device *dev, int num_copies, int flush); int (*close_device)(gx_device *dev); gx_color_index (*map_rgb_color)(gx_device *dev, const gx_color_value cv[]); int (*map_color_rgb)(gx_device *dev, gx_color_index color, gx_color_value rgb[3]); int (*fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color); int (*tile_rectangle)(gx_device *dev, const gx_tile_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y); int (*copy_mono)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1); int (*copy_color)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height); int (*obsolete_draw_line)(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color); int (*get_bits)(gx_device *dev, int y, byte *data, byte **actual_data); int (*get_params)(gx_device *dev, gs_param_list *plist); int (*put_params)(gx_device *dev, gs_param_list *plist); gx_color_index (*map_cmyk_color)(gx_device *dev, const gx_color_value cv[]); const gx_xfont_procs *(*get_xfont_procs)(gx_device *dev); gx_device *(*get_xfont_device)(gx_device *dev); gx_color_index (*map_rgb_alpha_color)(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue, gx_color_value alpha); gx_device *(*get_page_device)(gx_device *dev); int (*get_alpha_bits)(gx_device *dev, graphics_object_type type); int (*copy_alpha)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth); int (*get_band)(gx_device *dev, int y, int *band_start); int (*copy_rop)(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop); int (*fill_path)(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath); int (*stroke_path)(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath); int (*fill_mask)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath); int (*fill_trapezoid)(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*fill_parallelogram)(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*fill_triangle)(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*draw_thin_line)(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*begin_image)(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim, gs_image_format_t format, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo); int (*image_data)(gx_device *dev, gx_image_enum_common_t *info, const byte **planes, int data_x, uint raster, int height); int (*end_image)(gx_device *dev, gx_image_enum_common_t *info, bool draw_last); int (*strip_tile_rectangle)(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y); int (*strip_copy_rop)(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop); void (*get_clipping_box)(gx_device *dev, gs_fixed_rect *pbox); int (*begin_typed_image)(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo); int (*get_bits_rectangle)(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread); int (*map_color_rgb_alpha)(gx_device *dev, gx_color_index color, gx_color_value rgba[4]); int (*create_compositor)(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory); int (*get_hardware_params)(gx_device *dev, gs_param_list *plist); int (*text_begin)(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte); int (*finish_copydevice)(gx_device *dev, const gx_device *from_dev); int (*begin_transparency_group)(gx_device *dev, const gs_transparency_group_params_t *ptgp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem); int (*end_transparency_group)(gx_device *dev, gs_imager_state *pis, gs_transparency_state_t **ppts); int (*begin_transparency_mask)(gx_device *dev, const gx_transparency_mask_params_t *ptmp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem); int (*end_transparency_mask)(gx_device *dev, gs_transparency_mask_t **pptm); int (*discard_transparency_layer)(gx_device *dev, gs_transparency_state_t **ppts); const gx_cm_color_map_procs * ((*get_color_mapping_procs))(const gx_device * dev); int ((*get_color_comp_index))(gx_device * dev, const char * pname, int name_size, int component_type); gx_color_index ((*encode_color))(gx_device * dev, const gx_color_value colors[]); int ((*decode_color))(gx_device * dev, gx_color_index cindex, gx_color_value colors[]); int (*pattern_manage)(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function); int (*fill_rectangle_hl_color)(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath); int (*include_color_space)(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length); int (*fill_linear_color_scanline)(gx_device *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den ); int (*fill_linear_color_trapezoid)(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c3); int (*fill_linear_color_triangle)(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2); int (*update_spot_equivalent_colors)(gx_device *dev, const gs_state * pgs); };
4749# 1471 "./src/gxdevcli.h"
4750int gx_copy_mono_unaligned(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
4751int gx_copy_color_unaligned(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
4752int gx_copy_alpha_unaligned(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
4753
4754
4755struct gx_device_s {
4756 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs;
4757};
4758
4759extern const gs_memory_struct_type_t st_device;
4760void gx_device_finalize(void *ptr);
4761# 1491 "./src/gxdevcli.h"
4762gx_device *gx_device_enum_ptr(gx_device *);
4763gx_device *gx_device_reloc_ptr(gx_device *, gc_state_t *);
4764
4765
4766
4767typedef gx_color_index (*dev_proc_map_rgb_color_t)(gx_device *dev, const gx_color_value cv[]);
4768typedef int (*dev_proc_map_color_rgb_t)(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4769# 1510 "./src/gxdevcli.h"
4770typedef struct gx_device_forward_s {
4771 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target;
4772} gx_device_forward;
4773
4774extern const gs_memory_struct_type_t st_device_forward;
4775# 1524 "./src/gxdevcli.h"
4776typedef struct gx_device_null_s gx_device_null;
4777
4778struct gx_device_null_s {
4779 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target;
4780};
4781extern const gx_device_null gs_null_device;
4782
4783
4784
4785extern const gs_memory_struct_type_t st_device_null;
4786# 1547 "./src/gxdevcli.h"
4787void gx_device_init(gx_device * dev, const gx_device * proto,
4788 gs_memory_t * mem, bool internal);
4789
4790
4791
4792
4793void gs_make_null_device(gx_device_null *dev_null, gx_device *target,
4794 gs_memory_t *mem);
4795
4796bool gs_is_null_device(gx_device *dev);
4797
4798
4799void gx_device_set_target(gx_device_forward *fdev, gx_device *target);
4800
4801
4802void gx_device_retain(gx_device *dev, bool retained);
4803
4804
4805
4806uint gx_device_raster(const gx_device * dev, bool pad_to_word);
4807
4808
4809
4810
4811
4812int gx_device_adjust_resolution(gx_device * dev, int actual_width, int actual_height, int fit);
4813
4814
4815
4816void gx_device_set_margins(gx_device * dev, const float *margins ,
4817 bool move_origin);
4818
4819
4820void gx_device_set_width_height(gx_device * dev, int width, int height);
4821
4822
4823void gx_device_set_resolution(gx_device * dev, floatp x_dpi, floatp y_dpi);
4824
4825
4826void gx_device_set_media_size(gx_device * dev, floatp media_width, floatp media_height);
4827# 1596 "./src/gxdevcli.h"
4828void gx_set_device_only(gs_state *, gx_device *);
4829
4830
4831int gs_closedevice(gx_device *);
4832
4833
4834void gx_device_free_local(gx_device *);
4835
4836
4837
4838
4839
4840
4841typedef struct gx_device_type_s {
4842 gs_memory_type_ptr_t stype;
4843 int (*initialize)(gx_device *);
4844} gx_device_type;
4845# 22 "./src/gxdevice.h" 2
4846# 1 "./src/gsfname.h" 1
4847# 31 "./src/gsfname.h"
4848typedef struct gx_io_device_s gx_io_device;
4849
4850
4851typedef struct gs_parsed_file_name_s {
4852 gs_memory_t *memory;
4853 gx_io_device *iodev;
4854 const char *fname;
4855 uint len;
4856} gs_parsed_file_name_t;
4857
4858
4859int gs_parse_file_name(gs_parsed_file_name_t *, const char *, uint);
4860
4861
4862int gs_parse_real_file_name(gs_parsed_file_name_t *, const char *, uint,
4863 gs_memory_t *, client_name_t);
4864
4865
4866int gs_terminate_file_name(gs_parsed_file_name_t *, gs_memory_t *,
4867 client_name_t);
4868
4869
4870void gs_free_file_name(gs_parsed_file_name_t *, client_name_t);
4871# 23 "./src/gxdevice.h" 2
4872
4873
4874
4875
4876
4877# 1 "./src/gsmalloc.h" 1
4878# 22 "./src/gsmalloc.h"
4879typedef struct gs_malloc_block_s gs_malloc_block_t;
4880typedef struct gs_malloc_memory_s {
4881 gs_memory_t *stable_memory; gs_memory_procs_t procs; gs_lib_ctx_t *gs_lib_ctx; pl_mem_node_t *head; gs_memory_t *non_gc_memory;
4882 gs_malloc_block_t *allocated;
4883 long limit;
4884 long used;
4885 long max_used;
4886} gs_malloc_memory_t;
4887
4888
4889gs_malloc_memory_t *gs_malloc_memory_init(void);
4890
4891
4892
4893
4894
4895
4896
4897gs_memory_t * gs_malloc_init(const gs_memory_t *parent);
4898void gs_malloc_release(gs_memory_t *mem);
4899# 51 "./src/gsmalloc.h"
4900int gs_malloc_wrap(gs_memory_t **wrapped, gs_malloc_memory_t *contents);
4901
4902
4903gs_malloc_memory_t *gs_malloc_wrapped_contents(gs_memory_t *wrapped);
4904
4905
4906gs_malloc_memory_t *gs_malloc_unwrap(gs_memory_t *wrapped);
4907# 29 "./src/gxdevice.h" 2
4908
4909
4910
4911
4912# 1 "./src/gxstdio.h" 1
4913# 34 "./src/gxdevice.h" 2
4914# 213 "./src/gxdevice.h"
4915int gx_default_open_device(gx_device *dev);
4916void gx_default_get_initial_matrix(gx_device *dev, gs_matrix *pmat);
4917void gx_upright_get_initial_matrix(gx_device *dev, gs_matrix *pmat);
4918int gx_default_sync_output(gx_device *dev);
4919int gx_default_output_page(gx_device *dev, int num_copies, int flush);
4920int gx_default_close_device(gx_device *dev);
4921gx_color_index gx_default_w_b_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4922int gx_default_w_b_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4923
4924
4925int gx_default_tile_rectangle(gx_device *dev, const gx_tile_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
4926int gx_default_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
4927int gx_default_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
4928int gx_default_draw_line(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color);
4929int gx_no_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
4930int gx_default_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
4931int gx_default_get_params(gx_device *dev, gs_param_list *plist);
4932int gx_default_put_params(gx_device *dev, gs_param_list *plist);
4933gx_color_index gx_default_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
4934const gx_xfont_procs *gx_default_get_xfont_procs(gx_device *dev);
4935gx_device *gx_default_get_xfont_device(gx_device *dev);
4936gx_color_index gx_default_map_rgb_alpha_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue, gx_color_value alpha);
4937gx_device *gx_default_get_page_device(gx_device *dev);
4938gx_device *gx_page_device_get_page_device(gx_device *dev);
4939int gx_default_get_alpha_bits(gx_device *dev, graphics_object_type type);
4940int gx_no_copy_alpha(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
4941int gx_default_copy_alpha(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
4942int gx_default_get_band(gx_device *dev, int y, int *band_start);
4943int gx_no_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4944int gx_default_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4945int gx_default_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
4946int gx_default_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
4947int gx_default_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath);
4948int gx_default_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4949int gx_default_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4950int gx_default_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4951int gx_default_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4952int gx_default_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim, gs_image_format_t format, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
4953int gx_default_image_data(gx_device *dev, gx_image_enum_common_t *info, const byte **planes, int data_x, uint raster, int height);
4954int gx_default_end_image(gx_device *dev, gx_image_enum_common_t *info, bool draw_last);
4955int gx_default_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
4956int gx_no_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4957int gx_default_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4958void gx_default_get_clipping_box(gx_device *dev, gs_fixed_rect *pbox);
4959void gx_get_largest_clipping_box(gx_device *dev, gs_fixed_rect *pbox);
4960int gx_default_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
4961int gx_no_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
4962int gx_default_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
4963int gx_default_map_color_rgb_alpha(gx_device *dev, gx_color_index color, gx_color_value rgba[4]);
4964int gx_no_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
4965
4966
4967int gx_default_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
4968int gx_null_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
4969int gx_default_get_hardware_params(gx_device *dev, gs_param_list *plist);
4970int gx_default_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
4971int gx_default_finish_copydevice(gx_device *dev, const gx_device *from_dev);
4972int gx_default_pattern_manage(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function);
4973int gx_default_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
4974int gx_default_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length);
4975int gx_default_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den );
4976int gx_default_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c3);
4977int gx_default_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2);
4978int gx_default_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs);
4979
4980
4981
4982
4983
4984gx_color_index gx_default_b_w_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4985int gx_default_b_w_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4986gx_color_index gx_default_gray_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4987int gx_default_gray_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4988int gx_default_rgb_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4989
4990
4991
4992
4993
4994
4995gx_color_index gx_default_rgb_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4996gx_color_index cmyk_1bit_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
4997int cmyk_1bit_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4998int (cmyk_1bit_map_color_cmyk)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
4999gx_color_index cmyk_8bit_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
5000int cmyk_8bit_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
5001int (cmyk_8bit_map_color_cmyk)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5002gx_color_index (gx_default_8bit_map_gray_color)(gx_device * dev, const gx_color_value colors[]);
5003int (gx_default_8bit_map_color_gray)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5004
5005
5006int gx_forward_close_device(gx_device *dev);
5007void gx_forward_get_initial_matrix(gx_device *dev, gs_matrix *pmat);
5008int gx_forward_sync_output(gx_device *dev);
5009int gx_forward_output_page(gx_device *dev, int num_copies, int flush);
5010gx_color_index gx_forward_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
5011int gx_forward_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
5012int gx_forward_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
5013int gx_forward_tile_rectangle(gx_device *dev, const gx_tile_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
5014int gx_forward_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
5015int gx_forward_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
5016int gx_forward_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
5017int gx_forward_get_params(gx_device *dev, gs_param_list *plist);
5018int gx_forward_put_params(gx_device *dev, gs_param_list *plist);
5019gx_color_index gx_forward_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
5020const gx_xfont_procs *gx_forward_get_xfont_procs(gx_device *dev);
5021gx_device *gx_forward_get_xfont_device(gx_device *dev);
5022gx_color_index gx_forward_map_rgb_alpha_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue, gx_color_value alpha);
5023gx_device *gx_forward_get_page_device(gx_device *dev);
5024
5025int gx_forward_copy_alpha(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
5026int gx_forward_get_band(gx_device *dev, int y, int *band_start);
5027int gx_forward_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
5028int gx_forward_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
5029int gx_forward_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
5030int gx_forward_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath);
5031int gx_forward_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5032int gx_forward_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5033int gx_forward_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5034int gx_forward_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5035int gx_forward_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim, gs_image_format_t format, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5036
5037
5038int gx_forward_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
5039int gx_forward_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
5040void gx_forward_get_clipping_box(gx_device *dev, gs_fixed_rect *pbox);
5041int gx_forward_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5042int gx_forward_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
5043int gx_forward_map_color_rgb_alpha(gx_device *dev, gx_color_index color, gx_color_value rgba[4]);
5044
5045int gx_forward_get_hardware_params(gx_device *dev, gs_param_list *plist);
5046int gx_forward_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
5047const gx_cm_color_map_procs * (gx_forward_get_color_mapping_procs)(const gx_device * dev);
5048int (gx_forward_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
5049gx_color_index (gx_forward_encode_color)(gx_device * dev, const gx_color_value colors[]);
5050int (gx_forward_decode_color)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5051int gx_forward_pattern_manage(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function);
5052int gx_forward_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
5053int gx_forward_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length);
5054int gx_forward_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den );
5055int gx_forward_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c3);
5056int gx_forward_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2);
5057int gx_forward_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs);
5058
5059
5060
5061
5062void gx_device_set_procs(gx_device *);
5063
5064
5065void gx_device_fill_in_procs(gx_device *);
5066void gx_device_forward_fill_in_procs(gx_device_forward *);
5067
5068
5069void gx_device_forward_color_procs(gx_device_forward *);
5070
5071
5072
5073
5074
5075void check_device_separable(gx_device * dev);
5076
5077
5078
5079
5080void set_linear_color_bits_mask_shift(gx_device * dev);
5081
5082
5083
5084
5085void gx_device_copy_color_procs(gx_device *dev, const gx_device *target);
5086
5087
5088gx_color_index gx_device_black(gx_device *dev);
5089
5090
5091
5092gx_color_index gx_device_white(gx_device *dev);
5093
5094
5095
5096
5097
5098void gx_device_decache_colors(gx_device *dev);
5099
5100
5101
5102
5103
5104void gx_device_copy_color_params(gx_device *dev, const gx_device *target);
5105
5106
5107
5108
5109
5110
5111void gx_device_copy_params(gx_device *dev, const gx_device *target);
5112# 418 "./src/gxdevice.h"
5113int gx_parse_output_file_name(gs_parsed_file_name_t *pfn,
5114 const char **pfmt, const char *fname,
5115 uint len);
5116
5117
5118
5119
5120
5121int gx_device_open_output_file(const gx_device * dev, char *fname,
5122 bool binary, bool positionable,
5123 FILE ** pfile);
5124
5125
5126int gx_device_close_output_file(const gx_device * dev, const char *fname,
5127 FILE *file);
5128# 451 "./src/gxdevice.h"
5129int gx_finish_output_page(gx_device *dev, int num_copies, int flush);
5130# 542 "./src/gxdevice.h"
5131typedef struct gdev_input_media_s {
5132 float PageSize[4];
5133 const char *MediaColor;
5134 float MediaWeight;
5135 const char *MediaType;
5136} gdev_input_media_t;
5137
5138
5139extern const gdev_input_media_t gdev_input_media_default;
5140
5141void gdev_input_media_init(gdev_input_media_t * pim);
5142
5143int gdev_begin_input_media(gs_param_list * mlist, gs_param_dict * pdict,
5144 int count);
5145
5146int gdev_write_input_page_size(int index, gs_param_dict * pdict,
5147 floatp width_points, floatp height_points);
5148
5149int gdev_write_input_media(int index, gs_param_dict * pdict,
5150 const gdev_input_media_t * pim);
5151
5152int gdev_end_input_media(gs_param_list * mlist, gs_param_dict * pdict);
5153
5154typedef struct gdev_output_media_s {
5155 const char *OutputType;
5156} gdev_output_media_t;
5157
5158
5159extern const gdev_output_media_t gdev_output_media_default;
5160
5161int gdev_begin_output_media(gs_param_list * mlist, gs_param_dict * pdict,
5162 int count);
5163
5164int gdev_write_output_media(int index, gs_param_dict * pdict,
5165 const gdev_output_media_t * pom);
5166
5167int gdev_end_output_media(gs_param_list * mlist, gs_param_dict * pdict);
5168# 23 "./src/gdevpdfx.h" 2
5169# 1 "./src/gxfont.h" 1
5170# 22 "./src/gxfont.h"
5171# 1 "./src/gsfont.h" 1
5172# 31 "./src/gsfont.h"
5173typedef struct gs_font_dir_s gs_font_dir;
5174# 42 "./src/gsfont.h"
5175gs_font_dir *gs_font_dir_alloc2(gs_memory_t * struct_mem,
5176 gs_memory_t * bits_mem);
5177gs_font_dir *gs_font_dir_alloc2_limits(gs_memory_t * struct_mem,
5178 gs_memory_t * bits_mem,
5179 uint smax, uint bmax, uint mmax,
5180 uint cmax, uint upper);
5181# 56 "./src/gsfont.h"
5182int gs_definefont(gs_font_dir *, gs_font *);
5183
5184
5185int gs_font_find_similar(const gs_font_dir * pdir, const gs_font **ppfont,
5186 int (*similar)(const gs_font *, const gs_font *));
5187
5188
5189
5190int gs_scalefont(gs_font_dir *, const gs_font *, floatp, gs_font **);
5191int gs_makefont(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5192int gs_setfont(gs_state *, gs_font *);
5193gs_font *gs_currentfont(const gs_state *);
5194gs_font *gs_rootfont(const gs_state *);
5195void gs_set_currentfont(gs_state *, gs_font *);
5196int gs_purge_font(gs_font *);
5197
5198gs_font *gs_find_font_by_id(gs_font_dir *pdir, gs_id id, gs_matrix *FontMatrix);
5199
5200
5201void gs_cachestatus(const gs_font_dir *, uint[7]);
5202
5203
5204uint gs_currentcachesize(const gs_font_dir *);
5205int gs_setcachesize(gs_font_dir *, uint);
5206uint gs_currentcachelower(const gs_font_dir *);
5207int gs_setcachelower(gs_font_dir *, uint);
5208uint gs_currentcacheupper(const gs_font_dir *);
5209int gs_setcacheupper(gs_font_dir *, uint);
5210uint gs_currentaligntopixels(const gs_font_dir *);
5211int gs_setaligntopixels(gs_font_dir *, uint);
5212uint gs_currentgridfittt(const gs_font_dir *);
5213int gs_setgridfittt(gs_font_dir *, uint);
5214# 23 "./src/gxfont.h" 2
5215# 1 "./src/gsgdata.h" 1
5216# 53 "./src/gsgdata.h"
5217typedef struct gs_glyph_data_procs_s gs_glyph_data_procs_t;
5218
5219
5220typedef struct gs_glyph_data_s gs_glyph_data_t;
5221
5222struct gs_glyph_data_s {
5223 gs_const_bytestring bits;
5224 const gs_glyph_data_procs_t *procs;
5225 void *proc_data;
5226 gs_memory_t *memory;
5227};
5228extern const gs_memory_struct_type_t st_glyph_data;
5229
5230
5231
5232
5233
5234
5235struct gs_glyph_data_procs_s {
5236
5237
5238 void (*free)(gs_glyph_data_t *pgd, client_name_t cname);
5239
5240
5241 int (*substring)(gs_glyph_data_t *pgd, uint offset, uint size);
5242};
5243
5244
5245
5246
5247
5248int gs_glyph_data_substring(gs_glyph_data_t *pgd, uint offset, uint size);
5249
5250
5251
5252
5253
5254
5255void gs_glyph_data_free(gs_glyph_data_t *pgd, client_name_t cname);
5256# 123 "./src/gsgdata.h"
5257void gs_glyph_data_from_string(gs_glyph_data_t *pgd, const byte *data,
5258 uint size, gs_font *font);
5259void gs_glyph_data_from_bytes(gs_glyph_data_t *pgd, const byte *bytes,
5260 uint offset, uint size, gs_font *font);
5261
5262void gs_glyph_data_from_null(gs_glyph_data_t *pgd);
5263# 24 "./src/gxfont.h" 2
5264
5265# 1 "./src/gsnotify.h" 1
5266# 34 "./src/gsnotify.h"
5267typedef int (*gs_notify_proc_t)(void *proc_data, void *event_data);
5268typedef struct gs_notify_registration_s gs_notify_registration_t;
5269struct gs_notify_registration_s {
5270 gs_notify_proc_t proc;
5271 void *proc_data;
5272 gs_notify_registration_t *next;
5273};
5274
5275
5276
5277
5278
5279
5280typedef struct gs_notify_list_s {
5281 gs_memory_t *memory;
5282 gs_notify_registration_t *first;
5283} gs_notify_list_t;
5284
5285extern const gs_memory_struct_type_t st_gs_notify_list;
5286
5287
5288
5289
5290
5291
5292
5293void gs_notify_init(gs_notify_list_t *nlist, gs_memory_t *mem);
5294
5295
5296int gs_notify_register(gs_notify_list_t *nlist, gs_notify_proc_t proc,
5297 void *proc_data);
5298
5299
5300
5301
5302
5303
5304int gs_notify_unregister(gs_notify_list_t *nlist, gs_notify_proc_t proc,
5305 void *proc_data);
5306
5307
5308int gs_notify_unregister_calling(gs_notify_list_t *nlist,
5309 gs_notify_proc_t proc, void *proc_data,
5310 void (*unreg_proc)(void *pdata));
5311
5312
5313
5314
5315
5316int gs_notify_all(gs_notify_list_t *nlist, void *event_data);
5317
5318
5319void gs_notify_release(gs_notify_list_t *nlist);
5320# 26 "./src/gxfont.h" 2
5321
5322
5323# 1 "./src/gxftype.h" 1
5324# 23 "./src/gxftype.h"
5325typedef enum {
5326 ft_composite = 0,
5327 ft_encrypted = 1,
5328 ft_encrypted2 = 2,
5329 ft_user_defined = 3,
5330 ft_disk_based = 4,
5331 ft_CID_encrypted = 9,
5332 ft_CID_user_defined = 10,
5333 ft_CID_TrueType = 11,
5334 ft_Chameleon = 14,
5335 ft_CID_bitmap = 32,
5336 ft_TrueType = 42
5337} font_type;
5338
5339
5340
5341
5342typedef enum {
5343 fbit_use_outlines = 0,
5344 fbit_use_bitmaps = 1,
5345 fbit_transform_bitmaps = 2
5346} fbit_type;
5347# 29 "./src/gxfont.h" 2
5348# 58 "./src/gxfont.h"
5349typedef struct gs_font_info_s {
5350 int members;
5351
5352
5353
5354
5355 int Ascent;
5356
5357 int AvgWidth;
5358
5359 gs_int_rect BBox;
5360
5361 int CapHeight;
5362
5363 int Descent;
5364
5365 uint Flags;
5366 uint Flags_requested;
5367 uint Flags_returned;
5368
5369 float ItalicAngle;
5370
5371 int Leading;
5372
5373 int MaxWidth;
5374
5375 int MissingWidth;
5376
5377 int StemH;
5378
5379 int StemV;
5380
5381 int UnderlinePosition;
5382
5383 int UnderlineThickness;
5384
5385 int XHeight;
5386
5387
5388
5389
5390 gs_const_string Copyright;
5391
5392 gs_const_string Notice;
5393
5394 gs_const_string FamilyName;
5395
5396 gs_const_string FullName;
5397
5398} gs_font_info_t;
5399# 134 "./src/gxfont.h"
5400typedef struct gs_glyph_info_s {
5401 int members;
5402
5403
5404
5405
5406 gs_point width[2];
5407 gs_point v;
5408
5409 gs_rect bbox;
5410
5411 int num_pieces;
5412
5413 gs_glyph *pieces;
5414
5415
5416
5417
5418
5419} gs_glyph_info_t;
5420
5421
5422
5423typedef struct gs_font_procs_s {
5424# 168 "./src/gxfont.h"
5425 int (*define_font)(gs_font_dir *, gs_font *);
5426# 177 "./src/gxfont.h"
5427 int (*make_font)(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5428# 191 "./src/gxfont.h"
5429 int (*font_info)(gs_font *font, const gs_point *pscale, int members, gs_font_info_t *info);
5430# 207 "./src/gxfont.h"
5431 int (*same_font)(const gs_font *font, const gs_font *ofont, int mask);
5432# 221 "./src/gxfont.h"
5433 gs_glyph (*encode_char)(gs_font *, gs_char, gs_glyph_space_t);
5434
5435
5436
5437
5438
5439
5440 gs_char (*decode_glyph)(gs_font *, gs_glyph);
5441# 240 "./src/gxfont.h"
5442 int (*enumerate_glyph)(gs_font *font, int *pindex, gs_glyph_space_t glyph_space, gs_glyph *pglyph);
5443# 268 "./src/gxfont.h"
5444 int (*glyph_info)(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, int members, gs_glyph_info_t *info);
5445# 284 "./src/gxfont.h"
5446 int (*glyph_outline)(gs_font *font, int WMode, gs_glyph glyph, const gs_matrix *pmat, gx_path *ppath, double sbw[4]);
5447
5448
5449
5450
5451
5452
5453
5454 int (*glyph_name)(gs_font *font, gs_glyph glyph, gs_const_string *pstr);
5455# 304 "./src/gxfont.h"
5456 int (*init_fstack)(gs_text_enum_t *, gs_font *);
5457# 318 "./src/gxfont.h"
5458 int (*next_char_glyph)(gs_text_enum_t *pte, gs_char *pchar, gs_glyph *pglyph);
5459# 330 "./src/gxfont.h"
5460 int (*build_char)(gs_text_enum_t *, gs_state *, gs_font *, gs_char, gs_glyph);
5461
5462} gs_font_procs;
5463
5464
5465int gs_no_define_font(gs_font_dir *, gs_font *);
5466int gs_no_make_font(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5467int gs_base_make_font(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5468int gs_default_font_info(gs_font *font, const gs_point *pscale, int members, gs_font_info_t *info);
5469int gs_default_same_font(const gs_font *font, const gs_font *ofont, int mask);
5470int gs_base_same_font(const gs_font *font, const gs_font *ofont, int mask);
5471
5472gs_glyph gs_no_encode_char(gs_font *, gs_char, gs_glyph_space_t);
5473gs_char gs_no_decode_glyph(gs_font *, gs_glyph);
5474int gs_no_enumerate_glyph(gs_font *font, int *pindex, gs_glyph_space_t glyph_space, gs_glyph *pglyph);
5475int gs_default_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, int members, gs_glyph_info_t *info);
5476int gs_no_glyph_outline(gs_font *font, int WMode, gs_glyph glyph, const gs_matrix *pmat, gx_path *ppath, double sbw[4]);
5477int gs_no_glyph_name(gs_font *font, gs_glyph glyph, gs_const_string *pstr);
5478
5479int gs_default_init_fstack(gs_text_enum_t *, gs_font *);
5480int gs_default_next_char_glyph(gs_text_enum_t *pte, gs_char *pchar, gs_glyph *pglyph);
5481int gs_no_build_char(gs_text_enum_t *, gs_state *, gs_font *, gs_char, gs_glyph);
5482
5483extern const gs_font_procs gs_font_procs_default;
5484
5485
5486typedef struct gs_font_name_s {
5487
5488
5489 byte chars[47 + 1];
5490 uint size;
5491} gs_font_name;
5492# 396 "./src/gxfont.h"
5493struct gs_font_s {
5494 gs_font *next, *prev; gs_memory_t *memory; gs_font_dir *dir; bool is_resource; gs_notify_list_t notify_list; gs_id id; gs_font *base; void *client_data; gs_matrix FontMatrix; gs_matrix orig_FontMatrix; font_type FontType; bool BitmapWidths; fbit_type ExactSize, InBetweenSize, TransformedChar; int WMode; int PaintType; float StrokeWidth; gs_font_procs procs; gs_font_name key_name, font_name;
5495};
5496
5497extern const gs_memory_struct_type_t st_gs_font;
5498void gs_font_finalize(void *ptr);
5499# 412 "./src/gxfont.h"
5500extern const gs_memory_struct_type_t st_gs_font_ptr_element;
5501
5502
5503
5504
5505
5506
5507gs_font *
5508 gs_font_alloc(gs_memory_t *mem, gs_memory_type_ptr_t pstype,
5509 const gs_font_procs *procs, gs_font_dir *dir,
5510 client_name_t cname);
5511
5512
5513void gs_font_notify_init(gs_font *font);
5514
5515
5516
5517
5518
5519
5520int gs_font_notify_register(gs_font *font, gs_notify_proc_t proc,
5521 void *proc_data);
5522int gs_font_notify_unregister(gs_font *font, gs_notify_proc_t proc,
5523 void *proc_data);
5524
5525
5526
5527typedef struct FAPI_server_s FAPI_server;
5528# 454 "./src/gxfont.h"
5529typedef struct gs_font_base_s gs_font_base;
5530
5531struct gs_font_base_s {
5532 gs_font *next, *prev; gs_memory_t *memory; gs_font_dir *dir; bool is_resource; gs_notify_list_t notify_list; gs_id id; gs_font *base; void *client_data; gs_matrix FontMatrix; gs_matrix orig_FontMatrix; font_type FontType; bool BitmapWidths; fbit_type ExactSize, InBetweenSize, TransformedChar; int WMode; int PaintType; float StrokeWidth; gs_font_procs procs; gs_font_name key_name, font_name; gs_rect FontBBox; gs_uid UID; FAPI_server *FAPI; void *FAPI_font_data; gs_encoding_index_t encoding_index; gs_encoding_index_t nearest_encoding_index;
5533};
5534
5535extern const gs_memory_struct_type_t st_gs_font_base;
5536# 469 "./src/gxfont.h"
5537gs_font_base *
5538 gs_font_base_alloc(gs_memory_t *mem, gs_memory_type_ptr_t pstype,
5539 const gs_font_procs *procs, gs_font_dir *dir,
5540 client_name_t cname);
5541
5542
5543
5544
5545
5546extern const char gx_extendeg_glyph_name_separator[];
5547
5548
5549
5550
5551
5552bool gs_font_glyph_is_notdef(gs_font_base *bfont, gs_glyph glyph);
5553
5554
5555const gs_font_base *gs_font_parent(const gs_font_base *pbfont);
5556# 24 "./src/gdevpdfx.h" 2
5557# 1 "./src/gxline.h" 1
5558# 20 "./src/gxline.h"
5559# 1 "./src/gslparam.h" 1
5560# 21 "./src/gslparam.h"
5561typedef enum {
5562 gs_cap_butt = 0,
5563 gs_cap_round = 1,
5564 gs_cap_square = 2,
5565 gs_cap_triangle = 3,
5566 gs_cap_unknown = 4
5567} gs_line_cap;
5568
5569
5570
5571
5572typedef enum {
5573 gs_join_miter = 0,
5574 gs_join_round = 1,
5575 gs_join_bevel = 2,
5576 gs_join_none = 3,
5577 gs_join_triangle = 4,
5578 gs_join_unknown = 5
5579} gs_line_join;
5580# 21 "./src/gxline.h" 2
5581
5582
5583
5584
5585typedef struct gx_dash_params_s {
5586 float *pattern;
5587 uint pattern_size;
5588 float offset;
5589 bool adapt;
5590
5591 float pattern_length;
5592 bool init_ink_on;
5593 int init_index;
5594 float init_dist_left;
5595} gx_dash_params;
5596
5597
5598
5599typedef struct gx_line_params_s {
5600 float half_width;
5601 gs_line_cap cap;
5602 gs_line_join join;
5603 int curve_join;
5604
5605 float miter_limit;
5606 float miter_check;
5607
5608 float dot_length;
5609 bool dot_length_absolute;
5610 gs_matrix dot_orientation;
5611
5612 gx_dash_params dash;
5613} gx_line_params;
5614
5615
5616
5617
5618
5619int gx_set_miter_limit(gx_line_params *, floatp);
5620
5621
5622
5623int gx_set_dash(gx_dash_params *, const float *, uint, floatp, gs_memory_t *);
5624
5625
5626int gx_set_dot_length(gx_line_params *, floatp, bool);
5627# 25 "./src/gdevpdfx.h" 2
5628
5629# 1 "./src/spprint.h" 1
5630# 30 "./src/spprint.h"
5631int stream_write(stream * s, const void *ptr, uint count);
5632
5633
5634int stream_puts(stream * s, const char *str);
5635# 42 "./src/spprint.h"
5636const char *pprintg1(stream * s, const char *format, floatp v);
5637const char *pprintg2(stream * s, const char *format, floatp v1, floatp v2);
5638const char *pprintg3(stream * s, const char *format,
5639 floatp v1, floatp v2, floatp v3);
5640const char *pprintg4(stream * s, const char *format,
5641 floatp v1, floatp v2, floatp v3, floatp v4);
5642const char *pprintg6(stream * s, const char *format,
5643 floatp v1, floatp v2, floatp v3, floatp v4,
5644 floatp v5, floatp v6);
5645
5646
5647
5648
5649
5650
5651
5652const char *pprintd1(stream * s, const char *format, int v);
5653const char *pprintd2(stream * s, const char *format, int v1, int v2);
5654const char *pprintd3(stream * s, const char *format,
5655 int v1, int v2, int v3);
5656const char *pprintd4(stream * s, const char *format,
5657 int v1, int v2, int v3, int v4);
5658
5659
5660const char *pprintld1(stream * s, const char *format, long v);
5661const char *pprintld2(stream * s, const char *format, long v1, long v2);
5662const char *pprintld3(stream * s, const char *format,
5663 long v1, long v2, long v3);
5664
5665
5666const char *pprints1(stream * s, const char *format, const char *str);
5667const char *pprints2(stream * s, const char *format,
5668 const char *str1, const char *str2);
5669const char *pprints3(stream * s, const char *format,
5670 const char *str1, const char *str2, const char *str3);
5671# 27 "./src/gdevpdfx.h" 2
5672# 1 "./src/gdevpsdf.h" 1
5673# 25 "./src/gdevpsdf.h"
5674# 1 "./src/gdevvec.h" 1
5675# 23 "./src/gdevvec.h"
5676# 1 "./src/gdevbbox.h" 1
5677# 72 "./src/gdevbbox.h"
5678typedef struct gx_device_bbox_procs_s {
5679
5680
5681
5682 bool (*init_box)(void *proc_data);
5683
5684
5685
5686 void (*get_box)(const void *proc_data, gs_fixed_rect *pbox);
5687
5688
5689
5690 void (*add_rect)(void *proc_data, fixed x0, fixed y0, fixed x1, fixed y1);
5691
5692
5693
5694 bool (*in_rect)(const void *proc_data, const gs_fixed_rect *pbox);
5695
5696} gx_device_bbox_procs_t;
5697
5698bool bbox_default_init_box(void *proc_data);
5699void bbox_default_get_box(const void *proc_data, gs_fixed_rect *pbox);
5700void bbox_default_add_rect(void *proc_data, fixed x0, fixed y0, fixed x1, fixed y1);
5701bool bbox_default_in_rect(const void *proc_data, const gs_fixed_rect *pbox);
5702# 108 "./src/gdevbbox.h"
5703typedef struct gx_device_bbox_s gx_device_bbox;
5704
5705
5706
5707
5708struct gx_device_bbox_s {
5709 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target; bool free_standing; bool forward_open_close; gx_device_bbox_procs_t box_procs; void *box_proc_data; bool white_is_opaque; gs_fixed_rect bbox; gx_color_index black, white; gx_color_index transparent;
5710};
5711
5712extern const gs_memory_struct_type_t st_device_bbox;
5713
5714
5715
5716
5717
5718
5719void gx_device_bbox_init(gx_device_bbox * dev, gx_device * target, gs_memory_t *mem);
5720
5721
5722void gx_device_bbox_fwd_open_close(gx_device_bbox * dev,
5723 bool forward_open_close);
5724
5725
5726void gx_device_bbox_set_white_opaque(gx_device_bbox *dev,
5727 bool white_is_opaque);
5728
5729
5730void gx_device_bbox_bbox(gx_device_bbox * dev, gs_rect * pbbox);
5731
5732
5733void gx_device_bbox_release(gx_device_bbox *dev);
5734# 24 "./src/gdevvec.h" 2
5735# 1 "./src/gxiparam.h" 1
5736# 37 "./src/gxiparam.h"
5737struct gx_image_type_s {
5738
5739
5740
5741
5742 gs_memory_type_ptr_t stype;
5743
5744
5745
5746
5747
5748 int (*begin_typed_image)(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5749# 59 "./src/gxiparam.h"
5750 int (*source_size)(const gs_imager_state *pis, const gs_image_common_t *pic, gs_int_point *psize);
5751# 70 "./src/gxiparam.h"
5752 int (*sput)(const gs_image_common_t *pic, stream *s, const gs_color_space **ppcs);
5753# 80 "./src/gxiparam.h"
5754 int (*sget)(gs_image_common_t *pic, stream *s, const gs_color_space *pcs);
5755# 89 "./src/gxiparam.h"
5756 void (*release)(gs_image_common_t *pic, gs_memory_t *mem);
5757
5758
5759
5760
5761
5762 int index;
5763};
5764
5765
5766
5767
5768
5769int gx_data_image_source_size(const gs_imager_state *pis, const gs_image_common_t *pic, gs_int_point *psize);
5770
5771
5772
5773
5774int gx_image_no_sput(const gs_image_common_t *pic, stream *s, const gs_color_space **ppcs);
5775int gx_image_no_sget(gs_image_common_t *pic, stream *s, const gs_color_space *pcs);
5776void gx_image_default_release(gs_image_common_t *pic, gs_memory_t *mem);
5777
5778
5779
5780
5781int gx_pixel_image_sput(const gs_pixel_image_t *pic, stream *s,
5782 const gs_color_space **ppcs, int extra);
5783int gx_pixel_image_sget(gs_pixel_image_t *pic, stream *s,
5784 const gs_color_space *pcs);
5785void gx_pixel_image_release(gs_pixel_image_t *pic, gs_memory_t *mem);
5786
5787
5788bool gx_image_matrix_is_default(const gs_data_image_t *pid);
5789void gx_image_matrix_set_default(gs_data_image_t *pid);
5790void sput_variable_uint(stream *s, uint w);
5791int sget_variable_uint(stream *s, uint *pw);
5792# 138 "./src/gxiparam.h"
5793typedef struct gx_image_enum_procs_s {
5794# 149 "./src/gxiparam.h"
5795 int (*plane_data)(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used);
5796# 160 "./src/gxiparam.h"
5797 int (*end_image)(gx_image_enum_common_t *info, bool draw_last);
5798# 173 "./src/gxiparam.h"
5799 int (*flush)(gx_image_enum_common_t *info);
5800# 198 "./src/gxiparam.h"
5801 bool (*planes_wanted)(const gx_image_enum_common_t *info, byte *wanted);
5802
5803} gx_image_enum_procs_t;
5804# 220 "./src/gxiparam.h"
5805struct gx_image_enum_common_s {
5806 const gx_image_type_t *image_type; const gx_image_enum_procs_t *procs; gx_device *dev; gs_id id; int num_planes; int plane_depths[(((8 * 8) + 1) * 8)]; int plane_widths[(((8 * 8) + 1) * 8)];
5807};
5808
5809extern const gs_memory_struct_type_t st_gx_image_enum_common;
5810# 233 "./src/gxiparam.h"
5811int gx_image_enum_common_init(gx_image_enum_common_t * piec,
5812 const gs_data_image_t * pic,
5813 const gx_image_enum_procs_t * piep,
5814 gx_device * dev, int num_components,
5815 gs_image_format_t format);
5816
5817
5818
5819
5820
5821int gx_no_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used);
5822int gx_ignore_end_image(gx_image_enum_common_t *info, bool draw_last);
5823
5824
5825
5826
5827int gx_begin_image1(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5828int gx_image1_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used);
5829int gx_image1_end_image(gx_image_enum_common_t *info, bool draw_last);
5830int gx_image1_flush(gx_image_enum_common_t *info);
5831# 25 "./src/gdevvec.h" 2
5832# 1 "./src/gxistate.h" 1
5833# 28 "./src/gxistate.h"
5834# 1 "./src/gxmatrix.h" 1
5835# 33 "./src/gxmatrix.h"
5836struct gs_matrix_fixed_s {
5837 float xx, xy, yx, yy, tx, ty;
5838 fixed tx_fixed, ty_fixed;
5839 bool txy_fixed_valid;
5840};
5841
5842
5843
5844typedef struct gs_matrix_fixed_s gs_matrix_fixed;
5845
5846
5847
5848int gs_matrix_fixed_from_matrix(gs_matrix_fixed *, const gs_matrix *);
5849
5850
5851int gs_point_transform2fixed(const gs_matrix_fixed *, floatp, floatp,
5852 gs_fixed_point *);
5853int gs_distance_transform2fixed(const gs_matrix_fixed *, floatp, floatp,
5854 gs_fixed_point *);
5855
5856int gs_point_transform2fixed_rounding(const gs_matrix_fixed * pmat,
5857 floatp x, floatp y, gs_fixed_point * ppt);
5858# 63 "./src/gxmatrix.h"
5859typedef struct {
5860 long xx, xy, yx, yy;
5861 int skewed;
5862 int shift;
5863 int max_bits;
5864 fixed round;
5865} fixed_coeff;
5866# 81 "./src/gxmatrix.h"
5867fixed fixed_coeff_mult(fixed, long, const fixed_coeff *, int);
5868# 29 "./src/gxistate.h" 2
5869
5870# 1 "./src/gscspace.h" 1
5871# 166 "./src/gscspace.h"
5872typedef enum {
5873
5874
5875 gs_color_space_index_DeviceGray = 0,
5876 gs_color_space_index_DeviceRGB,
5877
5878
5879 gs_color_space_index_DeviceCMYK,
5880
5881
5882 gs_color_space_index_DevicePixel,
5883 gs_color_space_index_DeviceN,
5884
5885
5886
5887 gs_color_space_index_CIEDEFG,
5888 gs_color_space_index_CIEDEF,
5889 gs_color_space_index_CIEABC,
5890 gs_color_space_index_CIEA,
5891 gs_color_space_index_Separation,
5892 gs_color_space_index_Indexed,
5893 gs_color_space_index_Pattern,
5894
5895
5896 gs_color_space_index_CIEICC
5897
5898} gs_color_space_index;
5899# 201 "./src/gscspace.h"
5900typedef struct gs_color_space_type_s gs_color_space_type;
5901# 225 "./src/gscspace.h"
5902typedef struct gs_device_pixel_params_s {
5903 int depth;
5904} gs_device_pixel_params;
5905typedef struct gs_cie_a_s gs_cie_a;
5906typedef struct gs_cie_abc_s gs_cie_abc;
5907typedef struct gs_cie_def_s gs_cie_def;
5908typedef struct gs_cie_defg_s gs_cie_defg;
5909# 240 "./src/gscspace.h"
5910typedef struct gs_small_base_color_space_s {
5911 const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; } params;
5912} gs_small_base_color_space;
5913# 252 "./src/gscspace.h"
5914typedef struct gs_cie_icc_s gs_cie_icc;
5915
5916typedef struct gs_cieicc_params_s {
5917 gs_cie_icc * picc_info;
5918 gs_small_base_color_space alt_space;
5919} gs_icc_params;
5920
5921
5922
5923
5924
5925typedef struct gs_base_color_space_s {
5926 const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; } params;
5927} gs_base_color_space;
5928
5929
5930
5931
5932
5933typedef struct gs_device_n_map_s gs_device_n_map;
5934
5935
5936
5937
5938typedef struct gs_device_n_attributes_s gs_device_n_attributes;
5939
5940
5941
5942
5943
5944
5945typedef ulong gs_separation_name;
5946# 292 "./src/gscspace.h"
5947typedef int (gs_callback_func_get_colorname_string)
5948 (const gs_memory_t *mem, gs_separation_name colorname, unsigned char **ppstr, unsigned int *plen);
5949
5950typedef enum { SEP_NONE, SEP_ALL, SEP_OTHER } separation_type;
5951
5952typedef struct gs_separation_params_s {
5953 gs_separation_name sep_name;
5954 gs_base_color_space alt_space;
5955 gs_device_n_map *map;
5956 separation_type sep_type;
5957 bool use_alt_cspace;
5958 gs_callback_func_get_colorname_string *get_colorname_string;
5959
5960
5961
5962} gs_separation_params;
5963
5964typedef struct gs_device_n_params_s {
5965 gs_separation_name *names;
5966 uint num_components;
5967 gs_base_color_space alt_space;
5968 gs_device_n_map *map;
5969 gs_device_n_attributes *colorants;
5970 bool use_alt_cspace;
5971 gs_callback_func_get_colorname_string *get_colorname_string;
5972
5973
5974
5975} gs_device_n_params;
5976
5977
5978
5979
5980
5981
5982typedef struct gs_direct_color_space_s {
5983 const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; gs_separation_params separation; gs_device_n_params device_n; } params;
5984} gs_direct_color_space;
5985# 341 "./src/gscspace.h"
5986typedef struct gs_indexed_map_s gs_indexed_map;
5987
5988typedef struct gs_indexed_params_s {
5989 gs_direct_color_space base_space;
5990 int hival;
5991 union {
5992 gs_const_string table;
5993 gs_indexed_map *map;
5994 } lookup;
5995 bool use_proc;
5996} gs_indexed_params;
5997
5998
5999
6000
6001
6002typedef struct gs_paint_color_space_s {
6003 const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; gs_separation_params separation; gs_device_n_params device_n; gs_indexed_params indexed; } params;
6004} gs_paint_color_space;
6005
6006
6007
6008
6009
6010
6011
6012typedef struct gs_pattern_params_s {
6013 bool has_base_space;
6014 gs_paint_color_space base_space;
6015} gs_pattern_params;
6016
6017
6018
6019
6020struct gs_color_space_s {
6021 const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; gs_separation_params separation; gs_device_n_params device_n; gs_indexed_params indexed; gs_pattern_params pattern; } params;
6022
6023
6024
6025};
6026# 438 "./src/gscspace.h"
6027extern int
6028 gs_cspace_init_DeviceGray(const gs_memory_t *mem, gs_color_space *pcs),
6029 gs_cspace_build_DeviceGray(gs_color_space ** ppcspace,
6030 gs_memory_t * pmem),
6031 gs_cspace_init_DeviceRGB(const gs_memory_t *mem, gs_color_space *pcs),
6032 gs_cspace_build_DeviceRGB(gs_color_space ** ppcspace,
6033 gs_memory_t * pmem),
6034 gs_cspace_init_DeviceCMYK(const gs_memory_t *mem, gs_color_space *pcs),
6035 gs_cspace_build_DeviceCMYK(gs_color_space ** ppcspace,
6036 gs_memory_t * pmem);
6037
6038
6039void gs_cspace_init_from(gs_color_space * pcsto,
6040 const gs_color_space * pcsfrom);
6041
6042
6043void gs_cspace_assign(gs_color_space * pdest, const gs_color_space * psrc);
6044
6045
6046void gs_cspace_release(gs_color_space * pcs);
6047
6048
6049
6050
6051gs_color_space_index gs_color_space_get_index(const gs_color_space *);
6052
6053
6054int gs_color_space_num_components(const gs_color_space *);
6055
6056
6057
6058
6059
6060
6061bool gs_color_space_equal(const gs_color_space *pcs1,
6062 const gs_color_space *pcs2);
6063
6064
6065
6066
6067
6068
6069void gs_color_space_restrict_color(gs_client_color *, const gs_color_space *);
6070
6071
6072
6073
6074
6075
6076const gs_color_space *gs_cspace_base_space(const gs_color_space * pcspace);
6077# 31 "./src/gxistate.h" 2
6078# 1 "./src/gstrans.h" 1
6079# 21 "./src/gstrans.h"
6080# 1 "./src/gxcomp.h" 1
6081# 22 "./src/gxcomp.h"
6082# 1 "./src/gxbitfmt.h" 1
6083# 28 "./src/gxbitfmt.h"
6084typedef ulong gx_bitmap_format_t;
6085# 23 "./src/gxcomp.h" 2
6086# 67 "./src/gxcomp.h"
6087typedef struct gs_composite_type_procs_s {
6088
6089
6090
6091
6092
6093
6094
6095 int (*create_default_compositor)(const gs_composite_t *pcte, gx_device **pcdev, gx_device *dev, gs_imager_state *pis, gs_memory_t *mem);
6096
6097
6098
6099
6100
6101
6102 bool (*equal)(const gs_composite_t *pcte, const gs_composite_t *pcte2);
6103# 95 "./src/gxcomp.h"
6104 int (*write)(const gs_composite_t *pcte, byte *data, uint *psize);
6105# 105 "./src/gxcomp.h"
6106 int (*read)(gs_composite_t **ppcte, const byte *data, uint size, gs_memory_t *mem);
6107
6108
6109
6110
6111
6112
6113
6114 int (*clist_compositor_write_update)(const gs_composite_t * pcte, gx_device * dev, gx_device ** pcdev, gs_imager_state * pis, gs_memory_t * mem);
6115
6116
6117
6118
6119
6120
6121
6122 int (*clist_compositor_read_update)(gs_composite_t * pcte, gx_device * cdev, gx_device * tdev, gs_imager_state * pis, gs_memory_t * mem);
6123
6124} gs_composite_type_procs_t;
6125
6126typedef struct gs_composite_type_s {
6127 byte comp_id;
6128 gs_composite_type_procs_t procs;
6129} gs_composite_type_t;
6130
6131
6132
6133
6134
6135int gx_default_composite_clist_write_update(const gs_composite_t * pcte, gx_device * dev, gx_device ** pcdev, gs_imager_state * pis, gs_memory_t * mem);
6136
6137
6138
6139
6140
6141int gx_default_composite_clist_read_update(gs_composite_t * pcte, gx_device * cdev, gx_device * tdev, gs_imager_state * pis, gs_memory_t * mem);
6142# 152 "./src/gxcomp.h"
6143struct gs_composite_s {
6144 const gs_composite_type_t *type; gs_id id; rc_header rc;
6145};
6146# 22 "./src/gstrans.h" 2
6147
6148
6149
6150
6151typedef enum {
6152 PDF14_PUSH_DEVICE,
6153 PDF14_POP_DEVICE,
6154 PDF14_BEGIN_TRANS_GROUP,
6155 PDF14_END_TRANS_GROUP,
6156 PDF14_INIT_TRANS_MASK,
6157 PDF14_BEGIN_TRANS_MASK,
6158 PDF14_END_TRANS_MASK,
6159 PDF14_SET_BLEND_PARAMS
6160} pdf14_compositor_operations;
6161# 60 "./src/gstrans.h"
6162typedef struct gs_transparency_source_s {
6163 float alpha;
6164 gs_transparency_mask_t *mask;
6165} gs_transparency_source_t;
6166
6167struct gs_pdf14trans_params_s {
6168
6169 pdf14_compositor_operations pdf14_op;
6170
6171 int changed;
6172
6173 bool Isolated;
6174 bool Knockout;
6175 gs_rect bbox;
6176
6177 gs_transparency_channel_selector_t csel;
6178
6179 gs_transparency_mask_subtype_t subtype;
6180 int Background_components;
6181 bool function_is_identity;
6182 float Background[(8 * 8)];
6183 float GrayBackground;
6184 gs_function_t *transfer_function;
6185 byte transfer_fn[256];
6186
6187 gs_blend_mode_t blend_mode;
6188 bool text_knockout;
6189 gs_transparency_source_t opacity;
6190 gs_transparency_source_t shape;
6191 bool mask_is_image;
6192};
6193
6194typedef struct gs_pdf14trans_params_s gs_pdf14trans_params_t;
6195
6196
6197
6198
6199
6200
6201typedef struct gs_pdf14trans_s {
6202 const gs_composite_type_t *type; gs_id id; rc_header rc;
6203 gs_pdf14trans_params_t params;
6204} gs_pdf14trans_t;
6205
6206
6207
6208int gs_setblendmode(gs_state *, gs_blend_mode_t);
6209gs_blend_mode_t gs_currentblendmode(const gs_state *);
6210int gs_setopacityalpha(gs_state *, floatp);
6211float gs_currentopacityalpha(const gs_state *);
6212int gs_setshapealpha(gs_state *, floatp);
6213float gs_currentshapealpha(const gs_state *);
6214int gs_settextknockout(gs_state *, bool);
6215bool gs_currenttextknockout(const gs_state *);
6216
6217
6218
6219
6220
6221
6222gs_transparency_state_type_t
6223 gs_current_transparency_type(const gs_state *pgs);
6224
6225
6226
6227
6228
6229int gs_push_pdf14trans_device(gs_state * pgs);
6230
6231int gs_pop_pdf14trans_device(gs_state * pgs);
6232
6233void gs_trans_group_params_init(gs_transparency_group_params_t *ptgp);
6234
6235int gs_begin_transparency_group(gs_state * pgs,
6236 const gs_transparency_group_params_t *ptgp,
6237 const gs_rect *pbbox);
6238
6239int gs_end_transparency_group(gs_state *pgs);
6240
6241void gs_trans_mask_params_init(gs_transparency_mask_params_t *ptmp,
6242 gs_transparency_mask_subtype_t subtype);
6243
6244int gs_begin_transparency_mask(gs_state *pgs,
6245 const gs_transparency_mask_params_t *ptmp,
6246 const gs_rect *pbbox, bool mask_is_image);
6247
6248int gs_end_transparency_mask(gs_state *pgs,
6249 gs_transparency_channel_selector_t csel);
6250
6251int gs_init_transparency_mask(gs_state *pgs,
6252 gs_transparency_channel_selector_t csel);
6253
6254int gs_discard_transparency_layer(gs_state *pgs);
6255
6256
6257
6258
6259int gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
6260 const gs_pdf14trans_params_t * pparams);
6261
6262int gx_end_transparency_group(gs_imager_state * pis, gx_device * pdev);
6263
6264int gx_init_transparency_mask(gs_imager_state * pis,
6265 const gs_pdf14trans_params_t * pparams);
6266
6267int gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
6268 const gs_pdf14trans_params_t * pparams);
6269
6270int gx_end_transparency_mask(gs_imager_state * pis, gx_device * pdev,
6271 const gs_pdf14trans_params_t * pparams);
6272
6273int gx_discard_transparency_layer(gs_imager_state *pis);
6274
6275
6276
6277
6278int gs_is_pdf14trans_compositor(const gs_composite_t * pct);
6279# 32 "./src/gxistate.h" 2
6280# 86 "./src/gxistate.h"
6281typedef struct gs_halftone_s gs_halftone;
6282# 109 "./src/gxistate.h"
6283typedef struct gx_transfer_s {
6284 int red_component_num;
6285 gx_transfer_map *red;
6286 int green_component_num;
6287 gx_transfer_map *green;
6288 int blue_component_num;
6289 gx_transfer_map *blue;
6290 int gray_component_num;
6291 gx_transfer_map *gray;
6292} gx_transfer;
6293# 187 "./src/gxistate.h"
6294typedef struct gs_devicen_color_map_s {
6295 bool use_alt_cspace;
6296
6297
6298
6299 separation_type sep_type;
6300 uint num_components;
6301 uint num_colorants;
6302 gs_id cspace_id;
6303 int color_map[(8 * 8)];
6304} gs_devicen_color_map;
6305# 253 "./src/gxistate.h"
6306struct gs_imager_state_s {
6307 gs_memory_t *memory; void *client_data; gx_line_params line_params; gs_matrix_fixed ctm; bool current_point_valid; gs_point current_point; gs_point subpath_start; bool clamp_coordinates; gs_logical_operation_t log_op; gx_color_value alpha; gs_blend_mode_t blend_mode; gs_transparency_source_t opacity, shape; gs_id soft_mask_id; bool text_knockout; uint text_rendering_mode; gs_transparency_state_t *transparency_stack; bool overprint; int overprint_mode; int effective_overprint_mode; float flatness; gs_fixed_point fill_adjust; bool stroke_adjust; bool accurate_curves; bool have_pattern_streams; float smoothness; const gx_color_map_procs * (*get_cmap_procs)(const gs_imager_state *, const gx_device *); gs_halftone *halftone; gs_int_point screen_phase[2]; gx_device_halftone *dev_ht; struct gs_cie_render_s *cie_render; gx_transfer_map *black_generation; gx_transfer_map *undercolor_removal; gx_transfer set_transfer; gx_transfer_map *effective_transfer[(8 * 8)]; struct gx_cie_joint_caches_s *cie_joint_caches; const struct gx_color_map_procs_s *cmap_procs; gs_devicen_color_map color_component_map; struct gx_pattern_cache_s *pattern_cache;
6308};
6309# 274 "./src/gxistate.h"
6310int gs_imager_state_initialize(gs_imager_state * pis, gs_memory_t * mem);
6311
6312
6313
6314gs_imager_state *
6315 gs_imager_state_copy(const gs_imager_state * pis, gs_memory_t * mem);
6316
6317
6318void gs_imager_state_copied(gs_imager_state * pis);
6319
6320
6321void gs_imager_state_pre_assign(gs_imager_state *to,
6322 const gs_imager_state *from);
6323
6324
6325
6326void gs_imager_state_release(gs_imager_state * pis);
6327int gs_currentscreenphase_pis(const gs_imager_state *, gs_int_point *, gs_color_select_t);
6328# 26 "./src/gdevvec.h" 2
6329# 1 "./src/gxhldevc.h" 1
6330# 66 "./src/gxhldevc.h"
6331typedef struct gx_hl_saved_color_s {
6332 gs_id color_space_id;
6333 gs_id pattern_id;
6334 bool ccolor_valid;
6335 gs_client_color ccolor;
6336 gx_device_color_saved saved_dev_color;
6337} gx_hl_saved_color;
6338
6339
6340
6341
6342void gx_hld_saved_color_init(gx_hl_saved_color * psc);
6343
6344
6345
6346
6347
6348const gs_state * gx_hld_get_gstate_ptr(const gs_imager_state * pis);
6349# 98 "./src/gxhldevc.h"
6350bool gx_hld_save_color(const gs_imager_state * pis,
6351 const gx_device_color * pdevc, gx_hl_saved_color * psc);
6352
6353
6354
6355
6356
6357
6358bool gx_hld_saved_color_equal(const gx_hl_saved_color * psc1,
6359 const gx_hl_saved_color * psc2);
6360
6361
6362
6363
6364bool gx_hld_saved_color_same_cspace(const gx_hl_saved_color * psc1,
6365 const gx_hl_saved_color * psc2);
6366
6367
6368
6369
6370bool
6371gx_hld_is_hl_color_available(const gs_imager_state * pis,
6372 const gx_device_color * pdevc);
6373# 129 "./src/gxhldevc.h"
6374typedef enum {
6375 non_pattern_color_space,
6376 pattern_color_sapce,
6377 use_process_color
6378} gx_hld_get_color_space_and_ccolor_status;
6379# 158 "./src/gxhldevc.h"
6380gx_hld_get_color_space_and_ccolor_status gx_hld_get_color_space_and_ccolor(
6381 const gs_imager_state * pis, const gx_device_color * pdevc,
6382 const gs_color_space ** ppcs, const gs_client_color ** ppcc);
6383# 169 "./src/gxhldevc.h"
6384int gx_hld_get_number_color_components(const gs_imager_state * pis);
6385
6386
6387
6388
6389typedef enum {
6390 valid_result = 1,
6391 invalid_color_info = 2,
6392 invalid_component_requested = 3
6393} gx_hld_get_color_component_status;
6394# 188 "./src/gxhldevc.h"
6395gx_hld_get_color_component_status gx_hld_get_color_component(
6396 const gs_imager_state * pis, const gx_device_color * pdevc,
6397 int comp_numi, float * output);
6398# 27 "./src/gdevvec.h" 2
6399# 62 "./src/gdevvec.h"
6400typedef struct gx_device_vector_s gx_device_vector;
6401# 77 "./src/gdevvec.h"
6402typedef enum {
6403 gx_path_type_none = 0,
6404
6405
6406
6407
6408 gx_path_type_fill = 1,
6409 gx_path_type_stroke = 2,
6410 gx_path_type_clip = 4,
6411 gx_path_type_winding_number = 0,
6412 gx_path_type_even_odd = 8,
6413 gx_path_type_optimize = 16,
6414 gx_path_type_always_close = 32,
6415 gx_path_type_rule = gx_path_type_winding_number | gx_path_type_even_odd
6416} gx_path_type_t;
6417typedef enum {
6418 gx_rect_x_first,
6419 gx_rect_y_first
6420} gx_rect_direction_t;
6421typedef struct gx_device_vector_procs_s {
6422
6423 int (*beginpage) (gx_device_vector * vdev);
6424
6425 int (*setlinewidth) (gx_device_vector * vdev, floatp width);
6426 int (*setlinecap) (gx_device_vector * vdev, gs_line_cap cap);
6427 int (*setlinejoin) (gx_device_vector * vdev, gs_line_join join);
6428 int (*setmiterlimit) (gx_device_vector * vdev, floatp limit);
6429 int (*setdash) (gx_device_vector * vdev, const float *pattern,
6430 uint count, floatp offset);
6431 int (*setflat) (gx_device_vector * vdev, floatp flatness);
6432 int (*setlogop) (gx_device_vector * vdev, gs_logical_operation_t lop,
6433 gs_logical_operation_t diff);
6434
6435 bool (*can_handle_hl_color) (gx_device_vector * vdev, const gs_imager_state * pis,
6436 const gx_drawing_color * pdc);
6437 int (*setfillcolor) (gx_device_vector * vdev, const gs_imager_state * pis,
6438 const gx_drawing_color * pdc);
6439 int (*setstrokecolor) (gx_device_vector * vdev, const gs_imager_state * pis,
6440 const gx_drawing_color * pdc);
6441
6442
6443 int (*dopath) (gx_device_vector * vdev, const gx_path * ppath,
6444 gx_path_type_t type, const gs_matrix *pmat);
6445 int (*dorect) (gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
6446 fixed y1, gx_path_type_t type);
6447 int (*beginpath) (gx_device_vector * vdev, gx_path_type_t type);
6448 int (*moveto) (gx_device_vector * vdev, floatp x0, floatp y0,
6449 floatp x, floatp y, gx_path_type_t type);
6450 int (*lineto) (gx_device_vector * vdev, floatp x0, floatp y0,
6451 floatp x, floatp y, gx_path_type_t type);
6452 int (*curveto) (gx_device_vector * vdev, floatp x0, floatp y0,
6453 floatp x1, floatp y1, floatp x2, floatp y2,
6454 floatp x3, floatp y3, gx_path_type_t type);
6455 int (*closepath) (gx_device_vector * vdev, floatp x0, floatp y0,
6456 floatp x_start, floatp y_start, gx_path_type_t type);
6457 int (*endpath) (gx_device_vector * vdev, gx_path_type_t type);
6458} gx_device_vector_procs;
6459
6460
6461
6462int gdev_vector_setflat(gx_device_vector * vdev, floatp flatness);
6463
6464
6465
6466int gdev_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
6467 gx_path_type_t type, const gs_matrix *pmat);
6468
6469
6470int gdev_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0,
6471 fixed x1, fixed y1, gx_path_type_t type);
6472# 203 "./src/gdevvec.h"
6473struct gx_device_vector_s {
6474 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gs_memory_t *v_memory; const gx_device_vector_procs *vec_procs; char fname[(260 - 1) + 1]; FILE *file; stream *strm; byte *strmbuf; uint strmbuf_size; int open_options; gs_imager_state state; float dash_pattern[11]; bool fill_used_process_color; bool stroke_used_process_color; gx_hl_saved_color saved_fill_color; gx_hl_saved_color saved_stroke_color; gs_id no_clip_path_id; gs_id clip_path_id; gx_path_type_t fill_options, stroke_options; gs_point scale; bool in_page; gx_device_bbox *bbox_device; gx_color_index black, white;
6475};
6476
6477
6478
6479extern const gs_memory_struct_type_t st_device_vector;
6480# 220 "./src/gdevvec.h"
6481void gdev_vector_init(gx_device_vector * vdev);
6482
6483
6484void gdev_vector_reset(gx_device_vector * vdev);
6485# 234 "./src/gdevvec.h"
6486int gdev_vector_open_file_options(gx_device_vector * vdev,
6487 uint strmbuf_size, int open_options);
6488
6489
6490
6491
6492
6493
6494
6495stream *gdev_vector_stream(gx_device_vector * vdev);
6496
6497
6498
6499int gdev_vector_update_log_op(gx_device_vector * vdev,
6500 gs_logical_operation_t lop);
6501
6502
6503
6504int gdev_vector_update_fill_color(gx_device_vector * vdev,
6505 const gs_imager_state * pis,
6506 const gx_drawing_color * pdcolor);
6507
6508
6509
6510int gdev_vector_prepare_fill(gx_device_vector * vdev,
6511 const gs_imager_state * pis,
6512 const gx_fill_params * params,
6513 const gx_drawing_color * pdcolor);
6514
6515
6516
6517
6518
6519
6520int gdev_vector_prepare_stroke(gx_device_vector * vdev,
6521 const gs_imager_state * pis,
6522 const gx_stroke_params * params,
6523 const gx_drawing_color * pdcolor,
6524 floatp scale);
6525
6526
6527
6528
6529
6530
6531
6532int gdev_vector_stroke_scaling(const gx_device_vector *vdev,
6533 const gs_imager_state *pis,
6534 double *pscale, gs_matrix *pmat);
6535
6536
6537typedef struct gdev_vector_dopath_state_s {
6538
6539 gx_device_vector *vdev;
6540 gx_path_type_t type;
6541 bool first;
6542 gs_matrix scale_mat;
6543
6544 gs_point start;
6545 gs_point prev;
6546} gdev_vector_dopath_state_t;
6547void gdev_vector_dopath_init(gdev_vector_dopath_state_t *state,
6548 gx_device_vector *vdev,
6549 gx_path_type_t type, const gs_matrix *pmat);
6550
6551
6552int gdev_vector_dopath_segment(gdev_vector_dopath_state_t *state, int pe_op,
6553 gs_fixed_point vs[3]);
6554
6555
6556
6557
6558
6559int gdev_vector_write_polygon(gx_device_vector * vdev,
6560 const gs_fixed_point * points, uint count,
6561 bool close, gx_path_type_t type);
6562
6563
6564int gdev_vector_write_rectangle(gx_device_vector * vdev,
6565 fixed x0, fixed y0, fixed x1, fixed y1,
6566 bool close, gx_rect_direction_t dir);
6567
6568
6569
6570int gdev_vector_write_clip_path(gx_device_vector * vdev,
6571 const gx_clip_path * pcpath);
6572
6573
6574
6575int gdev_vector_update_clip_path(gx_device_vector * vdev,
6576 const gx_clip_path * pcpath);
6577
6578
6579int gdev_vector_close_file(gx_device_vector * vdev);
6580# 343 "./src/gdevvec.h"
6581typedef struct gdev_vector_image_enum_s {
6582 const gx_image_type_t *image_type; const gx_image_enum_procs_t *procs; gx_device *dev; gs_id id; int num_planes; int plane_depths[(((8 * 8) + 1) * 8)]; int plane_widths[(((8 * 8) + 1) * 8)]; gs_memory_t *memory; gx_image_enum_common_t *default_info; gx_image_enum_common_t *bbox_info; int width, height; int bits_per_pixel; uint bits_per_row; int y;
6583} gdev_vector_image_enum_t;
6584
6585extern const gs_memory_struct_type_t st_vector_image_enum;
6586# 358 "./src/gdevvec.h"
6587int gdev_vector_begin_image(gx_device_vector * vdev,
6588 const gs_imager_state * pis, const gs_image_t * pim,
6589 gs_image_format_t format, const gs_int_rect * prect,
6590 const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
6591 gs_memory_t * mem, const gx_image_enum_procs_t * pprocs,
6592 gdev_vector_image_enum_t * pie);
6593
6594
6595
6596int gdev_vector_end_image(gx_device_vector * vdev,
6597 gdev_vector_image_enum_t * pie, bool draw_last, gx_color_index pad);
6598
6599
6600
6601
6602int gdev_vector_put_params(gx_device *dev, gs_param_list *plist);
6603int gdev_vector_get_params(gx_device *dev, gs_param_list *plist);
6604
6605
6606
6607
6608int gdev_vector_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
6609
6610int gdev_vector_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
6611
6612int gdev_vector_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
6613
6614
6615int gdev_vector_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
6616int gdev_vector_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
6617int gdev_vector_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
6618# 26 "./src/gdevpsdf.h" 2
6619
6620# 1 "./src/strimpl.h" 1
6621# 124 "./src/strimpl.h"
6622struct stream_template_s {
6623
6624
6625 gs_memory_type_ptr_t stype;
6626
6627
6628 int (*init)(stream_state *);
6629
6630
6631
6632 int (*process)(stream_state *, stream_cursor_read *, stream_cursor_write *, bool);
6633
6634
6635 uint min_in_size;
6636 uint min_out_size;
6637
6638
6639 void (*release)(stream_state *);
6640
6641
6642
6643 void (*set_defaults)(stream_state *);
6644
6645
6646 int (*reinit)(stream_state *);
6647
6648};
6649
6650
6651int stream_move(stream_cursor_read *, stream_cursor_write *);
6652
6653
6654typedef enum {
6655 hex_ignore_garbage = 0,
6656 hex_ignore_whitespace = 1,
6657 hex_ignore_leading_whitespace = 2
6658} hex_syntax;
6659int s_hex_process(stream_cursor_read *, stream_cursor_write *, int *, hex_syntax);
6660# 28 "./src/gdevpsdf.h" 2
6661# 1 "./src/sa85x.h" 1
6662# 21 "./src/sa85x.h"
6663# 1 "./src/sa85d.h" 1
6664# 22 "./src/sa85d.h"
6665typedef struct stream_A85D_state_s {
6666 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
6667 int odd;
6668 ulong word;
6669} stream_A85D_state;
6670# 35 "./src/sa85d.h"
6671extern const stream_template s_A85D_template;
6672# 22 "./src/sa85x.h" 2
6673
6674
6675typedef struct stream_A85E_state_s {
6676 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
6677
6678 int count;
6679 int last_char;
6680} stream_A85E_state;
6681
6682
6683
6684
6685
6686
6687extern const stream_template s_A85E_template;
6688# 29 "./src/gdevpsdf.h" 2
6689# 1 "./src/scfx.h" 1
6690# 21 "./src/scfx.h"
6691# 1 "./src/shc.h" 1
6692# 20 "./src/shc.h"
6693# 1 "./src/gsbittab.h" 1
6694# 41 "./src/gsbittab.h"
6695extern const byte byte_reverse_bits[256];
6696
6697
6698
6699
6700extern const byte byte_right_mask[9];
6701
6702
6703
6704
6705extern const byte byte_count_bits[256];
6706# 60 "./src/gsbittab.h"
6707extern const byte
6708 byte_bit_run_length_0[256], byte_bit_run_length_1[256],
6709 byte_bit_run_length_2[256], byte_bit_run_length_3[256],
6710 byte_bit_run_length_4[256], byte_bit_run_length_5[256],
6711 byte_bit_run_length_6[256], byte_bit_run_length_7[256];
6712
6713
6714
6715
6716
6717extern const byte *const byte_bit_run_length[8];
6718extern const byte *const byte_bit_run_length_neg[8];
6719
6720
6721
6722
6723
6724extern const byte byte_acegbdfh_to_abcdefgh[256];
6725# 21 "./src/shc.h" 2
6726# 45 "./src/shc.h"
6727typedef struct hc_definition_s {
6728 ushort *counts;
6729 uint num_counts;
6730 ushort *values;
6731 uint num_values;
6732} hc_definition;
6733# 71 "./src/shc.h"
6734typedef struct stream_hc_state_s {
6735 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left;
6736} stream_hc_state;
6737# 84 "./src/shc.h"
6738typedef struct hce_code_s {
6739 ushort code;
6740 ushort code_length;
6741} hce_code;
6742
6743
6744
6745typedef struct hce_table_s {
6746 uint count;
6747 hce_code *codes;
6748} hce_table;
6749# 133 "./src/shc.h"
6750void hc_put_code_proc(bool, byte *, uint);
6751# 150 "./src/shc.h"
6752byte *hc_put_last_bits_proc(stream_hc_state *, byte *, uint, int);
6753# 169 "./src/shc.h"
6754typedef struct hcd_code_s {
6755 short value;
6756 ushort code_length;
6757} hcd_code;
6758
6759typedef struct hcd_table_s {
6760 uint count;
6761 uint initial_bits;
6762 hcd_code *codes;
6763} hcd_table;
6764# 22 "./src/scfx.h" 2
6765# 46 "./src/scfx.h"
6766typedef struct stream_CF_state_s {
6767 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left; bool Uncompressed; int K; bool EndOfLine; bool EncodedByteAlign; int Columns; int Rows; bool EndOfBlock; bool BlackIs1; int DamagedRowsBeforeError; int DecodedByteAlign; uint raster; byte *lbuf; byte *lprev; int k_left;
6768} stream_CF_state;
6769# 69 "./src/scfx.h"
6770typedef struct stream_CFE_state_s {
6771 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left; bool Uncompressed; int K; bool EndOfLine; bool EncodedByteAlign; int Columns; int Rows; bool EndOfBlock; bool BlackIs1; int DamagedRowsBeforeError; int DecodedByteAlign; uint raster; byte *lbuf; byte *lprev; int k_left;
6772
6773 int max_code_bytes;
6774 byte *lcode;
6775
6776 int read_count;
6777 int write_count;
6778 int code_bytes;
6779} stream_CFE_state;
6780
6781
6782
6783
6784
6785
6786extern const stream_template s_CFE_template;
6787
6788
6789typedef struct stream_CFD_state_s {
6790 const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left; bool Uncompressed; int K; bool EndOfLine; bool EncodedByteAlign; int Columns; int Rows; bool EndOfBlock; bool BlackIs1; int DamagedRowsBeforeError; int DecodedByteAlign; uint raster; byte *lbuf; byte *lprev; int k_left;
6791 int cbit;
6792
6793 int rows_left;
6794 int row;
6795 int rpos;
6796 int wpos;
6797
6798 int eol_count;
6799 byte invert;
6800
6801 int run_color;
6802
6803
6804
6805 int damaged_rows;
6806
6807 bool skipping_damage;
6808
6809
6810 int uncomp_run;
6811
6812
6813 int uncomp_left;
6814 int uncomp_exit;
6815
6816} stream_CFD_state;
6817
6818
6819
6820
6821
6822
6823extern const stream_template s_CFD_template;
6824# 30 "./src/gdevpsdf.h" 2
6825# 1 "./src/spsdf.h" 1
6826# 34 "./src/spsdf.h"
6827void s_write_ps_string(stream * s, const byte * str, uint size, int print_ok);
6828
6829
6830
6831
6832
6833
6834int s_alloc_position_stream(stream ** ps, gs_memory_t * mem);
6835
6836
6837
6838
6839
6840typedef struct param_printer_params_s {
6841 const char *prefix;
6842 const char *suffix;
6843 const char *item_prefix;
6844 const char *item_suffix;
6845 int print_ok;
6846} param_printer_params_t;
6847
6848
6849
6850
6851typedef struct printer_param_list_s {
6852 const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
6853 stream *strm;
6854 param_printer_params_t params;
6855 bool any;
6856} printer_param_list_t;
6857
6858
6859
6860
6861
6862
6863extern const param_printer_params_t param_printer_params_default;
6864int s_alloc_param_printer(gs_param_list ** pplist,
6865 const param_printer_params_t * ppp, stream * s,
6866 gs_memory_t * mem);
6867void s_free_param_printer(gs_param_list * plist);
6868
6869int s_init_param_printer(printer_param_list_t *prlist,
6870 const param_printer_params_t * ppp, stream * s);
6871void s_release_param_printer(printer_param_list_t *prlist);
6872# 31 "./src/gdevpsdf.h" 2
6873
6874extern const stream_template s_DCTE_template;
6875# 43 "./src/gdevpsdf.h"
6876typedef struct psdf_image_params_s {
6877 gs_c_param_list *ACSDict;
6878 bool AntiAlias;
6879 bool AutoFilter;
6880 int Depth;
6881 gs_c_param_list *Dict;
6882 bool Downsample;
6883 float DownsampleThreshold;
6884 enum psdf_downsample_type {
6885 ds_Average,
6886 ds_Bicubic,
6887 ds_Subsample
6888 } DownsampleType;
6889
6890
6891 bool Encode;
6892 const char *Filter;
6893 int Resolution;
6894 const char *AutoFilterStrategy;
6895 const stream_template *filter_template;
6896} psdf_image_params;
6897
6898
6899
6900
6901
6902
6903extern const stream_template s_CFE_template;
6904
6905
6906typedef struct psdf_distiller_params_s {
6907
6908
6909
6910 bool ASCII85EncodePages;
6911 enum psdf_auto_rotate_pages {
6912 arp_None,
6913 arp_All,
6914 arp_PageByPage
6915 } AutoRotatePages;
6916
6917
6918 enum psdf_binding {
6919 binding_Left,
6920 binding_Right
6921 } Binding;
6922
6923
6924 bool CompressPages;
6925 enum psdf_default_rendering_intent {
6926 ri_Default,
6927 ri_Perceptual,
6928 ri_Saturation,
6929 ri_RelativeColorimetric,
6930 ri_AbsoluteColorimetric
6931 } DefaultRenderingIntent;
6932
6933
6934
6935 bool DetectBlends;
6936 bool DoThumbnails;
6937 long ImageMemory;
6938 bool LockDistillerParams;
6939 bool LZWEncodePages;
6940 int OPM;
6941 bool PreserveOPIComments;
6942 bool UseFlateCompression;
6943
6944
6945
6946 gs_const_string CalCMYKProfile;
6947 gs_const_string CalGrayProfile;
6948 gs_const_string CalRGBProfile;
6949 gs_const_string sRGBProfile;
6950 enum psdf_color_conversion_strategy {
6951 ccs_LeaveColorUnchanged,
6952 ccs_UseDeviceDependentColor,
6953 ccs_UseDeviceIndependentColor,
6954 ccs_UseDeviceIndependentColorForImages,
6955 ccs_sRGB,
6956 ccs_CMYK,
6957 ccs_Gray
6958 } ColorConversionStrategy;
6959
6960
6961
6962
6963 bool PreserveHalftoneInfo;
6964 bool PreserveOverprintSettings;
6965 enum psdf_transfer_function_info {
6966 tfi_Preserve,
6967 tfi_Apply,
6968 tfi_Remove
6969 } TransferFunctionInfo;
6970
6971
6972 enum psdf_ucr_and_bg_info {
6973 ucrbg_Preserve,
6974 ucrbg_Remove
6975 } UCRandBGInfo;
6976# 157 "./src/gdevpsdf.h"
6977 psdf_image_params ColorImage;
6978 bool ConvertCMYKImagesToRGB;
6979 bool ConvertImagesToIndexed;
6980
6981
6982
6983
6984
6985
6986
6987 psdf_image_params GrayImage;
6988
6989
6990
6991
6992
6993
6994 psdf_image_params MonoImage;
6995
6996
6997
6998
6999
7000
7001 gs_param_string_array AlwaysEmbed;
7002 gs_param_string_array NeverEmbed;
7003 enum psdf_cannot_embed_font_policy {
7004 cefp_OK,
7005 cefp_Warning,
7006 cefp_Error
7007 } CannotEmbedFontPolicy;
7008
7009
7010 bool EmbedAllFonts;
7011 int MaxSubsetPct;
7012 bool SubsetFonts;
7013
7014
7015
7016
7017} psdf_distiller_params;
7018
7019
7020typedef enum {
7021 psdf_version_level1 = 1000,
7022 psdf_version_level1_color = 1100,
7023 psdf_version_level2 = 2000,
7024 psdf_version_level2_with_TT = 2010,
7025 psdf_version_level2_plus = 2017,
7026 psdf_version_ll3 = 3010
7027} psdf_version;
7028# 220 "./src/gdevpsdf.h"
7029typedef struct gx_device_psdf_s {
7030 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gs_memory_t *v_memory; const gx_device_vector_procs *vec_procs; char fname[(260 - 1) + 1]; FILE *file; stream *strm; byte *strmbuf; uint strmbuf_size; int open_options; gs_imager_state state; float dash_pattern[11]; bool fill_used_process_color; bool stroke_used_process_color; gx_hl_saved_color saved_fill_color; gx_hl_saved_color saved_stroke_color; gs_id no_clip_path_id; gs_id clip_path_id; gx_path_type_t fill_options, stroke_options; gs_point scale; bool in_page; gx_device_bbox *bbox_device; gx_color_index black, white; psdf_version version; bool binary_ok; bool HaveCFF; bool HaveTrueTypes; bool HaveCIDSystem; double ParamCompatibilityLevel; psdf_distiller_params params;
7031} gx_device_psdf;
7032# 240 "./src/gdevpsdf.h"
7033extern const gs_memory_struct_type_t st_device_psdf;
7034# 262 "./src/gdevpsdf.h"
7035int gdev_psdf_get_params(gx_device *dev, gs_param_list *plist);
7036int gdev_psdf_put_params(gx_device *dev, gs_param_list *plist);
7037
7038
7039
7040
7041int psdf_setlinewidth(gx_device_vector * vdev, floatp width);
7042int psdf_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
7043int psdf_setlinejoin(gx_device_vector * vdev, gs_line_join join);
7044int psdf_setmiterlimit(gx_device_vector * vdev, floatp limit);
7045int psdf_setdash(gx_device_vector * vdev, const float *pattern,
7046 uint count, floatp offset);
7047int psdf_setflat(gx_device_vector * vdev, floatp flatness);
7048int psdf_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
7049 gs_logical_operation_t diff);
7050
7051
7052
7053int psdf_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
7054 fixed y1, gx_path_type_t type);
7055int psdf_beginpath(gx_device_vector * vdev, gx_path_type_t type);
7056int psdf_moveto(gx_device_vector * vdev, floatp x0, floatp y0,
7057 floatp x, floatp y, gx_path_type_t type);
7058int psdf_lineto(gx_device_vector * vdev, floatp x0, floatp y0,
7059 floatp x, floatp y, gx_path_type_t type);
7060int psdf_curveto(gx_device_vector * vdev, floatp x0, floatp y0,
7061 floatp x1, floatp y1, floatp x2,
7062 floatp y2, floatp x3, floatp y3, gx_path_type_t type);
7063int psdf_closepath(gx_device_vector * vdev, floatp x0, floatp y0,
7064 floatp x_start, floatp y_start, gx_path_type_t type);
7065
7066
7067
7068
7069typedef struct psdf_binary_writer_s {
7070 gs_memory_t *memory;
7071 stream *target;
7072 stream *strm;
7073 gx_device_psdf *dev;
7074
7075
7076
7077
7078
7079} psdf_binary_writer;
7080extern const gs_memory_struct_type_t st_psdf_binary_writer;
7081
7082
7083
7084
7085
7086
7087
7088int psdf_begin_binary(gx_device_psdf * pdev, psdf_binary_writer * pbw);
7089
7090
7091
7092int psdf_encode_binary(psdf_binary_writer * pbw,
7093 const stream_template * template, stream_state * ss);
7094
7095
7096
7097int psdf_CFE_binary(psdf_binary_writer * pbw, int w, int h, bool invert);
7098
7099
7100
7101
7102
7103
7104
7105int psdf_DCT_filter(gs_param_list *plist ,
7106 stream_state *st,
7107 int Columns, int Rows, int Colors,
7108 psdf_binary_writer *pbw );
7109
7110
7111bool psdf_is_converting_image_to_RGB(const gx_device_psdf * pdev,
7112 const gs_imager_state * pis, const gs_pixel_image_t * pim);
7113
7114
7115
7116
7117
7118int psdf_setup_image_filters(gx_device_psdf *pdev, psdf_binary_writer *pbw,
7119 gs_pixel_image_t *pim, const gs_matrix *pctm,
7120 const gs_imager_state * pis, bool lossless,
7121 bool in_line);
7122
7123
7124
7125
7126int psdf_setup_lossless_filters(gx_device_psdf *pdev, psdf_binary_writer *pbw,
7127 gs_pixel_image_t *pim, bool in_line);
7128
7129
7130int psdf_end_binary(psdf_binary_writer * pbw);
7131
7132
7133int psdf_setup_compression_chooser(psdf_binary_writer *pbw,
7134 gx_device_psdf *pdev,
7135 int width, int height, int depth,
7136 int bits_per_sample);
7137
7138
7139int psdf_setup_image_to_mask_filter(psdf_binary_writer *pbw, gx_device_psdf *pdev,
7140 int width, int height, int depth, int bits_per_sample, uint *MaskColor);
7141
7142
7143int psdf_setup_image_colors_filter(psdf_binary_writer *pbw,
7144 gx_device_psdf *pdev, gs_pixel_image_t * pim,
7145 const gs_imager_state *pis);
7146# 389 "./src/gdevpsdf.h"
7147typedef struct psdf_set_color_commands_s {
7148 const char *setgray;
7149 const char *setrgbcolor;
7150 const char *setcmykcolor;
7151 const char *setcolorspace;
7152 const char *setcolor;
7153 const char *setcolorn;
7154} psdf_set_color_commands_t;
7155
7156extern const psdf_set_color_commands_t
7157 psdf_set_fill_color_commands, psdf_set_stroke_color_commands;
7158
7159
7160
7161
7162
7163gx_color_index psdf_adjust_color_index(gx_device_vector *vdev,
7164 gx_color_index color);
7165
7166
7167int psdf_set_color(gx_device_vector *vdev, const gx_drawing_color *pdc,
7168 const psdf_set_color_commands_t *ppscc);
7169
7170double psdf_round(double v, int precision, int radix);
7171
7172
7173int psdf_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
7174int psdf_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
7175
7176
7177int psdf_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
7178# 28 "./src/gdevpdfx.h" 2
7179# 1 "./src/gxdevmem.h" 1
7180# 21 "./src/gxdevmem.h"
7181# 1 "./src/gxrplane.h" 1
7182# 30 "./src/gxrplane.h"
7183typedef struct gx_render_plane_s {
7184 int depth;
7185 int shift;
7186 int index;
7187} gx_render_plane_t;
7188# 43 "./src/gxrplane.h"
7189int gx_render_plane_init(gx_render_plane_t *render_plane,
7190 const gx_device *dev, int index);
7191# 22 "./src/gxdevmem.h" 2
7192# 76 "./src/gxdevmem.h"
7193typedef struct gx_device_memory_s gx_device_memory;
7194
7195
7196struct gx_device_memory_s {
7197 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target;
7198
7199
7200
7201
7202 uint raster;
7203 byte *base;
7204
7205 gs_memory_t *bitmap_memory;
7206 bool foreign_bits;
7207 gs_memory_t *line_pointer_memory;
7208 bool foreign_line_pointers;
7209
7210
7211
7212
7213
7214 int num_planes;
7215 gx_render_plane_t planes[(8 * 8)];
7216
7217
7218
7219 gs_matrix initial_matrix;
7220 byte **line_ptrs;
7221
7222
7223 gs_const_string palette;
7224
7225 struct _c24 {
7226 gx_color_index rgb;
7227 bits32 rgbr, gbrg, brgb;
7228 } color24;
7229
7230 struct _c40 {
7231 gx_color_index abcde;
7232 bits32 abcd, bcde, cdea, deab, eabc;
7233 } color40;
7234
7235 struct _c48 {
7236 gx_color_index abcdef;
7237 bits32 abcd, cdef, efab;
7238 } color48;
7239
7240 struct _c56 {
7241 gx_color_index abcdefg;
7242 bits32 abcd, bcde, cdef, defg, efga, fgab, gabc;
7243 } color56;
7244
7245 struct _c64 {
7246 gx_color_index abcdefgh;
7247 bits32 abcd, efgh;
7248 } color64;
7249
7250
7251
7252 gs_log2_scale_point log2_scale;
7253 int log2_alpha_bits;
7254 int mapped_x;
7255 int mapped_y;
7256 int mapped_height;
7257 int mapped_start;
7258 gx_color_index save_color;
7259
7260 int plane_depth;
7261};
7262
7263extern const gs_memory_struct_type_t st_device_memory;
7264# 180 "./src/gxdevmem.h"
7265ulong gdev_mem_bits_size(const gx_device_memory *mdev, int width,
7266 int height);
7267
7268ulong gdev_mem_line_ptrs_size(const gx_device_memory *mdev, int width,
7269 int height);
7270
7271ulong gdev_mem_data_size(const gx_device_memory *mdev, int width,
7272 int height);
7273# 196 "./src/gxdevmem.h"
7274int gdev_mem_max_height(const gx_device_memory * dev, int width, ulong size,
7275 bool page_uses_transparency);
7276# 207 "./src/gxdevmem.h"
7277const gx_device_memory *gdev_mem_device_for_bits(int);
7278
7279
7280const gx_device_memory *gdev_mem_word_device_for_bits(int);
7281
7282
7283
7284
7285
7286
7287
7288void gs_make_mem_mono_device(gx_device_memory * mdev, gs_memory_t * mem,
7289 gx_device * target);
7290void gs_make_mem_device(gx_device_memory * mdev,
7291 const gx_device_memory * mdproto,
7292 gs_memory_t * mem, int page_device,
7293 gx_device * target);
7294void gs_make_mem_abuf_device(gx_device_memory * adev, gs_memory_t * mem,
7295 gx_device * target,
7296 const gs_log2_scale_point * pscale,
7297 int alpha_bits, int mapped_x);
7298void gs_make_mem_alpha_device(gx_device_memory * adev, gs_memory_t * mem,
7299 gx_device * target, int alpha_bits);
7300
7301
7302
7303
7304
7305int gdev_mem_open_scan_lines(gx_device_memory *mdev, int setup_height);
7306# 250 "./src/gxdevmem.h"
7307int gdev_mem_set_line_ptrs(gx_device_memory *mdev,
7308 byte *base, int raster, byte **line_ptrs,
7309 int setup_height);
7310
7311
7312void gdev_mem_mono_set_inverted(gx_device_memory * mdev, bool black_is_1);
7313
7314
7315bool gs_device_is_memory(const gx_device *);
7316
7317
7318bool gs_device_is_abuf(const gx_device *);
7319# 29 "./src/gdevpdfx.h" 2
7320
7321
7322
7323
7324
7325typedef struct stream_arcfour_state_s stream_arcfour_state;
7326# 60 "./src/gdevpdfx.h"
7327typedef enum {
7328 PDF_IN_NONE,
7329 PDF_IN_STREAM,
7330 PDF_IN_TEXT,
7331 PDF_IN_STRING
7332} pdf_context_t;
7333
7334
7335
7336
7337
7338
7339
7340typedef struct cos_object_s cos_object_t;
7341typedef struct cos_stream_s cos_stream_t;
7342typedef struct cos_dict_s cos_dict_t;
7343typedef struct cos_array_s cos_array_t;
7344typedef struct cos_value_s cos_value_t;
7345typedef struct cos_object_procs_s cos_object_procs_t;
7346typedef const cos_object_procs_t *cos_type_t;
7347
7348
7349
7350
7351typedef struct pdf_text_state_s pdf_text_state_t;
7352
7353
7354
7355
7356typedef struct pdf_char_glyph_pairs_s pdf_char_glyph_pairs_t;
7357
7358
7359
7360
7361
7362typedef enum {
7363
7364
7365
7366
7367 resourceColorSpace,
7368 resourceExtGState,
7369 resourcePattern,
7370 resourceShading,
7371 resourceXObject,
7372 resourceOther,
7373 resourceFont,
7374
7375
7376
7377 resourceCharProc,
7378 resourceCIDFont,
7379 resourceCMap,
7380 resourceFontDescriptor,
7381 resourceGroup,
7382 resourceSoftMaskDict,
7383 resourceFunction,
7384 resourcePage,
7385 NUM_RESOURCE_TYPES
7386} pdf_resource_type_t;
7387# 155 "./src/gdevpdfx.h"
7388typedef struct pdf_resource_s pdf_resource_t;
7389struct pdf_resource_s {
7390 pdf_resource_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
7391};
7392
7393
7394extern const gs_memory_struct_type_t st_pdf_resource;
7395# 170 "./src/gdevpdfx.h"
7396typedef struct pdf_x_object_s pdf_x_object_t;
7397struct pdf_x_object_s {
7398 pdf_x_object_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
7399 int width, height;
7400 int data_height;
7401};
7402
7403
7404
7405
7406
7407
7408typedef enum {
7409 NoMarks = 0,
7410 ImageB = 1,
7411 ImageC = 2,
7412 ImageI = 4,
7413 Text = 8
7414} pdf_procset_t;
7415
7416
7417
7418
7419typedef struct pdf_char_proc_s pdf_char_proc_t;
7420typedef struct pdf_char_proc_ownership_s pdf_char_proc_ownership_t;
7421typedef struct pdf_font_s pdf_font_t;
7422typedef struct pdf_text_data_s pdf_text_data_t;
7423
7424
7425
7426
7427typedef struct pdf_outline_node_s {
7428 long id, parent_id, prev_id, first_id, last_id;
7429 int count;
7430 cos_dict_t *action;
7431} pdf_outline_node_t;
7432typedef struct pdf_outline_level_s {
7433 pdf_outline_node_t first;
7434 pdf_outline_node_t last;
7435 int left;
7436} pdf_outline_level_t;
7437
7438
7439
7440
7441
7442
7443typedef struct pdf_bead_s {
7444 long id, article_id, prev_id, next_id, page_id;
7445 gs_rect rect;
7446} pdf_bead_t;
7447typedef struct pdf_article_s pdf_article_t;
7448struct pdf_article_s {
7449 pdf_article_t *next;
7450 cos_dict_t *contents;
7451 pdf_bead_t first;
7452 pdf_bead_t last;
7453};
7454# 238 "./src/gdevpdfx.h"
7455typedef struct pdf_resource_list_s {
7456 pdf_resource_t *chains[16];
7457} pdf_resource_list_t;
7458# 249 "./src/gdevpdfx.h"
7459typedef struct pdf_stream_position_s {
7460 long length_id;
7461 long start_pos;
7462} pdf_stream_position_t;
7463
7464
7465
7466
7467
7468
7469typedef struct pdf_text_rotation_s {
7470 long counts[5];
7471 int Rotate;
7472} pdf_text_rotation_t;
7473
7474
7475
7476
7477
7478typedef struct pdf_page_dsc_info_s {
7479 int orientation;
7480 int viewing_orientation;
7481 gs_rect bounding_box;
7482} pdf_page_dsc_info_t;
7483
7484
7485
7486
7487
7488
7489typedef struct pdf_page_s {
7490 cos_dict_t *Page;
7491 gs_point MediaBox;
7492 pdf_procset_t procsets;
7493 long contents_id;
7494 long resource_ids[resourceFont + 1];
7495 long group_id;
7496 cos_array_t *Annots;
7497 pdf_text_rotation_t text_rotation;
7498 pdf_page_dsc_info_t dsc_info;
7499 bool NumCopies_set;
7500 int NumCopies;
7501} pdf_page_t;
7502# 300 "./src/gdevpdfx.h"
7503typedef struct pdf_temp_file_s {
7504 char file_name[260];
7505 FILE *file;
7506 stream *strm;
7507 byte *strm_buf;
7508 stream *save_strm;
7509} pdf_temp_file_t;
7510
7511
7512
7513typedef struct gx_device_pdf_s gx_device_pdf;
7514
7515
7516
7517
7518
7519typedef struct pdf_font_cache_elem_s pdf_font_cache_elem_t;
7520struct pdf_font_cache_elem_s {
7521 pdf_font_cache_elem_t *next;
7522 gs_id font_id;
7523 int num_chars;
7524 int num_widths;
7525 struct pdf_font_resource_s *pdfont;
7526 byte *glyph_usage;
7527 double *real_widths;
7528 gx_device_pdf *pdev;
7529};
7530# 339 "./src/gdevpdfx.h"
7531typedef struct pdf_viewer_state_s {
7532 int transfer_not_identity;
7533 gs_id transfer_ids[4];
7534 float opacity_alpha;
7535 float shape_alpha;
7536 gs_blend_mode_t blend_mode;
7537 gs_id halftone_id;
7538 gs_id black_generation_id;
7539 gs_id undercolor_removal_id;
7540 int overprint_mode;
7541 float smoothness;
7542 float flatness;
7543 bool text_knockout;
7544 bool fill_overprint;
7545 bool stroke_overprint;
7546 bool stroke_adjust;
7547 bool fill_used_process_color;
7548 bool stroke_used_process_color;
7549 gx_hl_saved_color saved_fill_color;
7550 gx_hl_saved_color saved_stroke_color;
7551 gx_line_params line_params;
7552 float dash_pattern[11];
7553 gs_id soft_mask_id;
7554} pdf_viewer_state;
7555
7556
7557
7558
7559
7560typedef struct pdf_substream_save_s {
7561 pdf_context_t context;
7562 pdf_text_state_t *text_state;
7563 gx_path *clip_path;
7564 gs_id clip_path_id;
7565 int vgstack_bottom;
7566 stream *strm;
7567 cos_dict_t *substream_Resources;
7568 pdf_procset_t procsets;
7569 bool skip_colors;
7570 pdf_resource_t *font3;
7571 pdf_resource_t *accumulating_substream_resource;
7572 bool charproc_just_accumulated;
7573 bool accumulating_a_global_object;
7574 pdf_resource_t *pres_soft_mask_dict;
7575 gs_const_string objname;
7576} pdf_substream_save;
7577# 396 "./src/gdevpdfx.h"
7578typedef enum {
7579 pdf_compress_none,
7580 pdf_compress_LZW,
7581 pdf_compress_Flate
7582} pdf_compression_type;
7583
7584
7585
7586struct gx_device_pdf_s {
7587 int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gs_memory_t *v_memory; const gx_device_vector_procs *vec_procs; char fname[(260 - 1) + 1]; FILE *file; stream *strm; byte *strmbuf; uint strmbuf_size; int open_options; gs_imager_state state; float dash_pattern[11]; bool fill_used_process_color; bool stroke_used_process_color; gx_hl_saved_color saved_fill_color; gx_hl_saved_color saved_stroke_color; gs_id no_clip_path_id; gs_id clip_path_id; gx_path_type_t fill_options, stroke_options; gs_point scale; bool in_page; gx_device_bbox *bbox_device; gx_color_index black, white; psdf_version version; bool binary_ok; bool HaveCFF; bool HaveTrueTypes; bool HaveCIDSystem; double ParamCompatibilityLevel; psdf_distiller_params params;
7588
7589 double CompatibilityLevel;
7590 int EndPage;
7591 int StartPage;
7592 bool Optimize;
7593 bool ParseDSCCommentsForDocInfo;
7594 bool ParseDSCComments;
7595 bool EmitDSCWarnings;
7596 bool CreateJobTicket;
7597 bool PreserveEPSInfo;
7598 bool AutoPositionEPSFiles;
7599 bool PreserveCopyPage;
7600 bool UsePrologue;
7601 int OffOptimizations;
7602
7603
7604 gs_param_float_array PDFXTrimBoxToMediaBoxOffset;
7605 gs_param_float_array PDFXBleedBoxToTrimBoxOffset;
7606 bool PDFXSetBleedBoxToMediaBox;
7607
7608 bool ReAssignCharacters;
7609 bool ReEncodeCharacters;
7610 long FirstObjectNumber;
7611 bool CompressFonts;
7612 bool PrintStatistics;
7613 gs_param_string DocumentUUID;
7614 gs_param_string InstanceUUID;
7615 int DocumentTimeSeq;
7616 bool ForOPDFRead;
7617 gs_param_string OPDFReadProcsetPath;
7618 bool CompressEntireFile;
7619 bool ResourcesBeforeUsage;
7620 bool HavePDFWidths;
7621 bool HaveStrokeColor;
7622 bool HaveTransparency;
7623 bool PatternImagemask;
7624
7625 bool PDFX;
7626 bool PDFA;
7627 long MaxClipPathSize;
7628
7629 long MaxViewerMemorySize;
7630 long MaxShadingBitmapSize;
7631
7632
7633 long MaxInlineImageSize;
7634
7635 gs_param_string OwnerPassword;
7636 gs_param_string UserPassword;
7637 uint KeyLength;
7638 uint Permissions;
7639 uint EncryptionR;
7640 gs_param_string NoEncrypt;
7641 bool EncryptMetadata;
7642
7643 bool ComputeDocumentDigest;
7644
7645 byte EncryptionO[32];
7646 byte EncryptionU[32];
7647 byte EncryptionKey[16];
7648 uint EncryptionV;
7649
7650 bool is_EPS;
7651 pdf_page_dsc_info_t doc_dsc_info;
7652 pdf_page_dsc_info_t page_dsc_info;
7653
7654 bool fill_overprint, stroke_overprint;
7655 int overprint_mode;
7656 gs_id halftone_id;
7657 gs_id transfer_ids[4];
7658 int transfer_not_identity;
7659 gs_id black_generation_id, undercolor_removal_id;
7660
7661 pdf_compression_type compression;
7662 pdf_compression_type compression_at_page_start;
7663# 490 "./src/gdevpdfx.h"
7664 pdf_temp_file_t xref;
7665
7666
7667
7668
7669 pdf_temp_file_t asides;
7670
7671
7672
7673
7674
7675
7676
7677 pdf_temp_file_t streams;
7678
7679
7680
7681
7682
7683 pdf_temp_file_t pictures;
7684
7685 long next_id;
7686
7687
7688 cos_dict_t *Catalog;
7689 cos_dict_t *Info;
7690 cos_dict_t *Pages;
7691
7692 long outlines_id;
7693 int next_page;
7694 int max_referred_page;
7695 long contents_id;
7696 pdf_context_t context;
7697 long contents_length_id;
7698 long contents_pos;
7699 pdf_procset_t procsets;
7700 pdf_text_data_t *text;
7701 pdf_text_rotation_t text_rotation;
7702
7703 pdf_page_t *pages;
7704 int num_pages;
7705 ulong used_mask;
7706 pdf_resource_list_t resources[NUM_RESOURCE_TYPES];
7707
7708 pdf_resource_t *cs_Patterns[5];
7709 pdf_resource_t *Identity_ToUnicode_CMaps[2];
7710 pdf_resource_t *last_resource;
7711 pdf_outline_level_t outline_levels[32];
7712 int outline_depth;
7713 int closed_outline_depth;
7714 int outlines_open;
7715 pdf_article_t *articles;
7716 cos_dict_t *Dests;
7717 byte fileID[16];
7718
7719 long uuid_time[2];
7720
7721
7722
7723
7724
7725 cos_dict_t *global_named_objects;
7726
7727
7728
7729 cos_dict_t *local_named_objects;
7730
7731
7732
7733
7734
7735 cos_array_t *NI_stack;
7736
7737
7738
7739
7740
7741
7742 cos_array_t *Namespace_stack;
7743 pdf_font_cache_elem_t *font_cache;
7744
7745
7746
7747
7748 gs_point char_width;
7749
7750
7751
7752
7753 gx_path *clip_path;
7754
7755
7756
7757 cos_array_t *PageLabels;
7758 int PageLabels_current_page;
7759 cos_dict_t *PageLabels_current_label;
7760# 594 "./src/gdevpdfx.h"
7761 gs_text_enum_t *pte;
7762
7763
7764
7765
7766
7767 pdf_viewer_state vgstack[11];
7768 int vgstack_depth;
7769 int vgstack_bottom;
7770 pdf_viewer_state vg_initial;
7771 bool vg_initial_set;
7772
7773
7774 int sbstack_size;
7775 int sbstack_depth;
7776 pdf_substream_save *sbstack;
7777
7778
7779 cos_dict_t *substream_Resources;
7780 gs_color_space_index pcm_color_info_index;
7781 bool skip_colors;
7782 bool AR4_save_bug;
7783 pdf_resource_t *font3;
7784 pdf_resource_t *accumulating_substream_resource;
7785 gs_matrix_fixed charproc_ctm;
7786 bool charproc_just_accumulated;
7787
7788
7789 bool accumulating_a_global_object;
7790
7791
7792
7793
7794 const pdf_char_glyph_pairs_t *cgp;
7795
7796
7797
7798 int substituted_pattern_count;
7799 int substituted_pattern_drop_page;
7800
7801
7802
7803
7804 gs_id image_mask_id;
7805 bool image_mask_is_SMask;
7806 bool image_mask_skip;
7807 gs_matrix converting_image_matrix;
7808 double image_mask_scale;
7809
7810 pdf_resource_t *pres_soft_mask_dict;
7811
7812 gs_const_string objname;
7813 int OPDFRead_procset_length;
7814 void *find_resource_param;
7815};
7816# 695 "./src/gdevpdfx.h"
7817int gdev_pdf_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
7818int gdev_pdf_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
7819int gdev_pdf_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath);
7820int gdev_pdf_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
7821
7822extern const gx_device_vector_procs pdf_vector_procs;
7823int gdev_pdf_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
7824int gdev_pdf_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
7825int gdev_pdf_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
7826
7827int gdev_pdf_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
7828
7829int gdev_pdf_get_params(gx_device *dev, gs_param_list *plist);
7830int gdev_pdf_put_params(gx_device *dev, gs_param_list *plist);
7831
7832int gdev_pdf_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
7833int gdev_pdf_pattern_manage(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function);
7834int gdev_pdf_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
7835
7836int gdev_pdf_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length);
7837
7838int gdev_pdf_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
7839int gdev_pdf_begin_transparency_group(gx_device *dev, const gs_transparency_group_params_t *ptgp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem);
7840int gdev_pdf_end_transparency_group(gx_device *dev, gs_imager_state *pis, gs_transparency_state_t **ppts);
7841int gdev_pdf_begin_transparency_mask(gx_device *dev, const gx_transparency_mask_params_t *ptmp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem);
7842int gdev_pdf_end_transparency_mask(gx_device *dev, gs_transparency_mask_t **pptm);
7843int gdev_pdf_discard_transparency_layer(gx_device *dev, gs_transparency_state_t **ppts);
7844
7845
7846
7847
7848
7849
7850void pdf_initialize_ids(gx_device_pdf * pdev);
7851
7852
7853void pdf_set_process_color_model(gx_device_pdf * pdev, int index);
7854
7855
7856void pdf_reset_text(gx_device_pdf *pdev);
7857
7858
7859
7860
7861
7862
7863int pdf_open_document(gx_device_pdf * pdev);
7864
7865
7866
7867
7868long pdf_obj_ref(gx_device_pdf * pdev);
7869
7870
7871long pdf_stell(gx_device_pdf * pdev);
7872
7873
7874long pdf_open_obj(gx_device_pdf * pdev, long id);
7875long pdf_begin_obj(gx_device_pdf * pdev);
7876
7877
7878int pdf_end_obj(gx_device_pdf * pdev);
7879
7880
7881
7882
7883
7884int pdf_open_contents(gx_device_pdf * pdev, pdf_context_t context);
7885
7886
7887int pdf_close_contents(gx_device_pdf * pdev, bool last);
7888
7889
7890
7891extern const char *const pdf_resource_type_names[];
7892extern const gs_memory_struct_type_t *const pdf_resource_type_structs[];
7893# 781 "./src/gdevpdfx.h"
7894long pdf_open_separate(gx_device_pdf * pdev, long id);
7895long pdf_begin_separate(gx_device_pdf * pdev);
7896
7897
7898void pdf_reserve_object_id(gx_device_pdf * pdev, pdf_resource_t *ppres, long id);
7899
7900
7901int pdf_alloc_aside(gx_device_pdf * pdev, pdf_resource_t ** plist,
7902 const gs_memory_struct_type_t * pst, pdf_resource_t **ppres,
7903 long id);
7904
7905int pdf_begin_aside(gx_device_pdf * pdev, pdf_resource_t **plist,
7906 const gs_memory_struct_type_t * pst,
7907 pdf_resource_t **ppres);
7908
7909
7910int pdf_begin_resource(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7911 gs_id rid, pdf_resource_t **ppres);
7912
7913
7914int pdf_begin_resource_body(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7915 gs_id rid, pdf_resource_t **ppres);
7916
7917
7918int pdf_alloc_resource(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7919 gs_id rid, pdf_resource_t **ppres, long id);
7920
7921
7922int pdf_find_same_resource(gx_device_pdf * pdev,
7923 pdf_resource_type_t rtype, pdf_resource_t **ppres,
7924 int (*eq)(gx_device_pdf * pdev, pdf_resource_t *pres0, pdf_resource_t *pres1));
7925
7926
7927
7928pdf_resource_t *pdf_find_resource_by_resource_id(gx_device_pdf * pdev,
7929 pdf_resource_type_t rtype, gs_id id);
7930
7931
7932pdf_resource_t *pdf_find_resource_by_gs_id(gx_device_pdf * pdev,
7933 pdf_resource_type_t rtype,
7934 gs_id rid);
7935
7936void pdf_drop_resources(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7937 int (*cond)(gx_device_pdf * pdev, pdf_resource_t *pres));
7938
7939
7940void pdf_print_resource_statistics(gx_device_pdf * pdev);
7941
7942
7943
7944int pdf_cancel_resource(gx_device_pdf * pdev, pdf_resource_t *pres,
7945 pdf_resource_type_t rtype);
7946
7947
7948void pdf_forget_resource(gx_device_pdf * pdev, pdf_resource_t *pres1,
7949 pdf_resource_type_t rtype);
7950
7951
7952int pdf_substitute_resource(gx_device_pdf *pdev, pdf_resource_t **ppres,
7953 pdf_resource_type_t rtype,
7954 int (*eq)(gx_device_pdf *pdev, pdf_resource_t *pres0, pdf_resource_t *pres1),
7955 bool write);
7956
7957
7958long pdf_resource_id(const pdf_resource_t *pres);
7959
7960
7961int pdf_end_separate(gx_device_pdf * pdev);
7962
7963
7964int pdf_end_aside(gx_device_pdf * pdev);
7965
7966
7967int pdf_end_resource(gx_device_pdf * pdev);
7968
7969
7970
7971
7972int pdf_write_resource_objects(gx_device_pdf *pdev, pdf_resource_type_t rtype);
7973
7974
7975
7976
7977
7978
7979void pdf_reverse_resource_chain(gx_device_pdf *pdev, pdf_resource_type_t rtype);
7980
7981
7982
7983
7984int pdf_free_resource_objects(gx_device_pdf *pdev, pdf_resource_type_t rtype);
7985
7986
7987
7988int pdf_write_and_free_all_resource_objects(gx_device_pdf *pdev);
7989
7990
7991
7992
7993
7994int pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page);
7995
7996
7997void pdf_copy_data(stream *s, FILE *file, long count, stream_arcfour_state *ss);
7998void pdf_copy_data_safe(stream *s, FILE *file, long position, long count);
7999
8000
8001int pdf_begin_encrypt(gx_device_pdf * pdev, stream **s, gs_id object_id);
8002
8003void pdf_end_encrypt(gx_device_pdf * pdev);
8004
8005int pdf_encrypt_init(const gx_device_pdf * pdev, gs_id object_id, stream_arcfour_state *psarc4);
8006
8007
8008
8009
8010
8011
8012long pdf_page_id(gx_device_pdf * pdev, int page_num);
8013
8014
8015pdf_page_t *pdf_current_page(gx_device_pdf *pdev);
8016
8017
8018cos_dict_t *pdf_current_page_dict(gx_device_pdf *pdev);
8019
8020
8021int pdf_open_page(gx_device_pdf * pdev, pdf_context_t context);
8022
8023
8024int pdf_unclip(gx_device_pdf * pdev);
8025
8026
8027int pdf_write_saved_string(gx_device_pdf * pdev, gs_string * pstr);
8028
8029
8030
8031
8032int pdf_remember_clip_path(gx_device_pdf * pdev, const gx_clip_path * pcpath);
8033
8034
8035bool pdf_must_put_clip_path(gx_device_pdf * pdev, const gx_clip_path * pcpath);
8036
8037
8038int pdf_put_clip_path(gx_device_pdf * pdev, const gx_clip_path * pcpath);
8039
8040
8041
8042typedef struct pdf_lcvd_s {
8043 gx_device_memory mdev;
8044 gx_device_memory *mask;
8045 gx_device_pdf *pdev;
8046 int (*std_fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
8047 int (*std_close_device)(gx_device *dev);
8048 bool mask_is_empty;
8049 bool path_is_empty;
8050 bool mask_is_clean;
8051 bool write_matrix;
8052 bool has_background;
8053 gs_matrix m;
8054 gs_point path_offset;
8055} pdf_lcvd_t;
8056# 951 "./src/gdevpdfx.h"
8057int pdf_setup_masked_image_converter(gx_device_pdf *pdev, gs_memory_t *mem, const gs_matrix *m, pdf_lcvd_t **pcvd,
8058 bool need_mask, int x, int y, int w, int h, bool write_on_close);
8059int pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd);
8060void pdf_remove_masked_image_converter(gx_device_pdf *pdev, pdf_lcvd_t *cvd, bool need_mask);
8061
8062
8063
8064
8065
8066
8067void pdf_store_default_Producer(char buf[200]);
8068
8069
8070typedef struct pdf_filter_names_s {
8071 const char *ASCII85Decode;
8072 const char *ASCIIHexDecode;
8073 const char *CCITTFaxDecode;
8074 const char *DCTDecode;
8075 const char *DecodeParms;
8076 const char *Filter;
8077 const char *FlateDecode;
8078 const char *LZWDecode;
8079 const char *RunLengthDecode;
8080 const char *JBIG2Decode;
8081 const char *JPXDecode;
8082} pdf_filter_names_t;
8083# 985 "./src/gdevpdfx.h"
8084void pdf_put_matrix(gx_device_pdf *pdev, const char *before,
8085 const gs_matrix *pmat, const char *after);
8086
8087
8088typedef int (*pdf_put_name_chars_proc_t)(stream *, const byte *, uint);
8089pdf_put_name_chars_proc_t
8090 pdf_put_name_chars_proc(const gx_device_pdf *pdev);
8091int pdf_put_name_chars(const gx_device_pdf *pdev, const byte *nstr,
8092 uint size);
8093int pdf_put_name(const gx_device_pdf *pdev, const byte *nstr, uint size);
8094
8095
8096int pdf_put_string(const gx_device_pdf *pdev, const byte *str, uint size);
8097
8098
8099int pdf_write_value(const gx_device_pdf *pdev, const byte *vstr, uint size, gs_id object_id);
8100
8101
8102int pdf_put_filters(cos_dict_t *pcd, gx_device_pdf *pdev, stream *s,
8103 const pdf_filter_names_t *pfn);
8104
8105
8106typedef struct pdf_data_writer_s {
8107 psdf_binary_writer binary;
8108 long start;
8109 long length_pos;
8110 pdf_resource_t *pres;
8111 gx_device_pdf *pdev;
8112 long length_id;
8113 bool encrypted;
8114} pdf_data_writer_t;
8115# 1025 "./src/gdevpdfx.h"
8116int pdf_begin_data_stream(gx_device_pdf *pdev, pdf_data_writer_t *pdw,
8117 int options, gs_id object_id);
8118int pdf_append_data_stream_filters(gx_device_pdf *pdev, pdf_data_writer_t *pdw,
8119 int orig_options, gs_id object_id);
8120
8121int pdf_begin_data(gx_device_pdf *pdev, pdf_data_writer_t *pdw);
8122
8123
8124int pdf_end_data(pdf_data_writer_t *pdw);
8125# 1051 "./src/gdevpdfx.h"
8126int pdf_function(gx_device_pdf *pdev, const gs_function_t *pfn,
8127 cos_value_t *pvalue);
8128int pdf_function_scaled(gx_device_pdf *pdev, const gs_function_t *pfn,
8129 const gs_range_t *pranges, cos_value_t *pvalue);
8130
8131
8132int pdf_write_function(gx_device_pdf *pdev, const gs_function_t *pfn,
8133 long *pid);
8134
8135
8136
8137
8138int pdf_write_font_bbox(gx_device_pdf *pdev, const gs_int_rect *pbox);
8139# 1076 "./src/gdevpdfx.h"
8140bool pdf_key_eq(const gs_param_string * pcs, const char *str);
8141
8142
8143int pdfmark_scan_int(const gs_param_string * pstr, int *pvalue);
8144
8145
8146int pdfmark_process(gx_device_pdf * pdev, const gs_param_string_array * pma);
8147
8148
8149int pdfmark_close_outline(gx_device_pdf * pdev);
8150
8151
8152int pdfmark_end_pagelabels(gx_device_pdf * pdev);
8153
8154
8155int pdfmark_write_article(gx_device_pdf * pdev, const pdf_article_t * part);
8156
8157
8158
8159
8160bool pdf_objname_is_valid(const byte *data, uint size);
8161
8162
8163
8164
8165
8166int pdf_find_named(gx_device_pdf * pdev, const gs_param_string * pname,
8167 cos_object_t **ppco);
8168
8169
8170
8171
8172
8173int pdf_create_named(gx_device_pdf *pdev, const gs_param_string *pname,
8174 cos_type_t cotype, cos_object_t **ppco, long id);
8175int pdf_create_named_dict(gx_device_pdf *pdev, const gs_param_string *pname,
8176 cos_dict_t **ppcd, long id);
8177
8178
8179
8180
8181
8182
8183
8184int pdf_refer_named(gx_device_pdf *pdev, const gs_param_string *pname,
8185 cos_object_t **ppco);
8186# 1130 "./src/gdevpdfx.h"
8187int pdf_make_named(gx_device_pdf * pdev, const gs_param_string * pname,
8188 cos_type_t cotype, cos_object_t **ppco, bool assign_id);
8189int pdf_make_named_dict(gx_device_pdf * pdev, const gs_param_string * pname,
8190 cos_dict_t **ppcd, bool assign_id);
8191
8192
8193
8194
8195
8196
8197int pdf_get_named(gx_device_pdf * pdev, const gs_param_string * pname,
8198 cos_type_t cotype, cos_object_t **ppco);
8199
8200
8201
8202
8203
8204int pdf_push_namespace(gx_device_pdf *pdev);
8205
8206
8207
8208
8209
8210int pdf_pop_namespace(gx_device_pdf *pdev);
8211
8212
8213
8214
8215
8216
8217
8218int pdf_scan_token(const byte **pscan, const byte * end, const byte **ptoken);
8219
8220
8221
8222
8223
8224int pdf_scan_token_composite(const byte **pscan, const byte * end,
8225 const byte **ptoken);
8226
8227
8228int pdf_replace_names(gx_device_pdf *pdev, const gs_param_string *from,
8229 gs_param_string *to);
8230# 1184 "./src/gdevpdfx.h"
8231int pdf_close_text_document(gx_device_pdf *pdev);
8232
8233
8234
8235
8236
8237pdf_text_data_t *pdf_text_data_alloc(gs_memory_t *mem);
8238void pdf_set_text_state_default(pdf_text_state_t *pts);
8239void pdf_text_state_copy(pdf_text_state_t *pts_to, pdf_text_state_t *pts_from);
8240void pdf_reset_text_page(pdf_text_data_t *ptd);
8241void pdf_reset_text_state(pdf_text_data_t *ptd);
8242void pdf_close_text_page(gx_device_pdf *pdev);
8243int pdf_get_stoted_text_size(pdf_text_state_t *state);
8244
8245
8246
8247int pdf_char_image_y_offset(const gx_device_pdf *pdev, int x, int y, int h);
8248
8249
8250int pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
8251 int y_offset, gs_id id, pdf_char_proc_t **ppcp,
8252 pdf_stream_position_t * ppos);
8253
8254
8255int pdf_end_char_proc(gx_device_pdf * pdev, pdf_stream_position_t * ppos);
8256
8257
8258int pdf_do_char_image(gx_device_pdf * pdev, const pdf_char_proc_t * pcp,
8259 const gs_matrix * pimat);
8260
8261
8262int pdf_start_charproc_accum(gx_device_pdf *pdev);
8263
8264int pdf_set_charproc_attrs(gx_device_pdf *pdev, gs_font *font, const double *pw, int narg,
8265 gs_text_cache_control_t control, gs_char ch);
8266
8267int pdf_end_charproc_accum(gx_device_pdf *pdev, gs_font *font, const pdf_char_glyph_pairs_t *cgp,
8268 gs_glyph glyph, gs_char output_char_code, const gs_const_string *gnstr);
8269
8270int pdf_open_aside(gx_device_pdf *pdev, pdf_resource_type_t rtype,
8271 gs_id id, pdf_resource_t **ppres, bool reserve_object_id, int options);
8272
8273
8274int pdf_close_aside(gx_device_pdf *pdev);
8275
8276
8277int pdf_enter_substream(gx_device_pdf *pdev, pdf_resource_type_t rtype,
8278 gs_id id, pdf_resource_t **ppres, bool reserve_object_id, bool compress);
8279
8280
8281int pdf_exit_substream(gx_device_pdf *pdev);
8282
8283int pdf_add_procsets(cos_dict_t *pcd, pdf_procset_t procsets);
8284
8285int pdf_add_resource(gx_device_pdf *pdev, cos_dict_t *pcd, const char *key, pdf_resource_t *pres);
8286
8287
8288
8289
8290int pdf_from_stream_to_text(gx_device_pdf *pdev);
8291int pdf_from_string_to_text(gx_device_pdf *pdev);
8292void pdf_close_text_contents(gx_device_pdf *pdev);
8293# 24 "./src/gdevpdfe.c" 2
8294# 1 "./src/gdevpdfg.h" 1
8295# 24 "./src/gdevpdfg.h"
8296typedef struct pdf_base_font_s pdf_base_font_t;
8297# 35 "./src/gdevpdfg.h"
8298typedef struct pdf_color_space_names_s {
8299 const char *DeviceCMYK;
8300 const char *DeviceGray;
8301 const char *DeviceRGB;
8302 const char *Indexed;
8303} pdf_color_space_names_t;
8304
8305
8306
8307
8308extern const pdf_color_space_names_t
8309 pdf_color_space_names,
8310 pdf_color_space_names_short;
8311# 59 "./src/gdevpdfg.h"
8312typedef struct pdf_color_space_s pdf_color_space_t;
8313struct pdf_color_space_s {
8314 pdf_color_space_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
8315 const gs_range_t *ranges;
8316 uint serialized_size;
8317 byte *serialized;
8318};
8319# 76 "./src/gdevpdfg.h"
8320int pdf_cspace_init_Device(const gs_memory_t *mem, gs_color_space *pcs, int num_components);
8321# 90 "./src/gdevpdfg.h"
8322int pdf_color_space(gx_device_pdf *pdev, cos_value_t *pvalue,
8323 const gs_range_t **ppranges,
8324 const gs_color_space *pcs,
8325 const pdf_color_space_names_t *pcsn,
8326 bool by_name);
8327int pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
8328 const gs_range_t **ppranges,
8329 const gs_color_space *pcs,
8330 const pdf_color_space_names_t *pcsn,
8331 bool by_name, const byte *res_name, int name_length);
8332
8333
8334int pdf_cs_Pattern_colored(gx_device_pdf *pdev, cos_value_t *pvalue);
8335int pdf_cs_Pattern_uncolored(gx_device_pdf *pdev, cos_value_t *pvalue);
8336int pdf_cs_Pattern_uncolored_hl(gx_device_pdf *pdev,
8337 const gs_color_space *pcs, cos_value_t *pvalue);
8338
8339
8340void pdf_color_space_procsets(gx_device_pdf *pdev,
8341 const gs_color_space *pcs);
8342
8343
8344
8345
8346void pdf_viewer_state_from_imager_state(gx_device_pdf * pdev,
8347 const gs_imager_state *pis, const gx_device_color *pdevc);
8348
8349
8350void pdf_prepare_initial_viewer_state(gx_device_pdf * pdev, const gs_imager_state *pis);
8351
8352
8353void pdf_reset_graphics(gx_device_pdf *pdev);
8354
8355
8356void pdf_set_initial_color(gx_device_pdf * pdev, gx_hl_saved_color *saved_fill_color,
8357 gx_hl_saved_color *saved_stroke_color,
8358 bool *fill_used_process_color, bool *stroke_used_process_color);
8359
8360
8361
8362int pdf_set_pure_color(gx_device_pdf * pdev, gx_color_index color,
8363 gx_hl_saved_color * psc,
8364 bool *used_process_color,
8365 const psdf_set_color_commands_t *ppscc);
8366int pdf_set_drawing_color(gx_device_pdf * pdev, const gs_imager_state * pis,
8367 const gx_drawing_color *pdc,
8368 gx_hl_saved_color * psc,
8369 bool *used_process_color,
8370 const psdf_set_color_commands_t *ppscc);
8371
8372
8373
8374
8375int pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_imager_state *pis);
8376int pdf_prepare_drawing(gx_device_pdf *pdev, const gs_imager_state *pis, pdf_resource_t **ppres);
8377int pdf_prepare_fill(gx_device_pdf *pdev, const gs_imager_state *pis);
8378int pdf_prepare_stroke(gx_device_pdf *pdev, const gs_imager_state *pis);
8379int pdf_prepare_image(gx_device_pdf *pdev, const gs_imager_state *pis);
8380int pdf_prepare_imagemask(gx_device_pdf *pdev, const gs_imager_state *pis,
8381 const gx_drawing_color *pdcolor);
8382int pdf_save_viewer_state(gx_device_pdf *pdev, stream *s);
8383int pdf_restore_viewer_state(gx_device_pdf *pdev, stream *s);
8384int pdf_end_gstate(gx_device_pdf *pdev, pdf_resource_t *pres);
8385
8386
8387
8388
8389int pdf_string_to_cos_name(gx_device_pdf *pdev, const byte *str, uint len,
8390 cos_value_t *pvalue);
8391
8392
8393
8394typedef struct pdf_pattern_s pdf_pattern_t;
8395struct pdf_pattern_s {
8396 pdf_pattern_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
8397 pdf_pattern_t *substitute;
8398};
8399
8400
8401
8402
8403
8404
8405pdf_resource_t *pdf_substitute_pattern(pdf_resource_t *pres);
8406
8407
8408
8409
8410
8411
8412
8413typedef struct pdf_image_names_s {
8414 pdf_color_space_names_t color_spaces;
8415 pdf_filter_names_t filter_names;
8416 const char *BitsPerComponent;
8417 const char *ColorSpace;
8418 const char *Decode;
8419 const char *Height;
8420 const char *ImageMask;
8421 const char *Interpolate;
8422 const char *Width;
8423} pdf_image_names_t;
8424
8425
8426
8427
8428
8429extern const pdf_image_names_t pdf_image_names_full, pdf_image_names_short;
8430
8431
8432
8433
8434int pdf_put_image_values(cos_dict_t *pcd, gx_device_pdf *pdev,
8435 const gs_pixel_image_t *pic,
8436 const pdf_image_names_t *pin,
8437 const cos_value_t *pcsvalue);
8438
8439
8440
8441int pdf_put_image_filters(cos_dict_t *pcd, gx_device_pdf *pdev,
8442 const psdf_binary_writer * pbw,
8443 const pdf_image_names_t *pin);
8444# 220 "./src/gdevpdfg.h"
8445void pdf_make_bitmap_matrix(gs_matrix * pmat, int x, int y, int w, int h,
8446 int h_actual);
8447
8448
8449void pdf_put_image_matrix(gx_device_pdf * pdev, const gs_matrix * pmat,
8450 floatp y_scale);
8451
8452
8453int pdf_do_image_by_id(gx_device_pdf * pdev, double scale,
8454 const gs_matrix * pimat, bool in_contents, gs_id id);
8455int pdf_do_image(gx_device_pdf * pdev, const pdf_resource_t * pres,
8456 const gs_matrix * pimat, bool in_contents);
8457
8458
8459
8460
8461typedef struct pdf_image_writer_s {
8462 psdf_binary_writer binary[4];
8463 int alt_writer_count;
8464 const pdf_image_names_t *pin;
8465 pdf_resource_t *pres;
8466 int height;
8467 cos_stream_t *data;
8468 const char *end_string;
8469 cos_dict_t *named;
8470 pdf_resource_t *pres_mask;
8471} pdf_image_writer;
8472extern const gs_memory_struct_type_t st_pdf_image_writer;
8473
8474
8475
8476
8477
8478
8479void pdf_image_writer_init(pdf_image_writer * piw);
8480
8481
8482
8483
8484
8485
8486int pdf_begin_write_image(gx_device_pdf * pdev, pdf_image_writer * piw,
8487 gx_bitmap_id id, int w, int h,
8488 cos_dict_t *pnamed, bool in_line);
8489
8490
8491int pdf_begin_image_data(gx_device_pdf * pdev, pdf_image_writer * piw,
8492 const gs_pixel_image_t * pim,
8493 const cos_value_t *pcsvalue,
8494 int alt_writer_index);
8495
8496
8497int pdf_copy_mask_bits(stream *s, const byte *base, int sourcex,
8498 int raster, int w, int h, byte invert);
8499
8500
8501int pdf_copy_color_bits(stream *s, const byte *base, int sourcex,
8502 int raster, int w, int h, int bytes_per_pixel);
8503
8504
8505int
8506pdf_complete_image_data(gx_device_pdf *pdev, pdf_image_writer *piw, int data_h,
8507 int width, int bits_per_pixel);
8508
8509
8510int pdf_end_image_binary(gx_device_pdf *pdev, pdf_image_writer *piw,
8511 int data_h);
8512
8513
8514
8515
8516
8517int pdf_end_write_image(gx_device_pdf * pdev, pdf_image_writer * piw);
8518
8519
8520
8521
8522int pdf_make_alt_stream(gx_device_pdf * pdev, psdf_binary_writer * piw);
8523
8524
8525
8526
8527int pdf_choose_compression(pdf_image_writer * piw, bool end_binary);
8528
8529
8530int pdf_register_charproc_resource(gx_device_pdf *pdev, gs_id id, pdf_resource_type_t type);
8531
8532
8533
8534
8535int pdf_store_pattern1_params(gx_device_pdf *pdev, pdf_resource_t *pres,
8536 gs_pattern1_instance_t *pinst);
8537
8538
8539int pdf_put_colored_pattern(gx_device_pdf *pdev, const gx_drawing_color *pdc,
8540 const gs_color_space *pcs,
8541 const psdf_set_color_commands_t *ppscc,
8542 bool have_pattern_streams, pdf_resource_t **ppres);
8543
8544
8545int pdf_put_uncolored_pattern(gx_device_pdf *pdev, const gx_drawing_color *pdc,
8546 const gs_color_space *pcs,
8547 const psdf_set_color_commands_t *ppscc,
8548 bool have_pattern_streams, pdf_resource_t **ppres);
8549
8550
8551int pdf_put_pattern2(gx_device_pdf *pdev, const gx_drawing_color *pdc,
8552 const psdf_set_color_commands_t *ppscc,
8553 pdf_resource_t **ppres);
8554
8555
8556
8557
8558
8559int pdf_copy_color_data(gx_device_pdf * pdev, const byte * base, int sourcex,
8560 int raster, gx_bitmap_id id, int x, int y, int w, int h,
8561 gs_image_t *pim, pdf_image_writer *piw,
8562 int for_pattern);
8563
8564
8565
8566
8567
8568
8569int pdf_document_metadata(gx_device_pdf *pdev);
8570int pdf_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
8571 const byte *digest, int digest_length, gs_id *metadata_object_id);
8572# 25 "./src/gdevpdfe.c" 2
8573# 1 "./src/gdevpdfo.h" 1
8574# 59 "./src/gdevpdfo.h"
8575typedef struct cos_element_s cos_element_t;
8576typedef struct cos_stream_piece_s cos_stream_piece_t;
8577
8578
8579
8580
8581
8582 struct cos_object_procs_s {
8583
8584
8585
8586 void (*release)(cos_object_t *pco, client_name_t cname);
8587
8588
8589
8590 int (*write)(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id);
8591
8592
8593
8594 int (*equal)(const cos_object_t *pco0, const cos_object_t *pco1, gx_device_pdf *pdev);
8595
8596} ;
8597# 120 "./src/gdevpdfo.h"
8598struct cos_object_s { const cos_object_procs_t *cos_procs; long id; cos_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8599
8600
8601
8602
8603extern const cos_object_procs_t cos_generic_procs;
8604# 140 "./src/gdevpdfo.h"
8605typedef enum {
8606 COS_VALUE_SCALAR = 0,
8607 COS_VALUE_CONST,
8608 COS_VALUE_OBJECT,
8609 COS_VALUE_RESOURCE
8610} cos_value_type_t;
8611struct cos_value_s {
8612 cos_value_type_t value_type;
8613 union vc_ {
8614 gs_string chars;
8615 cos_object_t *object;
8616 } contents;
8617};
8618# 165 "./src/gdevpdfo.h"
8619typedef struct cos_array_element_s cos_array_element_t;
8620struct cos_array_s { const cos_object_procs_t *cos_procs; long id; cos_array_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8621extern const cos_object_procs_t cos_array_procs;
8622
8623
8624typedef struct cos_dict_element_s cos_dict_element_t;
8625struct cos_dict_s { const cos_object_procs_t *cos_procs; long id; cos_dict_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8626extern const cos_object_procs_t cos_dict_procs;
8627
8628
8629struct cos_stream_s { const cos_object_procs_t *cos_procs; long id; cos_dict_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8630extern const cos_object_procs_t cos_stream_procs;
8631# 188 "./src/gdevpdfo.h"
8632cos_object_t *cos_object_alloc(gx_device_pdf *, client_name_t);
8633cos_array_t *cos_array_alloc(gx_device_pdf *, client_name_t);
8634cos_array_t *cos_array_from_floats(gx_device_pdf *, const float *, uint,
8635 client_name_t);
8636cos_dict_t *cos_dict_alloc(gx_device_pdf *, client_name_t);
8637cos_stream_t *cos_stream_alloc(gx_device_pdf *, client_name_t);
8638
8639
8640gs_memory_t *cos_object_memory(const cos_object_t *);
8641
8642
8643
8644int cos_become(cos_object_t *, cos_type_t);
8645
8646
8647void cos_release(cos_object_t *pco, client_name_t cname);
8648
8649int cos_write(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id);
8650
8651
8652
8653const cos_value_t *cos_string_value(cos_value_t *, const byte *, uint);
8654const cos_value_t *cos_c_string_value(cos_value_t *, const char *);
8655const cos_value_t *cos_object_value(cos_value_t *, cos_object_t *);
8656
8657
8658const cos_value_t *cos_resource_value(cos_value_t *, cos_object_t *);
8659# 227 "./src/gdevpdfo.h"
8660int cos_array_put(cos_array_t *, long, const cos_value_t *);
8661int cos_array_put_no_copy(cos_array_t *, long, const cos_value_t *);
8662int cos_array_add(cos_array_t *, const cos_value_t *);
8663int cos_array_add_no_copy(cos_array_t *, const cos_value_t *);
8664int cos_array_add_c_string(cos_array_t *, const char *);
8665int cos_array_add_int(cos_array_t *, int);
8666int cos_array_add_real(cos_array_t *, floatp);
8667int cos_array_add_object(cos_array_t *, cos_object_t *);
8668
8669int cos_array_unadd(cos_array_t *, cos_value_t *);
8670
8671int cos_dict_put(cos_dict_t *, const byte *, uint, const cos_value_t *);
8672int cos_dict_put_no_copy(cos_dict_t *, const byte *, uint,
8673 const cos_value_t *);
8674int cos_dict_put_c_key(cos_dict_t *, const char *, const cos_value_t *);
8675int cos_dict_put_c_key_string(cos_dict_t *, const char *, const byte *, uint);
8676int cos_dict_put_c_key_int(cos_dict_t *, const char *, int);
8677int cos_dict_put_c_key_bool(cos_dict_t *pcd, const char *key, bool value);
8678int cos_dict_put_c_key_real(cos_dict_t *, const char *, floatp);
8679int cos_dict_put_c_key_floats(cos_dict_t *, const char *, const float *, uint);
8680int cos_dict_put_c_key_object(cos_dict_t *, const char *, cos_object_t *);
8681int cos_dict_put_string(cos_dict_t *, const byte *, uint, const byte *, uint);
8682int cos_dict_put_string_copy(cos_dict_t *pcd, const char *key, const char *value);
8683int cos_dict_put_c_strings(cos_dict_t *, const char *, const char *);
8684
8685int cos_dict_move_all(cos_dict_t *, cos_dict_t *);
8686
8687int cos_stream_add(cos_stream_t *, uint);
8688int cos_stream_add_bytes(cos_stream_t *, const byte *, uint);
8689int cos_stream_add_stream_contents(cos_stream_t *, stream *);
8690int cos_stream_release_pieces(cos_stream_t *pcs);
8691cos_dict_t *cos_stream_dict(cos_stream_t *);
8692# 273 "./src/gdevpdfo.h"
8693const cos_array_element_t *
8694 cos_array_element_first(const cos_array_t *);
8695const cos_array_element_t *
8696 cos_array_element_next(const cos_array_element_t *, long *,
8697 const cos_value_t **);
8698
8699
8700const cos_value_t *cos_dict_find(const cos_dict_t *, const byte *, uint);
8701const cos_value_t *cos_dict_find_c_key(const cos_dict_t *, const char *);
8702
8703int cos_dict_forall(const cos_dict_t *pcd, void *client_data,
8704 int (*proc)(void *client_data, const byte *key_data, uint key_size, const cos_value_t *v));
8705
8706
8707typedef struct cos_param_list_writer_s {
8708 const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
8709 cos_dict_t *pcd;
8710 int print_ok;
8711} cos_param_list_writer_t;
8712int cos_param_list_writer_init(cos_param_list_writer_t *, cos_dict_t *,
8713 int print_ok);
8714
8715
8716
8717stream *cos_write_stream_alloc(cos_stream_t *pcs, gx_device_pdf *pdev,
8718 client_name_t cname);
8719
8720
8721cos_stream_t * cos_stream_from_pipeline(stream *s);
8722
8723stream * cos_write_stream_from_pipeline(stream *s);
8724
8725
8726int cos_value_write(const cos_value_t *, gx_device_pdf *);
8727
8728
8729int cos_dict_elements_write(const cos_dict_t *, gx_device_pdf *);
8730int cos_stream_elements_write(const cos_stream_t *, gx_device_pdf *);
8731int cos_stream_contents_write(const cos_stream_t *, gx_device_pdf *);
8732
8733
8734long cos_stream_length(const cos_stream_t *pcs);
8735
8736
8737
8738int cos_dict_objects_write(const cos_dict_t *, gx_device_pdf *);
8739int cos_dict_objects_delete(cos_dict_t *);
8740
8741
8742int cos_write_object(cos_object_t *pco, gx_device_pdf *pdev);
8743
8744
8745
8746void cos_value_free(const cos_value_t *, const cos_object_t *, client_name_t);
8747
8748
8749void cos_free(cos_object_t *pco, client_name_t cname);
8750# 26 "./src/gdevpdfe.c" 2
8751# 1 "./src/gdevpdtf.h" 1
8752# 20 "./src/gdevpdtf.h"
8753# 1 "./src/gdevpdtx.h" 1
8754# 20 "./src/gdevpdtx.h"
8755# 1 "./src/gdevpdt.h" 1
8756# 38 "./src/gdevpdt.h"
8757pdf_text_state_t *pdf_text_state_alloc(gs_memory_t *mem);
8758
8759
8760
8761
8762pdf_text_data_t *pdf_text_data_alloc(gs_memory_t *mem);
8763
8764
8765
8766
8767void pdf_reset_text_page(pdf_text_data_t *ptd);
8768
8769
8770
8771
8772void pdf_reset_text_state(pdf_text_data_t *ptd);
8773
8774
8775
8776
8777void pdf_close_text_page(gx_device_pdf *pdev);
8778
8779
8780
8781
8782
8783int pdf_close_text_document(gx_device_pdf *pdev);
8784
8785
8786
8787
8788
8789
8790int pdf_from_stream_to_text(gx_device_pdf *pdev);
8791
8792
8793
8794
8795int pdf_from_string_to_text(gx_device_pdf *pdev);
8796
8797
8798
8799
8800void pdf_close_text_contents(gx_device_pdf *pdev);
8801
8802
8803
8804
8805int pdf_char_image_y_offset(const gx_device_pdf *pdev, int x, int y, int h);
8806
8807
8808int pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
8809 int y_offset, gs_id id, pdf_char_proc_t **ppcp,
8810 pdf_stream_position_t * ppos);
8811
8812
8813int pdf_end_char_proc(gx_device_pdf * pdev,
8814 pdf_stream_position_t * ppos);
8815
8816
8817int pdf_do_char_image(gx_device_pdf * pdev, const pdf_char_proc_t * pcp,
8818 const gs_matrix * pimat);
8819# 21 "./src/gdevpdtx.h" 2
8820# 60 "./src/gdevpdtx.h"
8821typedef struct pdf_bitmap_fonts_s pdf_bitmap_fonts_t;
8822
8823
8824
8825typedef struct pdf_outline_fonts_s pdf_outline_fonts_t;
8826
8827
8828
8829
8830
8831
8832
8833struct pdf_text_data_s {
8834 pdf_outline_fonts_t *outline_fonts;
8835 pdf_bitmap_fonts_t *bitmap_fonts;
8836 pdf_text_state_t *text_state;
8837};
8838# 85 "./src/gdevpdtx.h"
8839typedef struct pdf_font_resource_s pdf_font_resource_t;
8840
8841
8842
8843
8844long pdf_font_id(const pdf_font_resource_t *pdfont);
8845
8846int pdf_used_charproc_resources(gx_device_pdf *pdev, pdf_font_resource_t *pdfont);
8847# 21 "./src/gdevpdtf.h" 2
8848# 86 "./src/gdevpdtf.h"
8849typedef struct gs_cmap_s gs_cmap_t;
8850
8851
8852
8853
8854typedef struct gs_font_type0_s gs_font_type0;
8855# 101 "./src/gdevpdtf.h"
8856typedef struct pdf_font_descriptor_s pdf_font_descriptor_t;
8857
8858
8859
8860
8861typedef struct pdf_char_glyph_pair_s pdf_char_glyph_pair_t;
8862
8863
8864struct pdf_char_glyph_pair_s {
8865 gs_char chr;
8866 gs_glyph glyph;
8867};
8868# 126 "./src/gdevpdtf.h"
8869typedef int (*pdf_font_write_contents_proc_t)
8870 (gx_device_pdf *, pdf_font_resource_t *);
8871
8872
8873
8874
8875
8876typedef struct pdf_encoding_element_s {
8877 gs_glyph glyph;
8878 gs_const_string str;
8879 bool is_difference;
8880} pdf_encoding_element_t;
8881# 148 "./src/gdevpdtf.h"
8882struct pdf_base_font_s {
8883# 160 "./src/gdevpdtf.h"
8884 gs_font_base *copied;
8885 gs_font_base *complete;
8886 enum {
8887 DO_SUBSET_UNKNOWN = 0,
8888 DO_SUBSET_NO,
8889 DO_SUBSET_YES
8890 } do_subset;
8891 bool is_standard;
8892
8893
8894
8895
8896
8897
8898 int num_glyphs;
8899 byte *CIDSet;
8900 gs_string font_name;
8901 bool written;
8902 cos_dict_t *FontFile;
8903};
8904# 192 "./src/gdevpdtf.h"
8905typedef struct {
8906 gs_id id;
8907 pdf_resource_type_t type;
8908} pdf_resource_ref_t;
8909
8910
8911
8912
8913
8914
8915
8916struct pdf_font_resource_s {
8917 pdf_font_resource_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
8918 font_type FontType;
8919 pdf_font_write_contents_proc_t write_contents;
8920 gs_string BaseFont;
8921 pdf_font_descriptor_t *FontDescriptor;
8922
8923
8924
8925
8926
8927 pdf_base_font_t *base_font;
8928 uint count;
8929 double *Widths;
8930 byte *used;
8931
8932 pdf_resource_t *res_ToUnicode;
8933 gs_cmap_t *cmap_ToUnicode;
8934 gs_glyph_mark_proc_t mark_glyph;
8935 void *mark_glyph_data;
8936 union {
8937
8938 struct {
8939
8940 pdf_font_resource_t *DescendantFont;
8941
8942
8943
8944
8945
8946 char Encoding_name[(((17) > (sizeof(long) * 8 / 3 + 1 + 4)) ? (17) : (sizeof(long) * 8 / 3 + 1 + 4)) + 1
8947
8948
8949
8950 ];
8951 gs_const_string CMapName;
8952
8953 bool cmap_is_standard;
8954 int WMode;
8955
8956 } type0;
8957
8958 struct {
8959
8960
8961 long CIDSystemInfo_id;
8962 ushort *CIDToGIDMap;
8963 gs_id glyphshow_font_id;
8964 double *Widths2;
8965 double *v;
8966 byte *used2;
8967 pdf_font_resource_t *parent;
8968
8969 } cidfont;
8970
8971 struct {
8972
8973 int FirstChar, LastChar;
8974
8975
8976
8977
8978 gs_encoding_index_t BaseEncoding;
8979 pdf_encoding_element_t *Encoding;
8980 gs_point *v;
8981
8982 union {
8983
8984 struct {
8985 bool is_MM_instance;
8986 } type1;
8987
8988 struct {
8989
8990
8991
8992
8993 int _dummy;
8994 } truetype;
8995
8996 struct {
8997 gs_int_rect FontBBox;
8998 gs_matrix FontMatrix;
8999 pdf_char_proc_ownership_t *char_procs;
9000 int max_y_offset;
9001 bool bitmap_font;
9002 cos_dict_t *Resources;
9003 byte *cached;
9004 } type3;
9005
9006 } s;
9007
9008 } simple;
9009
9010 } u;
9011};
9012# 308 "./src/gdevpdtf.h"
9013typedef enum {
9014 FONT_EMBED_STANDARD,
9015 FONT_EMBED_NO,
9016 FONT_EMBED_YES
9017} pdf_font_embed_t;
9018# 322 "./src/gdevpdtf.h"
9019typedef struct pdf_standard_font_s {
9020 pdf_font_resource_t *pdfont;
9021 gs_matrix orig_matrix;
9022} pdf_standard_font_t;
9023# 343 "./src/gdevpdtf.h"
9024struct pdf_outline_fonts_s {
9025 pdf_standard_font_t *standard_fonts;
9026};
9027# 358 "./src/gdevpdtf.h"
9028pdf_outline_fonts_t *pdf_outline_fonts_alloc(gs_memory_t *mem);
9029
9030
9031
9032
9033pdf_standard_font_t *pdf_standard_fonts(const gx_device_pdf *pdev);
9034
9035
9036
9037
9038void pdf_clean_standard_fonts(const gx_device_pdf *pdev);
9039
9040
9041int pdf_free_font_cache(gx_device_pdf *pdev);
9042
9043
9044
9045
9046int pdf_font_type0_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9047 gs_id rid, pdf_font_resource_t *DescendantFont,
9048 const gs_const_string *CMapName);
9049int pdf_font_type3_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9050 pdf_font_write_contents_proc_t write_contents);
9051int pdf_font_std_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9052 bool is_original, gs_id rid, gs_font_base *pfont, int index);
9053int pdf_font_simple_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9054 gs_id rid, pdf_font_descriptor_t *pfd);
9055int pdf_font_cidfont_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9056 gs_id rid, pdf_font_descriptor_t *pfd);
9057int pdf_obtain_cidfont_widths_arrays(gx_device_pdf *pdev, pdf_font_resource_t *pdfont,
9058 int wmode, double **w, double **w0, double **v);
9059int font_resource_encoded_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9060 gs_id rid, font_type ftype,
9061 pdf_font_write_contents_proc_t write_contents);
9062int pdf_assign_font_object_id(gx_device_pdf *pdev, pdf_font_resource_t *pdfont);
9063
9064
9065int pdf_resize_resource_arrays(gx_device_pdf *pdev, pdf_font_resource_t *pfres,
9066 int chars_count);
9067
9068
9069
9070
9071
9072
9073gs_font_base *pdf_font_resource_font(const pdf_font_resource_t *pdfont, bool complete);
9074
9075
9076
9077
9078
9079
9080
9081pdf_font_embed_t pdf_font_embed_status(gx_device_pdf *pdev, gs_font *font,
9082 int *pindex,
9083 pdf_char_glyph_pair_t *pairs, int num_glyphs);
9084
9085
9086
9087
9088
9089int pdf_compute_BaseFont(gx_device_pdf *pdev, pdf_font_resource_t *pdfont, bool finish);
9090
9091
9092
9093
9094
9095int pdf_close_text_document(gx_device_pdf *pdev);
9096
9097
9098
9099
9100const gs_font_name *pdf_choose_font_name(gs_font *font, bool key_name);
9101
9102
9103
9104
9105
9106
9107int pdf_cmap_alloc(gx_device_pdf *pdev, const gs_cmap_t *pcmap,
9108 pdf_resource_t **ppres , int font_index_only);
9109
9110
9111
9112
9113int pdf_font_add_cid_to_gid(pdf_font_resource_t *pdfont, uint cid, uint gid);
9114# 27 "./src/gdevpdfe.c" 2
9115
9116
9117static void
9118pdf_xml_data_write(stream *s, const byte *data, int data_length)
9119{
9120 int l = data_length;
9121 const byte *p = data;
9122
9123 for (; l--; p++) {
9124 switch (*p) {
9125 case '<' : stream_puts(s, "&lt;"); break;
9126 case '>' : stream_puts(s, "&gt;"); break;
9127 case '&' : stream_puts(s, "&amp;"); break;
9128 case '\'': stream_puts(s, "&apos;"); break;
9129 case '"' : stream_puts(s, "&quot;"); break;
9130 default:
9131 if (*p < 32 || *p > 127)
9132 pprintd1(s, "&#%d;", *p);
9133 else
9134 spputc(s, *p);
9135 }
9136 }
9137}
9138
9139
9140static __inline__ void
9141pdf_xml_string_write(stream *s, const char *data)
9142{
9143 pdf_xml_data_write(s, (const byte *)data, strlen(data));
9144}
9145
9146
9147static __inline__ void
9148pdf_xml_tag_open_beg(stream *s, const char *data)
9149{
9150 spputc(s, '<');
9151 stream_puts(s, data);
9152}
9153
9154
9155static __inline__ void
9156pdf_xml_tag_end(stream *s)
9157{
9158 spputc(s, '>');
9159}
9160
9161
9162static __inline__ void
9163pdf_xml_tag_end_empty(stream *s)
9164{
9165 stream_puts(s, "/>");
9166}
9167
9168
9169static __inline__ void
9170pdf_xml_tag_open(stream *s, const char *data)
9171{
9172 spputc(s, '<');
9173 stream_puts(s, data);
9174 spputc(s, '>');
9175}
9176
9177
9178static __inline__ void
9179pdf_xml_tag_close(stream *s, const char *data)
9180{
9181 stream_puts(s, "</");
9182 stream_puts(s, data);
9183 spputc(s, '>');
9184}
9185
9186
9187static __inline__ void
9188pdf_xml_attribute_name(stream *s, const char *data)
9189{
9190 spputc(s, ' ');
9191 stream_puts(s, data);
9192 spputc(s, '=');
9193}
9194
9195
9196static __inline__ void
9197pdf_xml_attribute_value(stream *s, const char *data)
9198{
9199 spputc(s, '\'');
9200 pdf_xml_string_write(s, data);
9201 spputc(s, '\'');
9202}
9203
9204static __inline__ void
9205pdf_xml_attribute_value_data(stream *s, const byte *data, int data_length)
9206{
9207 spputc(s, '\'');
9208 pdf_xml_data_write(s, data, data_length);
9209 spputc(s, '\'');
9210}
9211
9212
9213static __inline__ void
9214pdf_xml_ins_beg(stream *s, const char *data)
9215{
9216 stream_puts(s, "<?");
9217 stream_puts(s, data);
9218}
9219
9220
9221static __inline__ void
9222pdf_xml_ins_end(stream *s)
9223{
9224 stream_puts(s, "?>");
9225}
9226
9227
9228static __inline__ void
9229pdf_xml_newline(stream *s)
9230{
9231 stream_puts(s, "\n");
9232}
9233
9234
9235static __inline__ void
9236pdf_xml_copy(stream *s, const char *data)
9237{
9238 stream_puts(s, data);
9239}
9240
9241
9242
9243
9244static void
9245pdf_xmp_time(char *buf, int buf_length)
9246{
9247
9248 struct tm tms;
9249 time_t t;
9250 char buf1[4+1+2+1+2+1];
9251
9252 time(&t);
9253 tms = *localtime(&t);
9254 sprintf(buf1,
9255 "%04d-%02d-%02d",
9256 tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday);
9257 strncpy(buf, buf1, buf_length);
9258}
9259
9260static void
9261pdf_xmp_write_docinfo_item(gx_device_pdf *pdev, stream *s, const char *key, const char *default_value,
9262 void(*write)(stream *s, const byte *data, int data_length))
9263{
9264 const cos_value_t *v = cos_dict_find(pdev->Info, (const byte *)key, strlen(key));
9265
9266 if (v != ((void *)0) && (v->value_type == COS_VALUE_SCALAR ||
9267 v->value_type == COS_VALUE_CONST)) {
9268 if (v->contents.chars.size > 2 && v->contents.chars.data[0] == '(')
9269 write(s, v->contents.chars.data + 1, v->contents.chars.size - 2);
9270 else
9271 write(s, v->contents.chars.data, v->contents.chars.size);
9272 } else
9273 stream_puts(s, default_value);
9274}
9275
9276static uint64_t
9277pdf_uuid_time(gx_device_pdf *pdev)
9278{
9279 long *dt = pdev->uuid_time;
9280 uint64_t t;
9281
9282
9283 t = (uint64_t)10000000 * dt[0] + dt[0] / 100;
9284 t += (uint64_t) (1000*1000*10)
9285 * (uint64_t) (60 * 60 * 24)
9286 * (uint64_t) (17+30+31+365*397+99);
9287 return t;
9288}
9289
9290static void writehex(char **p, ulong v, int l)
9291{
9292 int i = l * 2;
9293 static const char digit[] = "0123456789abcdef";
9294
9295 for (; i--;)
9296 *((*p)++) = digit[v >> (i * 4) & 15];
9297}
9298
9299static void
9300pdf_make_uuid(const byte node[6], uint64_t uuid_time, ulong time_seq, char *buf, int buf_length)
9301{
9302 char b[40], *p = b;
9303 ulong uuid_time_lo = (ulong)(uuid_time & 0xFFFFFFFF);
9304 ushort uuid_time_md = (ushort)((uuid_time >> 32) & 0xFFFF);
9305 ushort uuid_time_hi = (ushort)((uuid_time >> 48) & 0x0FFF);
9306
9307 writehex(&p, uuid_time_lo, 4);
9308 *(p++) = '-';
9309 writehex(&p, uuid_time_md, 2);
9310 *(p++) = '-';
9311 writehex(&p, uuid_time_hi | (ushort)(1 << 12), 2);
9312 *(p++) = '-';
9313 writehex(&p, (time_seq & 0x3F00) >> 8, 1);
9314 writehex(&p, time_seq & 0xFF, 1);
9315 *(p++) = '-';
9316 writehex(&p, node[0], 1);
9317 writehex(&p, node[1], 1);
9318 writehex(&p, node[2], 1);
9319 writehex(&p, node[3], 1);
9320 writehex(&p, node[4], 1);
9321 writehex(&p, node[5], 1);
9322 *p = 0;
9323 strncpy(buf, b, buf_length);
9324}
9325
9326static int
9327pdf_make_instance_uuid(gx_device_pdf *pdev, const byte digest[6], char *buf, int buf_length)
9328{
9329 if (pdev->InstanceUUID.size) {
9330 int l = (((buf_length - 1) < (pdev->InstanceUUID.size)) ? (buf_length - 1) : (pdev->InstanceUUID.size));
9331
9332 memcpy(buf, pdev->InstanceUUID.data, l);
9333 buf[l] = 0;
9334 } else
9335 pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, buf, buf_length);
9336 return 0;
9337}
9338
9339static int
9340pdf_make_document_uuid(gx_device_pdf *pdev, const byte digest[6], char *buf, int buf_length)
9341{
9342 if (pdev->DocumentUUID.size) {
9343 int l = (((buf_length - 1) < (pdev->DocumentUUID.size)) ? (buf_length - 1) : (pdev->DocumentUUID.size));
9344
9345 memcpy(buf, pdev->DocumentUUID.data, l);
9346 buf[l] = 0;
9347 } else
9348 pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, buf, buf_length);
9349 return 0;
9350}
9351
9352static char dd[]={'\'', 0xEF, 0xBB, 0xBF, '\'', 0};
9353
9354
9355
9356
9357static int
9358pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
9359{
9360 char instance_uuid[40], document_uuid[40], date_time[40];
9361 int code;
9362 stream *s = pdev->strm;
9363
9364 code = pdf_make_instance_uuid(pdev, digest, instance_uuid, sizeof(instance_uuid));
9365 if (code < 0)
9366 return code;
9367 code = pdf_make_document_uuid(pdev, digest, document_uuid, sizeof(document_uuid));
9368 if (code < 0)
9369 return code;
9370 pdf_xmp_time(date_time, sizeof(date_time));
9371 pdf_xml_ins_beg(s, "xpacket");
9372 pdf_xml_attribute_name(s, "begin");
9373 pdf_xml_copy(s, dd);
9374 pdf_xml_attribute_name(s, "id");
9375 pdf_xml_attribute_value(s, "W5M0MpCehiHzreSzNTczkc9d");
9376 pdf_xml_ins_end(s);
9377 pdf_xml_newline(s);
9378
9379 pdf_xml_copy(s, "<?adobe-xap-filters esc=\"CRLF\"?>\n");
9380 pdf_xml_copy(s, "<x:xmpmeta xmlns:x='adobe:ns:meta/'"
9381 " x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>\n");
9382 {
9383 pdf_xml_copy(s, "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' "
9384 "xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n");
9385 {
9386
9387 pdf_xml_tag_open_beg(s, "rdf:Description");
9388 pdf_xml_attribute_name(s, "rdf:about");
9389 pdf_xml_attribute_value(s, instance_uuid);
9390 pdf_xml_attribute_name(s, "xmlns:pdf");
9391 pdf_xml_attribute_value(s, "http://ns.adobe.com/pdf/1.3/");
9392 pdf_xml_attribute_name(s, "pdf:Producer");
9393 pdf_xmp_write_docinfo_item(pdev, s, "/Producer", "UnknownProduicer",
9394 pdf_xml_attribute_value_data);
9395 pdf_xml_tag_end_empty(s);
9396 pdf_xml_newline(s);
9397
9398 pdf_xml_tag_open_beg(s, "rdf:Description");
9399 pdf_xml_attribute_name(s, "rdf:about");
9400 pdf_xml_attribute_value(s, instance_uuid);
9401 pdf_xml_attribute_name(s, "xmlns:xap");
9402 pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
9403 pdf_xml_attribute_name(s, "xap:ModifyDate");
9404 pdf_xml_attribute_value(s, date_time);
9405 pdf_xml_attribute_name(s, "xap:CreateDate");
9406 pdf_xml_attribute_value(s, date_time);
9407 pdf_xml_tag_end(s);
9408 {
9409 pdf_xml_tag_open_beg(s, "xap:CreatorTool");
9410 pdf_xml_tag_end(s);
9411 {
9412 char buf[10];
9413
9414 sprintf(buf, "%d.%02d", (int)(gs_revision / 100), (int)(gs_revision % 100));
9415 pdf_xml_string_write(s, gs_product);
9416 pdf_xml_string_write(s, " ");
9417 pdf_xml_string_write(s, buf);
9418 pdf_xml_string_write(s, " PDF Writer");
9419 }
9420 pdf_xml_tag_close(s, "xap:CreatorTool");
9421 }
9422 pdf_xml_tag_close(s, "rdf:Description");
9423 pdf_xml_newline(s);
9424
9425 pdf_xml_tag_open_beg(s, "rdf:Description");
9426 pdf_xml_attribute_name(s, "rdf:about");
9427 pdf_xml_attribute_value(s, instance_uuid);
9428 pdf_xml_attribute_name(s, "xmlns:xapMM");
9429 pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
9430 pdf_xml_attribute_name(s, "xapMM:DocumentID");
9431 pdf_xml_attribute_value(s, document_uuid);
9432 pdf_xml_tag_end_empty(s);
9433 pdf_xml_newline(s);
9434
9435 pdf_xml_tag_open_beg(s, "rdf:Description");
9436 pdf_xml_attribute_name(s, "rdf:about");
9437 pdf_xml_attribute_value(s, instance_uuid);
9438 pdf_xml_attribute_name(s, "xmlns:dc");
9439 pdf_xml_attribute_value(s, "http://purl.org/dc/elements/1.1/");
9440 pdf_xml_attribute_name(s, "dc:format");
9441 pdf_xml_attribute_value(s,"application/pdf");
9442 pdf_xml_tag_end(s);
9443 {
9444 pdf_xml_tag_open(s, "dc:title");
9445 {
9446 pdf_xml_tag_open(s, "rdf:Alt");
9447 {
9448 pdf_xml_tag_open_beg(s, "rdf:li");
9449 pdf_xml_attribute_name(s, "xml:lang");
9450 pdf_xml_attribute_value(s, "x-default");
9451 pdf_xml_tag_end(s);
9452 {
9453 pdf_xmp_write_docinfo_item(pdev, s, "/Title", "Untitled",
9454 pdf_xml_data_write);
9455 }
9456 pdf_xml_tag_close(s, "rdf:li");
9457 }
9458 pdf_xml_tag_close(s, "rdf:Alt");
9459 }
9460 pdf_xml_tag_close(s, "dc:title");
9461
9462 if (cos_dict_find(pdev->Info, (const byte *)"/Author", 7)) {
9463 pdf_xml_tag_open(s, "dc:creator");
9464 {
9465
9466
9467
9468 pdf_xml_tag_open(s, "rdf:Seq");
9469 {
9470 pdf_xml_tag_open(s, "rdf:li");
9471 {
9472 pdf_xmp_write_docinfo_item(pdev, s, "/Author", "Unknown",
9473 pdf_xml_data_write);
9474 }
9475 pdf_xml_tag_close(s, "rdf:li");
9476 }
9477 pdf_xml_tag_close(s, "rdf:Seq");
9478 }
9479 pdf_xml_tag_close(s, "dc:creator");
9480 }
9481 }
9482 pdf_xml_tag_close(s, "rdf:Description");
9483 pdf_xml_newline(s);
9484 }
9485 pdf_xml_copy(s, "</rdf:RDF>\n");
9486 }
9487 pdf_xml_copy(s, "</x:xmpmeta>\n");
9488
9489 pdf_xml_copy(s, " \n");
9490 pdf_xml_copy(s, " \n");
9491 pdf_xml_copy(s, "<?xpacket end='w'?>");
9492 return 0;
9493}
9494
9495int
9496pdf_document_metadata(gx_device_pdf *pdev)
9497{
9498 if (pdev->CompatibilityLevel < 1.4)
9499 return 0;
9500 if (pdev->ParseDSCCommentsForDocInfo || pdev->PreserveEPSInfo) {
9501 pdf_resource_t *pres;
9502 char buf[20];
9503 byte digest[6];
9504 int code;
9505 int options = 0;
9506
9507 (*(pdev->strm)->procs.flush)(pdev->strm);
9508 s_MD5C_get_digest(pdev->strm, digest, sizeof(digest));
9509 if (pdev->EncryptMetadata)
9510 options |= 8;
9511 code = pdf_open_aside(pdev, resourceOther, 0L, &pres, ((bool)1), options);
9512 if (code < 0)
9513 return code;
9514 code = pdf_write_document_metadata(pdev, digest);
9515 if (code < 0)
9516 return code;
9517 code = pdf_close_aside(pdev);
9518 if (code < 0)
9519 return code;
9520 code = cos_write_object(((cos_object_t *)&((pres->object)->cos_procs)), pdev);
9521 if (code < 0)
9522 return code;
9523 sprintf(buf, "%ld 0 R", pres->object->id);
9524 cos_dict_put_c_key_object(pdev->Catalog, "/Metadata", pres->object);
9525 }
9526 return 0;
9527}
9528
9529
9530
9531
9532static int
9533pdf_write_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
9534 const byte *digest, int digest_length)
9535{
9536 char instance_uuid[40];
9537 int code;
9538 stream *s = pdev->strm;
9539 gs_font_info_t info;
9540 gs_font_base *pfont = pbfont->complete;
9541
9542 if (pfont == ((void *)0))
9543 pfont = pbfont->copied;
9544
9545 pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, instance_uuid, sizeof(instance_uuid));
9546 code = pfont->procs.font_info((gs_font *)pfont, ((void *)0),
9547 (0x0040 | 0x0080 |
9548 0x1000 | 0x2000),
9549 &info);
9550 if (code < 0)
9551 return code;
9552 pdf_xml_ins_beg(s, "xpacket");
9553 pdf_xml_attribute_name(s, "begin");
9554 pdf_xml_copy(s, dd);
9555 pdf_xml_attribute_name(s, "id");
9556 pdf_xml_attribute_value(s, "W5M0MpCehiHzreSzNTczkc9d");
9557 pdf_xml_ins_end(s);
9558 pdf_xml_newline(s);
9559
9560 pdf_xml_copy(s, "<?adobe-xap-filters esc=\"CRLF\"?>\n");
9561 pdf_xml_copy(s, "<x:xmpmeta xmlns:x='adobe:ns:meta/'"
9562 " x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>\n");
9563 {
9564 pdf_xml_copy(s, "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' "
9565 "xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n");
9566 {
9567
9568 pdf_xml_tag_open_beg(s, "rdf:Description");
9569 pdf_xml_attribute_name(s, "rdf:about");
9570 pdf_xml_attribute_value(s, instance_uuid);
9571 pdf_xml_attribute_name(s, "xmlns:xmp");
9572 pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
9573 pdf_xml_tag_end(s);
9574 {
9575 pdf_xml_tag_open_beg(s, "xmp:Title");
9576 pdf_xml_tag_end(s);
9577 {
9578 pdf_xml_tag_open(s, "rdf:Alt");
9579 {
9580 pdf_xml_tag_open_beg(s, "rdf:li");
9581 pdf_xml_attribute_name(s, "xml:lang");
9582 pdf_xml_attribute_value(s, "x-default");
9583 pdf_xml_tag_end(s);
9584 {
9585 pdf_xml_data_write(s, pbfont->font_name.data, pbfont->font_name.size);
9586 }
9587 pdf_xml_tag_close(s, "rdf:li");
9588 }
9589 pdf_xml_tag_close(s, "rdf:Alt");
9590 }
9591 pdf_xml_tag_close(s, "xmp:Title");
9592 }
9593 pdf_xml_tag_close(s, "rdf:Description");
9594 pdf_xml_newline(s);
9595
9596
9597 pdf_xml_tag_open_beg(s, "rdf:Description");
9598 pdf_xml_attribute_name(s, "rdf:about");
9599 pdf_xml_attribute_value(s, instance_uuid);
9600 pdf_xml_attribute_name(s, "xmlns:xmpRights");
9601 pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/rights/");
9602 pdf_xml_tag_end(s);
9603 if (info.members & 0x0040) {
9604 pdf_xml_tag_open_beg(s, "xmpRights:Copyright");
9605 pdf_xml_tag_end(s);
9606 {
9607 pdf_xml_tag_open(s, "rdf:Alt");
9608 {
9609 pdf_xml_tag_open_beg(s, "rdf:li");
9610 pdf_xml_attribute_name(s, "xml:lang");
9611 pdf_xml_attribute_value(s, "x-default");
9612 pdf_xml_tag_end(s);
9613 {
9614 pdf_xml_data_write(s, info.Copyright.data, info.Copyright.size);
9615 }
9616 pdf_xml_tag_close(s, "rdf:li");
9617 }
9618 pdf_xml_tag_close(s, "rdf:Alt");
9619 }
9620 pdf_xml_tag_close(s, "xmpRights:Copyright");
9621
9622
9623 pdf_xml_tag_open_beg(s, "xmpRights:Owner");
9624 pdf_xml_tag_end(s);
9625 {
9626 pdf_xml_tag_open(s, "rdf:Alt");
9627 {
9628 pdf_xml_tag_open_beg(s, "rdf:li");
9629 pdf_xml_attribute_name(s, "xml:lang");
9630 pdf_xml_attribute_value(s, "x-default");
9631 pdf_xml_tag_end(s);
9632 {
9633 pdf_xml_data_write(s, info.Copyright.data, info.Copyright.size);
9634 }
9635 pdf_xml_tag_close(s, "rdf:li");
9636 }
9637 pdf_xml_tag_close(s, "rdf:Alt");
9638 }
9639 pdf_xml_tag_close(s, "xmpRights:Owner");
9640 }
9641 {
9642 pdf_xml_tag_open_beg(s, "xmpRights:Marked");
9643 pdf_xml_tag_end(s);
9644 {
9645 pdf_xml_string_write(s, "True");
9646 }
9647 pdf_xml_tag_close(s, "xmpRights:Marked");
9648 }
9649 if (info.members & 0x0080) {
9650 pdf_xml_tag_open_beg(s, "xmpRights:UsageTerms");
9651 pdf_xml_tag_end(s);
9652 {
9653 pdf_xml_tag_open(s, "rdf:Alt");
9654 {
9655 pdf_xml_tag_open_beg(s, "rdf:li");
9656 pdf_xml_attribute_name(s, "xml:lang");
9657 pdf_xml_attribute_value(s, "x-default");
9658 pdf_xml_tag_end(s);
9659 {
9660 pdf_xml_data_write(s, info.Notice.data, info.Notice.size);
9661 }
9662 pdf_xml_tag_close(s, "rdf:li");
9663 }
9664 pdf_xml_tag_close(s, "rdf:Alt");
9665 }
9666 pdf_xml_tag_close(s, "xmpRights:UsageTerms");
9667 }
9668 pdf_xml_tag_close(s, "rdf:Description");
9669 pdf_xml_newline(s);
9670 }
9671 pdf_xml_copy(s, "</rdf:RDF>\n");
9672 }
9673 pdf_xml_copy(s, "</x:xmpmeta>\n");
9674
9675 pdf_xml_copy(s, " \n");
9676 pdf_xml_copy(s, " \n");
9677 pdf_xml_copy(s, "<?xpacket end='w'?>");
9678 return 0;
9679}
9680
9681int
9682pdf_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
9683 const byte *digest, int digest_length, gs_id *metadata_object_id)
9684{
9685 *metadata_object_id = 0L;
9686 if (pdev->CompatibilityLevel < 1.4)
9687 return 0;
9688
9689
9690
9691
9692
9693
9694 if (pdev->PDFA) {
9695 pdf_resource_t *pres;
9696 byte digest[6];
9697 int code;
9698 int options = 0;
9699
9700 (*(pdev->strm)->procs.flush)(pdev->strm);
9701 s_MD5C_get_digest(pdev->strm, digest, sizeof(digest));
9702 if (pdev->EncryptMetadata)
9703 options |= 8;
9704 code = pdf_open_aside(pdev, resourceOther, 0L, &pres, ((bool)1), options);
9705 if (code < 0)
9706 return code;
9707 code = pdf_write_font_metadata(pdev, pbfont, digest, digest_length);
9708 if (code < 0)
9709 return code;
9710 code = pdf_close_aside(pdev);
9711 if (code < 0)
9712 return code;
9713 code = cos_write_object(((cos_object_t *)&((pres->object)->cos_procs)), pdev);
9714 if (code < 0)
9715 return code;
9716 *metadata_object_id = pres->object->id;
9717 }
9718 return 0;
9719}