~ubuntu-branches/ubuntu/utopic/texlive-bin/utopic

« back to all changes in this revision

Viewing changes to texk/dvipdfmx/dvipdfmx-20120420/src/pdfdraw.h

  • Committer: Package Import Robot
  • Author(s): Norbert Preining
  • Date: 2012-05-07 10:47:49 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20120507104749-p00ot5sajjbkp1hp
Tags: 2011.20120507-1
* new upstream checkout: uptex 1.10
* drop patches for config file inclusion in (x)dvipdfmx, included upstream
* add man page for etex
* include pmpost patches and build it
* adapt/unfuzzify patches for current sources
* disable mtx building, we have prepmx package in Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  $Header: /home/cvsroot/dvipdfmx/src/pdfdraw.h,v 1.14 2008/12/11 16:03:05 matthias Exp $
 
2
    
 
3
    This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
 
4
 
 
5
    Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
 
6
    the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
 
7
    
 
8
    Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
 
9
 
 
10
    This program is free software; you can redistribute it and/or modify
 
11
    it under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation; either version 2 of the License, or
 
13
    (at your option) any later version.
 
14
    
 
15
    This program is distributed in the hope that it will be useful,
 
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
    GNU General Public License for more details.
 
19
    
 
20
    You should have received a copy of the GNU General Public License
 
21
    along with this program; if not, write to the Free Software
 
22
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 
23
*/
 
24
 
 
25
#ifndef _PDF_DRAW_H_
 
26
#define _PDF_DRAW_H_
 
27
 
 
28
#include "pdfcolor.h"
 
29
#include "pdfdev.h"
 
30
 
 
31
#define  PDF_DASH_SIZE_MAX  16
 
32
#define  PDF_GSAVE_MAX      256
 
33
 
 
34
extern void  pdf_dev_init_gstates  (void);
 
35
extern void  pdf_dev_clear_gstates (void);
 
36
 
 
37
#define pdf_copymatrix(m,n) do {\
 
38
  (m)->a = (n)->a; (m)->b = (n)->b;\
 
39
  (m)->c = (n)->c; (m)->d = (n)->d;\
 
40
  (m)->e = (n)->e; (m)->f = (n)->f;\
 
41
} while (0)
 
42
 
 
43
#define pdf_setmatrix(m,p,q,r,s,t,u) do {\
 
44
  (m)->a = (p); (m)->b = (q);\
 
45
  (m)->c = (r); (m)->d = (s);\
 
46
  (m)->e = (t); (m)->f = (u);\
 
47
} while (0)
 
48
 
 
49
/* m -> n x m */
 
50
#define pdf_concatmatrix(m,n) do {\
 
51
  double _tmp_a, _tmp_b, _tmp_c, _tmp_d; \
 
52
  _tmp_a = (m)->a; _tmp_b = (m)->b; \
 
53
  _tmp_c = (m)->c; _tmp_d = (m)->d; \
 
54
  (m)->a  = ((n)->a) * _tmp_a + ((n)->b) * _tmp_c; \
 
55
  (m)->b  = ((n)->a) * _tmp_b + ((n)->b) * _tmp_d; \
 
56
  (m)->c  = ((n)->c) * _tmp_a + ((n)->d) * _tmp_c; \
 
57
  (m)->d  = ((n)->c) * _tmp_b + ((n)->d) * _tmp_d; \
 
58
  (m)->e += ((n)->e) * _tmp_a + ((n)->f) * _tmp_c; \
 
59
  (m)->f += ((n)->e) * _tmp_b + ((n)->f) * _tmp_d; \
 
60
} while (0)
 
61
 
 
62
typedef struct pdf_path_ pdf_path;
 
63
 
 
64
extern int    pdf_dev_currentmatrix (pdf_tmatrix *M);
 
65
extern int    pdf_dev_currentpoint  (pdf_coord *cp);
 
66
 
 
67
extern int    pdf_dev_setlinewidth  (double  width);
 
68
extern int    pdf_dev_setmiterlimit (double  mlimit);
 
69
extern int    pdf_dev_setlinecap    (int     style);
 
70
extern int    pdf_dev_setlinejoin   (int     style);
 
71
extern int    pdf_dev_setdash       (int     count,
 
72
                                     double *pattern,
 
73
                                     double  offset);
 
74
#if 0
 
75
extern int    pdf_dev_setflat       (int     flatness);
 
76
#endif
 
77
 
 
78
/* Path Construction */
 
79
extern int    pdf_dev_moveto        (double x , double y);
 
80
extern int    pdf_dev_rmoveto       (double x , double y);
 
81
extern int    pdf_dev_closepath     (void);
 
82
 
 
83
extern int    pdf_dev_lineto        (double x0 , double y0);
 
84
extern int    pdf_dev_rlineto       (double x0 , double y0);
 
85
extern int    pdf_dev_curveto       (double x0 , double y0,
 
86
                                     double x1 , double y1,
 
87
                                     double x2 , double y2);
 
88
extern int    pdf_dev_rcurveto      (double x0 , double y0,
 
89
                                     double x1 , double y1,
 
90
                                     double x2 , double y2);
 
91
extern int    pdf_dev_arc           (double c_x, double c_y, double r,
 
92
                                     double a_0, double a_1);
 
93
extern int    pdf_dev_arcn          (double c_x, double c_y, double r,
 
94
                                     double a_0, double a_1);
 
95
  
 
96
#define PDF_FILL_RULE_NONZERO 0
 
97
#define PDF_FILL_RULE_EVENODD 1
 
98
 
 
99
extern int    pdf_dev_newpath       (void);
 
100
 
 
101
/* Path Painting */
 
102
extern int    pdf_dev_clip          (void);
 
103
extern int    pdf_dev_eoclip        (void);
 
104
 
 
105
 
 
106
#if 0
 
107
extern int    pdf_dev_rectstroke    (double x, double y,
 
108
                                     double w, double h,
 
109
                                     const pdf_tmatrix *M  /* optional */
 
110
                                    );
 
111
#endif
 
112
extern int    pdf_dev_rectfill      (double x, double y, double w, double h);
 
113
extern int    pdf_dev_rectclip      (double x, double y, double w, double h);
 
114
 
 
115
extern int    pdf_dev_flushpath     (char p_op, int fill_rule);
 
116
 
 
117
#define pdf_dev_fill()       pdf_dev_flushpath('f', PDF_FILL_RULE_NONZERO)
 
118
#define pdf_dev_eofill()     pdf_dev_flushpath('f', PDF_FILL_RULE_EVENODD)
 
119
#define pdf_dev_stroke()     pdf_dev_flushpath('S', PDF_FILL_RULE_NONZERO)
 
120
#define pdf_dev_fillstroke() pdf_dev_flushpath('B', PDF_FILL_RULE_NONZERO)
 
121
 
 
122
extern int    pdf_dev_concat        (const pdf_tmatrix *M);
 
123
/* NULL pointer of M mean apply current transformation */
 
124
extern void   pdf_dev_dtransform    (pdf_coord *p, const pdf_tmatrix *M);
 
125
extern void   pdf_dev_idtransform   (pdf_coord *p, const pdf_tmatrix *M);
 
126
extern void   pdf_dev_transform     (pdf_coord *p, const pdf_tmatrix *M);
 
127
#if 0
 
128
extern void   pdf_dev_itransform    (pdf_coord *p, const pdf_tmatrix *M);
 
129
#endif
 
130
 
 
131
extern int    pdf_dev_gsave         (void);
 
132
extern int    pdf_dev_grestore      (void);
 
133
 
 
134
/* Requires from mpost.c because new MetaPost graphics must initialize
 
135
 * the current gstate. */
 
136
extern int    pdf_dev_push_gstate (void);
 
137
extern int    pdf_dev_pop_gstate (void);
 
138
 
 
139
 
 
140
/* extension */
 
141
extern int    pdf_dev_arcx          (double c_x, double c_y,
 
142
                                     double r_x, double r_y,
 
143
                                     double a_0, double a_1,
 
144
                                     int    a_d, /* arc direction   */
 
145
                                     double xar  /* x-axis-rotation */
 
146
                                    );
 
147
extern int    pdf_dev_bspline       (double x0, double y0,
 
148
                                     double x1, double y1,
 
149
                                     double x2, double y2);
 
150
 
 
151
 
 
152
extern void   pdf_invertmatrix      (pdf_tmatrix *M);
 
153
  
 
154
/* The depth here is the depth of q/Q nesting.
 
155
 * We must remember current depth of nesting when starting a page or xform,
 
156
 * and must recover until that depth at the end of page/xform.
 
157
 */
 
158
extern int    pdf_dev_current_depth (void);
 
159
extern void   pdf_dev_grestore_to   (int depth);
 
160
#define pdf_dev_grestoreall() pdf_dev_grestore_to(0);
 
161
 
 
162
extern void   pdf_dev_set_color     (const pdf_color *color, char mask, int force);
 
163
#define pdf_dev_set_strokingcolor(c)     pdf_dev_set_color(c,    0, 0);
 
164
#define pdf_dev_set_nonstrokingcolor(c)  pdf_dev_set_color(c, 0x20, 0);
 
165
extern void   pdf_dev_reset_color   (int force);
 
166
 
 
167
#endif /* _PDF_DRAW_H_ */