~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to src/zgstate.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: zgstate.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: zgstate.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* Graphics state operators */
16
16
#include "math_.h"
17
17
#include "ghost.h"
32
32
 
33
33
/* ------ Utilities ------ */
34
34
 
35
 
private int
 
35
static int
36
36
zset_real(i_ctx_t *i_ctx_p, int (*set_proc)(gs_state *, floatp))
37
37
{
38
38
    os_ptr op = osp;
47
47
    return code;
48
48
}
49
49
 
50
 
private int
 
50
static int
51
51
zset_bool(i_ctx_t *i_ctx_p, void (*set_proc)(gs_state *, bool))
52
52
{
53
53
    os_ptr op = osp;
58
58
    return 0;
59
59
}
60
60
 
61
 
private int
 
61
static int
62
62
zcurrent_bool(i_ctx_t *i_ctx_p, bool (*current_proc)(const gs_state *))
63
63
{
64
64
    os_ptr op = osp;
68
68
    return 0;
69
69
}
70
70
 
71
 
private int
 
71
static int
72
72
zset_uint(i_ctx_t *i_ctx_p, void (*set_proc)(gs_state *, uint))
73
73
{
74
74
    os_ptr op = osp;
79
79
    return 0;
80
80
}
81
81
 
82
 
private int
 
82
static int
83
83
zcurrent_uint(i_ctx_t *i_ctx_p, uint (*current_proc)(const gs_state *))
84
84
{
85
85
    os_ptr op = osp;
92
92
/* ------ Operations on the entire graphics state ------ */
93
93
 
94
94
/* "Client" procedures */
95
 
private void *gs_istate_alloc(gs_memory_t * mem);
96
 
private int gs_istate_copy(void *to, const void *from);
97
 
private void gs_istate_free(void *old, gs_memory_t * mem);
98
 
private const gs_state_client_procs istate_procs = {
 
95
static void *gs_istate_alloc(gs_memory_t * mem);
 
96
static int gs_istate_copy(void *to, const void *from);
 
97
static void gs_istate_free(void *old, gs_memory_t * mem);
 
98
static const gs_state_client_procs istate_procs = {
99
99
    gs_istate_alloc,
100
100
    gs_istate_copy,
101
101
    gs_istate_free,
167
167
}
168
168
 
169
169
/* - initgraphics - */
170
 
private int
 
170
static int
171
171
zinitgraphics(i_ctx_t *i_ctx_p)
172
172
{
173
173
    /*
181
181
/* ------ Operations on graphics state elements ------ */
182
182
 
183
183
/* <num> setlinewidth - */
184
 
private int
 
184
static int
185
185
zsetlinewidth(i_ctx_t *i_ctx_p)
186
186
{
187
187
    os_ptr op = osp;
202
202
}
203
203
 
204
204
/* - currentlinewidth <num> */
205
 
private int
 
205
static int
206
206
zcurrentlinewidth(i_ctx_t *i_ctx_p)
207
207
{
208
208
    os_ptr op = osp;
213
213
}
214
214
 
215
215
/* <cap_int> .setlinecap - */
216
 
private int
 
216
static int
217
217
zsetlinecap(i_ctx_t *i_ctx_p)
218
218
{
219
219
    os_ptr op = osp;
227
227
}
228
228
 
229
229
/* - currentlinecap <cap_int> */
230
 
private int
 
230
static int
231
231
zcurrentlinecap(i_ctx_t *i_ctx_p)
232
232
{
233
233
    os_ptr op = osp;
238
238
}
239
239
 
240
240
/* <join_int> .setlinejoin - */
241
 
private int
 
241
static int
242
242
zsetlinejoin(i_ctx_t *i_ctx_p)
243
243
{
244
244
    os_ptr op = osp;
252
252
}
253
253
 
254
254
/* - currentlinejoin <join_int> */
255
 
private int
 
255
static int
256
256
zcurrentlinejoin(i_ctx_t *i_ctx_p)
257
257
{
258
258
    os_ptr op = osp;
263
263
}
264
264
 
265
265
/* <num> setmiterlimit - */
266
 
private int
 
266
static int
267
267
zsetmiterlimit(i_ctx_t *i_ctx_p)
268
268
{
269
269
    return zset_real(i_ctx_p, gs_setmiterlimit);
270
270
}
271
271
 
272
272
/* - currentmiterlimit <num> */
273
 
private int
 
273
static int
274
274
zcurrentmiterlimit(i_ctx_t *i_ctx_p)
275
275
{
276
276
    os_ptr op = osp;
281
281
}
282
282
 
283
283
/* <array> <offset> setdash - */
284
 
private int
 
284
static int
285
285
zsetdash(i_ctx_t *i_ctx_p)
286
286
{
287
287
    os_ptr op = osp;
323
323
}
324
324
 
325
325
/* - currentdash <array> <offset> */
326
 
private int
 
326
static int
327
327
zcurrentdash(i_ctx_t *i_ctx_p)
328
328
{
329
329
    os_ptr op = osp;
335
335
}
336
336
 
337
337
/* <num> setflat - */
338
 
private int
 
338
static int
339
339
zsetflat(i_ctx_t *i_ctx_p)
340
340
{
341
341
    return zset_real(i_ctx_p, gs_setflat);
342
342
}
343
343
 
344
344
/* - currentflat <num> */
345
 
private int
 
345
static int
346
346
zcurrentflat(i_ctx_t *i_ctx_p)
347
347
{
348
348
    os_ptr op = osp;
355
355
/* ------ Extensions ------ */
356
356
 
357
357
/* <bool> .setaccuratecurves - */
358
 
private int
 
358
static int
359
359
zsetaccuratecurves(i_ctx_t *i_ctx_p)
360
360
{
361
361
    return zset_bool(i_ctx_p, gs_setaccuratecurves);
362
362
}
363
363
 
364
364
/* - .currentaccuratecurves <bool> */
365
 
private int
 
365
static int
366
366
zcurrentaccuratecurves(i_ctx_t *i_ctx_p)
367
367
{
368
368
    return zcurrent_bool(i_ctx_p, gs_currentaccuratecurves);
369
369
}
370
370
 
371
371
/* <join_int|-1> .setcurvejoin - */
372
 
private int
 
372
static int
373
373
zsetcurvejoin(i_ctx_t *i_ctx_p)
374
374
{
375
375
    os_ptr op = osp;
386
386
}
387
387
 
388
388
/* - .currentcurvejoin <join_int|-1> */
389
 
private int
 
389
static int
390
390
zcurrentcurvejoin(i_ctx_t *i_ctx_p)
391
391
{
392
392
    os_ptr op = osp;
397
397
}
398
398
 
399
399
/* <adjust.x> <adjust.y> .setfilladjust2 - */
400
 
private int
 
400
static int
401
401
zsetfilladjust2(i_ctx_t *i_ctx_p)
402
402
{
403
403
    os_ptr op = osp;
414
414
}
415
415
 
416
416
/* - .currentfilladjust2 <adjust.x> <adjust.y> */
417
 
private int
 
417
static int
418
418
zcurrentfilladjust2(i_ctx_t *i_ctx_p)
419
419
{
420
420
    os_ptr op = osp;
428
428
}
429
429
 
430
430
/* <bool> .setdashadapt - */
431
 
private int
 
431
static int
432
432
zsetdashadapt(i_ctx_t *i_ctx_p)
433
433
{
434
434
    return zset_bool(i_ctx_p, gs_setdashadapt);
435
435
}
436
436
 
437
437
/* - .currentdashadapt <bool> */
438
 
private int
 
438
static int
439
439
zcurrentdashadapt(i_ctx_t *i_ctx_p)
440
440
{
441
441
    return zcurrent_bool(i_ctx_p, gs_currentdashadapt);
442
442
}
443
443
 
444
444
/* <num> <bool> .setdotlength - */
445
 
private int
 
445
static int
446
446
zsetdotlength(i_ctx_t *i_ctx_p)
447
447
{
448
448
    os_ptr op = osp;
460
460
}
461
461
 
462
462
/* - .currentdotlength <num> <bool> */
463
 
private int
 
463
static int
464
464
zcurrentdotlength(i_ctx_t *i_ctx_p)
465
465
{
466
466
    os_ptr op = osp;
472
472
}
473
473
 
474
474
/* - .setdotorientation - */
475
 
private int
 
475
static int
476
476
zsetdotorientation(i_ctx_t *i_ctx_p)
477
477
{
478
478
    return gs_setdotorientation(igs);
479
479
}
480
480
 
481
481
/* - .dotorientation - */
482
 
private int
 
482
static int
483
483
zdotorientation(i_ctx_t *i_ctx_p)
484
484
{
485
485
    return gs_dotorientation(igs);
486
486
}
487
487
 
488
488
/* <bool> .setlimitclamp - */
489
 
private int
 
489
static int
490
490
zsetlimitclamp(i_ctx_t *i_ctx_p)
491
491
{
492
492
    return zset_bool(i_ctx_p, gs_setlimitclamp);
493
493
}
494
494
 
495
495
/* - .currentlimitclamp <bool> */
496
 
private int
 
496
static int
497
497
zcurrentlimitclamp(i_ctx_t *i_ctx_p)
498
498
{
499
499
    return zcurrent_bool(i_ctx_p, gs_currentlimitclamp);
500
500
}
501
501
 
502
502
/* <int> .settextrenderingmode - */
503
 
private int
 
503
static int
504
504
zsettextrenderingmode(i_ctx_t *i_ctx_p)
505
505
{
506
506
    return zset_uint(i_ctx_p, gs_settextrenderingmode);
507
507
}
508
508
 
509
509
/* - .currenttextrenderingmode <int> */
510
 
private int
 
510
static int
511
511
zcurrenttextrenderingmode(i_ctx_t *i_ctx_p)
512
512
{
513
513
    return zcurrent_uint(i_ctx_p, gs_currenttextrenderingmode);
561
561
/* ------ Internal routines ------ */
562
562
 
563
563
/* Allocate the interpreter's part of a graphics state. */
564
 
private void *
 
564
static void *
565
565
gs_istate_alloc(gs_memory_t * mem)
566
566
{
567
567
    return gs_alloc_struct(mem, int_gstate, &st_int_gstate, "int_gsave");
568
568
}
569
569
 
570
570
/* Copy the interpreter's part of a graphics state. */
571
 
private int
 
571
static int
572
572
gs_istate_copy(void *to, const void *from)
573
573
{
574
574
    *(int_gstate *) to = *(const int_gstate *)from;
576
576
}
577
577
 
578
578
/* Free the interpreter's part of a graphics state. */
579
 
private void
 
579
static void
580
580
gs_istate_free(void *old, gs_memory_t * mem)
581
581
{
582
582
    gs_free_object(mem, old, "int_grestore");