10
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
13
/* $Id: gdevcgml.c 8022 2007-06-05 22:23:38Z giles $ */
13
/* $Id: gdevcgml.c 8250 2007-09-25 13:31:24Z giles $ */
14
14
/* CGM-writing library */
15
15
#include "memory_.h"
16
16
#include "stdio_.h"
17
17
#include "gdevcgmx.h"
19
19
/* Forward references to command-writing procedures */
20
private void begin_command(cgm_state *, cgm_op_index);
20
static void begin_command(cgm_state *, cgm_op_index);
22
22
#define OP(op) begin_command(st, op)
23
private cgm_result end_command(cgm_state *);
23
static cgm_result end_command(cgm_state *);
25
25
#define END_OP (void)end_command(st)
26
26
#define DONE return end_command(st)
28
private void put_int(cgm_state *, cgm_int, int);
28
static void put_int(cgm_state *, cgm_int, int);
30
30
#define CI(ci) put_int(st, ci, st->metafile.color_index_precision)
31
31
#define I(i) put_int(st, i, st->metafile.integer_precision)
32
32
#define IX(ix) put_int(st, ix, st->metafile.index_precision)
33
33
#define E(e) put_int(st, (int)(e), 16)
34
private void put_real(cgm_state *, cgm_real, const cgm_precision *);
34
static void put_real(cgm_state *, cgm_real, const cgm_precision *);
36
36
#define R(r) put_real(st, r, &st->metafile.real_precision)
37
private void put_vdc(cgm_state *, const cgm_vdc *);
37
static void put_vdc(cgm_state *, const cgm_vdc *);
39
39
#define VDC(vdc) put_vdc(st, vdc)
40
40
#define VDC2(vdc1, vdc2) VDC(vdc1); VDC(vdc2)
41
41
#define VDC4(vdc1, vdc2, vdc3, vdc4) VDC2(vdc1, vdc2); VDC2(vdc3, vdc4)
42
private void put_vdc_r(cgm_state *, const cgm_line_marker_extent *, cgm_line_marker_specification_mode);
42
static void put_vdc_r(cgm_state *, const cgm_line_marker_extent *, cgm_line_marker_specification_mode);
44
44
#define VDC_R(vdcr, mode) put_vdc_r(st, vdcr, mode)
45
private void put_point(cgm_state *, const cgm_point *);
45
static void put_point(cgm_state *, const cgm_point *);
47
47
#define P(p) put_point(st, p)
48
private void put_points(cgm_state *, const cgm_point *, int);
48
static void put_points(cgm_state *, const cgm_point *, int);
50
50
#define nP(p, n) put_points(st, p, n)
51
private void put_string(cgm_state *, const char *, uint);
51
static void put_string(cgm_state *, const char *, uint);
53
53
#define S(s, l) put_string(st, s, l)
54
private void put_color(cgm_state *, const cgm_color *);
54
static void put_color(cgm_state *, const cgm_color *);
56
56
#define CO(co) put_color(st, co)
57
private void put_rgb(cgm_state *, const cgm_rgb *);
57
static void put_rgb(cgm_state *, const cgm_rgb *);
59
59
#define CD(cd) put_rgb(st, cd)
60
60
/* Other data types */
61
61
#define put_byte(st, b)\
62
62
if ( st->command_count == command_max_count ) write_command(st, false);\
63
63
st->command[st->command_count++] = (byte)(b)
64
private void put_bytes(cgm_state *, const byte *, uint);
65
private void write_command(cgm_state *, bool);
66
private void put_real_precision(cgm_state *, const cgm_precision *);
64
static void put_bytes(cgm_state *, const byte *, uint);
65
static void write_command(cgm_state *, bool);
66
static void put_real_precision(cgm_state *, const cgm_precision *);
68
68
/* ================ Public routines ================ */