summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/pdfdraw.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-08-16 08:10:47 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-08-16 08:10:47 +0000
commit54319b9ec014682aec96a7b67f2debf26fd0757d (patch)
tree233c484ba6363435891a9d2ff1faccd65cc8d0a6 /Build/source/texk/dvipdfm-x/pdfdraw.c
parentad0c30ab1fc1553d293f9a5e6789953803a3ef9e (diff)
Fix various inconsistent behaviors observed in pdf:bcontent/econtent
specials. Revise PSTricks clip support (S. Hirata) git-svn-id: svn://tug.org/texlive/trunk@56121 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/pdfdraw.c')
-rw-r--r--Build/source/texk/dvipdfm-x/pdfdraw.c392
1 files changed, 110 insertions, 282 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdfdraw.c b/Build/source/texk/dvipdfm-x/pdfdraw.c
index dceb89932e2..9fc71638bc0 100644
--- a/Build/source/texk/dvipdfm-x/pdfdraw.c
+++ b/Build/source/texk/dvipdfm-x/pdfdraw.c
@@ -710,7 +710,7 @@ pdf_path__isarect (pdf_path *pa,
(c) == 'f' || (c) == 'F' || \
(c) == 's' || (c) == 'S' || \
(c) == 'b' || (c) == 'B' || \
- (c) == 'W' || (c) == ' ' \
+ (c) == 'W' \
)
static /* __inline__ */ int
@@ -727,8 +727,7 @@ INVERTIBLE_MATRIX (const pdf_tmatrix *M)
/* rectfill, rectstroke, rectclip, recteoclip
*
- * Draw isolated rectangle without actually doing
- * gsave/grestore operation.
+ * Draw isolated rectangle without actually doing gsave/grestore operation.
*
* TODO:
* linestyle, fill-opacity, stroke-opacity,....
@@ -751,7 +750,7 @@ pdf_dev__rectshape (const pdf_rect *r,
ASSERT(r && PT_OP_VALID(opchr));
- isclip = (opchr == 'W' || opchr == ' ') ? 1 : 0;
+ isclip = (opchr == 'W') ? 1 : 0;
/* disallow matrix for clipping.
* q ... clip Q does nothing and
@@ -763,18 +762,13 @@ pdf_dev__rectshape (const pdf_rect *r,
graphics_mode();
- buf[len++] = ' ';
if (!isclip) {
- buf[len++] = 'q';
- if (M) {
- buf[len++] = ' ';
- len += pdf_sprint_matrix(buf + len, M);
- buf[len++] = ' ';
- buf[len++] = 'c'; buf[len++] = 'm';
- }
- buf[len++] = ' ';
+ pdf_dev_gsave();
+ }
+ pdf_dev_newpath();
+ if (!isclip && M) {
+ pdf_dev_concat(M);
}
- buf[len++] = 'n';
p.x = r->llx; p.y = r->lly;
wd = r->urx - r->llx;
@@ -788,21 +782,20 @@ pdf_dev__rectshape (const pdf_rect *r,
buf[len++] = ' ';
buf[len++] = 'r'; buf[len++] = 'e';
- if (opchr != ' ') {
- buf[len++] = ' ';
- buf[len++] = opchr;
+ buf[len++] = ' ';
+ buf[len++] = opchr;
- buf[len++] = ' ';
- buf[len++] = isclip ? 'n' : 'Q';
- }
+ pdf_doc_add_page_content(buf, len);
- pdf_doc_add_page_content(buf, len); /* op: q cm n re Q */
+ if (isclip) {
+ pdf_dev_newpath();
+ } else {
+ pdf_dev_grestore();
+ }
return 0;
}
-static int path_added = 0;
-
/* FIXME */
static int
pdf_dev__flushpath (pdf_path *pa,
@@ -817,17 +810,13 @@ pdf_dev__flushpath (pdf_path *pa,
pdf_coord *pt;
int n_pts, n_seg;
int len = 0;
- int isclip = 0;
int isrect, i, j;
ASSERT(pa && PT_OP_VALID(opchr));
- isclip = (opchr == 'W') ? 1 : 0;
-
- if (PA_LENGTH(pa) <= 0 && path_added == 0)
+ if (PA_LENGTH(pa) <= 0)
return 0;
- path_added = 0;
graphics_mode();
isrect = pdf_path__isarect(pa, ignore_rule);
if (isrect) {
@@ -860,7 +849,7 @@ pdf_dev__flushpath (pdf_path *pa,
b[len++] = PE_OPCHR(pe);
if (len + 128 > b_len) {
pdf_doc_add_page_content(b, len); /* op: m l c v y h */
- len = 0;
+ len = 0;
}
}
if (len > 0) {
@@ -873,104 +862,15 @@ pdf_dev__flushpath (pdf_path *pa,
b[len++] = opchr;
if (rule == PDF_FILL_RULE_EVENODD)
b[len++] = '*';
- if (isclip) {
- b[len++] = ' '; b[len++] = 'n';
- }
pdf_doc_add_page_content(b, len); /* op: f F s S b B W f* F* s* S* b* B* W* */
return 0;
}
-/* Stack operation */
-typedef struct m_stack_elem
-{
- void *data;
- struct m_stack_elem *prev;
-} m_stack_elem;
-
-typedef struct m_stack
-{
- int size;
- m_stack_elem *top;
- m_stack_elem *bottom;
-} m_stack;
-
-static void
-m_stack_init (m_stack *stack)
-{
- ASSERT(stack);
-
- stack->size = 0;
- stack->top = NULL;
- stack->bottom = NULL;
-
- return;
-}
-
-static void
-m_stack_push (m_stack *stack, void *data)
-{
- m_stack_elem *elem;
-
- ASSERT(stack);
-
- elem = NEW(1, m_stack_elem);
- elem->prev = stack->top;
- elem->data = data;
-
- stack->top = elem;
- if (stack->size == 0)
- stack->bottom = elem;
-
- stack->size++;
-
- return;
-}
-
-static void *
-m_stack_pop (m_stack *stack)
-{
- m_stack_elem *elem;
- void *data;
-
- ASSERT(stack);
-
- if (stack->size == 0)
- return NULL;
-
- data = stack->top->data;
- elem = stack->top;
- stack->top = elem->prev;
- if (stack->size == 1)
- stack->bottom = NULL;
- RELEASE(elem);
-
- stack->size--;
-
- return data;
-}
-
-static void *
-m_stack_top (m_stack *stack)
-{
- void *data;
-
- ASSERT(stack);
-
- if (stack->size == 0)
- return NULL;
-
- data = stack->top->data;
-
- return data;
-}
-
-#define m_stack_depth(s) ((s)->size)
-
/* ExtGState stack */
-static m_stack xgs_stack;
-static int xgs_count = 0;
+static dpx_stack xgs_stack;
+static int xgs_count = 0;
struct xgs_res {
pdf_obj *object;
@@ -988,7 +888,7 @@ static const char default_xgs[] = "\
static void
init_xgstate (void)
{
- m_stack_init(&xgs_stack);
+ dpx_stack_init(&xgs_stack);
xgs_count = 0;
return;
@@ -999,7 +899,7 @@ clear_xgstate (void)
{
struct xgs_res *xgs;
- while ((xgs = m_stack_pop(&xgs_stack)) != NULL) {
+ while ((xgs = dpx_stack_pop(&xgs_stack)) != NULL) {
pdf_release_obj(xgs->object);
pdf_release_obj(xgs->accumlated);
RELEASE(xgs);
@@ -1036,12 +936,11 @@ typedef struct pdf_gstate_
/* internal */
pdf_path path;
int flags;
- /* bookkeeping the origin of the last transform applied */
- pdf_coord pt_fixee;
+
pdf_obj *extgstate;
} pdf_gstate;
-static m_stack gs_stack;
+static dpx_stack gs_stack;
static void
init_a_gstate (pdf_gstate *gs)
@@ -1066,8 +965,6 @@ init_a_gstate (pdf_gstate *gs)
/* Internal variables */
gs->flags = 0;
init_a_path(&gs->path);
- gs->pt_fixee.x = 0;
- gs->pt_fixee.y = 0;
gs->extgstate = NULL;
@@ -1118,8 +1015,6 @@ copy_a_gstate (pdf_gstate *gs1, pdf_gstate *gs2)
pdf_color_copycolor(&gs1->fillcolor , &gs2->fillcolor);
pdf_color_copycolor(&gs1->strokecolor, &gs2->strokecolor);
- gs1->pt_fixee.x = gs2->pt_fixee.x;
- gs1->pt_fixee.y = gs2->pt_fixee.y;
gs1->extgstate = gs2->extgstate ? pdf_link_obj(gs2->extgstate) : NULL;
@@ -1129,8 +1024,8 @@ copy_a_gstate (pdf_gstate *gs1, pdf_gstate *gs2)
static int
pdf_dev_set_xgstate (pdf_obj *diff, pdf_obj *accumlated)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
char buf[64], res_name[16];
int len = 0, id;
@@ -1151,14 +1046,14 @@ pdf_dev_set_xgstate (pdf_obj *diff, pdf_obj *accumlated)
int
pdf_dev_reset_xgstate (int force)
{
- m_stack *gss = &gs_stack;
+ dpx_stack *gss = &gs_stack;
pdf_gstate *gs;
pdf_obj *current, *target, *keys, *diff;
struct xgs_res *xgs;
int i, need_reset = 0;
- gs = m_stack_top(gss);
- xgs = m_stack_top(&xgs_stack);
+ gs = dpx_stack_top(gss);
+ xgs = dpx_stack_top(&xgs_stack);
if (xgs) {
target = pdf_link_obj(xgs->accumlated);
} else {
@@ -1212,7 +1107,7 @@ pdf_dev_xgstate_push (pdf_obj *object)
target = NEW(1, struct xgs_res);
target->object = object;
- current = m_stack_top(&xgs_stack);
+ current = dpx_stack_top(&xgs_stack);
if (!current) {
const char *ptr, *endptr;
ptr = default_xgs;
@@ -1224,7 +1119,7 @@ pdf_dev_xgstate_push (pdf_obj *object)
}
pdf_merge_dict(accumlated, object);
target->accumlated = accumlated;
- m_stack_push(&xgs_stack, target);
+ dpx_stack_push(&xgs_stack, target);
pdf_dev_set_xgstate(target->object, target->accumlated);
@@ -1238,8 +1133,8 @@ pdf_dev_xgstate_pop (void)
pdf_obj *accumlated, *revert, *keys;
int i;
- current = m_stack_pop(&xgs_stack);
- target = m_stack_top(&xgs_stack);
+ current = dpx_stack_pop(&xgs_stack);
+ target = dpx_stack_top(&xgs_stack);
if (!current) {
WARN("Too many pop operation for ExtGState!");
return;
@@ -1281,12 +1176,12 @@ pdf_dev_init_gstates (void)
{
pdf_gstate *gs;
- m_stack_init(&gs_stack);
+ dpx_stack_init(&gs_stack);
gs = NEW(1, pdf_gstate);
init_a_gstate(gs);
- m_stack_push(&gs_stack, gs); /* Initial state */
+ dpx_stack_push(&gs_stack, gs); /* Initial state */
init_xgstate();
return;
@@ -1297,10 +1192,10 @@ pdf_dev_clear_gstates (void)
{
pdf_gstate *gs;
- if (m_stack_depth(&gs_stack) > 1) /* at least 1 elem. */
+ if (dpx_stack_depth(&gs_stack) > 1) /* at least 1 elem. */
WARN("GS stack depth is not zero at the end of the document.");
- while ((gs = m_stack_pop(&gs_stack)) != NULL) {
+ while ((gs = dpx_stack_pop(&gs_stack)) != NULL) {
clear_a_gstate(gs);
RELEASE(gs);
}
@@ -1315,11 +1210,11 @@ pdf_dev_gsave (void)
{
pdf_gstate *gs0, *gs1;
- gs0 = m_stack_top(&gs_stack);
+ gs0 = dpx_stack_top(&gs_stack);
gs1 = NEW(1, pdf_gstate);
init_a_gstate(gs1);
copy_a_gstate(gs1, gs0);
- m_stack_push(&gs_stack, gs1);
+ dpx_stack_push(&gs_stack, gs1);
pdf_doc_add_page_content(" q", 2); /* op: q */
@@ -1331,12 +1226,12 @@ pdf_dev_grestore (void)
{
pdf_gstate *gs;
- if (m_stack_depth(&gs_stack) <= 1) { /* Initial state at bottom */
+ if (dpx_stack_depth(&gs_stack) <= 1) { /* Initial state at bottom */
WARN("Too many grestores.");
return -1;
}
- gs = m_stack_pop(&gs_stack);
+ gs = dpx_stack_pop(&gs_stack);
clear_a_gstate(gs);
RELEASE(gs);
@@ -1351,14 +1246,14 @@ pdf_dev_grestore (void)
int
pdf_dev_push_gstate (void)
{
- m_stack *gss = &gs_stack;
+ dpx_stack *gss = &gs_stack;
pdf_gstate *gs0;
gs0 = NEW(1, pdf_gstate);
init_a_gstate(gs0);
- m_stack_push(gss, gs0);
+ dpx_stack_push(gss, gs0);
return 0;
}
@@ -1367,15 +1262,15 @@ pdf_dev_push_gstate (void)
int
pdf_dev_pop_gstate (void)
{
- m_stack *gss = &gs_stack;
+ dpx_stack *gss = &gs_stack;
pdf_gstate *gs;
- if (m_stack_depth(gss) <= 1) { /* Initial state at bottom */
+ if (dpx_stack_depth(gss) <= 1) { /* Initial state at bottom */
WARN("Too many grestores.");
return -1;
}
- gs = m_stack_pop(gss);
+ gs = dpx_stack_pop(gss);
clear_a_gstate(gs);
RELEASE(gs);
@@ -1386,24 +1281,24 @@ pdf_dev_pop_gstate (void)
int
pdf_dev_current_depth (void)
{
- return (m_stack_depth(&gs_stack) - 1); /* 0 means initial state */
+ return (dpx_stack_depth(&gs_stack) - 1); /* 0 means initial state */
}
void
pdf_dev_grestore_to (int depth)
{
- m_stack *gss = &gs_stack;
+ dpx_stack *gss = &gs_stack;
pdf_gstate *gs;
ASSERT(depth >= 0);
- if (m_stack_depth(gss) > depth + 1) {
+ if (dpx_stack_depth(gss) > depth + 1) {
WARN("Closing pending transformations at end of page/XObject.");
}
- while (m_stack_depth(gss) > depth + 1) {
+ while (dpx_stack_depth(gss) > depth + 1) {
pdf_doc_add_page_content(" Q", 2); /* op: Q */
- gs = m_stack_pop(gss);
+ gs = dpx_stack_pop(gss);
clear_a_gstate(gs);
RELEASE(gs);
}
@@ -1415,8 +1310,8 @@ pdf_dev_grestore_to (int depth)
int
pdf_dev_currentpoint (pdf_coord *p)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_coord *cpt = &gs->cp;
ASSERT(p);
@@ -1429,8 +1324,8 @@ pdf_dev_currentpoint (pdf_coord *p)
int
pdf_dev_currentmatrix (pdf_tmatrix *M)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_tmatrix *CTM = &gs->matrix;
ASSERT(M);
@@ -1444,8 +1339,8 @@ pdf_dev_currentmatrix (pdf_tmatrix *M)
int
pdf_dev_currentcolor (pdf_color *color, int is_fill)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_color *fcl = &gs->fillcolor;
pdf_color *scl = &gs->strokecolor;
@@ -1469,7 +1364,7 @@ pdf_dev_set_color (const pdf_color *color, char mask, int force)
{
int len;
- pdf_gstate *gs = m_stack_top(&gs_stack);
+ pdf_gstate *gs = dpx_stack_top(&gs_stack);
pdf_color *current = mask ? &gs->fillcolor : &gs->strokecolor;
if (!(pdf_dev_get_param(PDF_DEV_PARAM_COLORMODE) &&
@@ -1488,8 +1383,8 @@ pdf_dev_set_color (const pdf_color *color, char mask, int force)
int
pdf_dev_concat (const pdf_tmatrix *M)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_tmatrix *CTM = &gs->matrix;
@@ -1542,8 +1437,8 @@ pdf_dev_concat (const pdf_tmatrix *M)
int
pdf_dev_setmiterlimit (double mlimit)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
int len = 0;
char *buf = fmt_buf;
@@ -1562,8 +1457,8 @@ pdf_dev_setmiterlimit (double mlimit)
int
pdf_dev_setlinecap (int capstyle)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
int len = 0;
char *buf = fmt_buf;
@@ -1579,8 +1474,8 @@ pdf_dev_setlinecap (int capstyle)
int
pdf_dev_setlinejoin (int joinstyle)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
int len = 0;
char *buf = fmt_buf;
@@ -1596,8 +1491,8 @@ pdf_dev_setlinejoin (int joinstyle)
int
pdf_dev_setlinewidth (double width)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
int len = 0;
char *buf = fmt_buf;
@@ -1616,8 +1511,8 @@ pdf_dev_setlinewidth (double width)
int
pdf_dev_setdash (int count, double *pattern, double offset)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
int len = 0;
char *buf = fmt_buf;
int i;
@@ -1643,8 +1538,8 @@ pdf_dev_setdash (int count, double *pattern, double offset)
int
pdf_dev_setflat (int flatness)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
int len = 0;
char *buf = fmt_buf;
@@ -1665,8 +1560,8 @@ pdf_dev_setflat (int flatness)
int
pdf_dev_clip (void)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
return pdf_dev__flushpath(cpa, 'W', PDF_FILL_RULE_NONZERO, 0);
@@ -1675,8 +1570,8 @@ pdf_dev_clip (void)
int
pdf_dev_eoclip (void)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
return pdf_dev__flushpath(cpa, 'W', PDF_FILL_RULE_EVENODD, 0);
@@ -1685,8 +1580,8 @@ pdf_dev_eoclip (void)
int
pdf_dev_flushpath (char p_op, int fill_rule)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
int error = 0;
@@ -1705,8 +1600,8 @@ pdf_dev_flushpath (char p_op, int fill_rule)
int
pdf_dev_newpath (void)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *p = &gs->path;
if (PA_LENGTH(p) > 0) {
@@ -1721,8 +1616,8 @@ pdf_dev_newpath (void)
int
pdf_dev_moveto (double x, double y)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p;
@@ -1734,8 +1629,8 @@ pdf_dev_moveto (double x, double y)
int
pdf_dev_rmoveto (double x, double y)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p;
@@ -1748,8 +1643,8 @@ pdf_dev_rmoveto (double x, double y)
int
pdf_dev_lineto (double x, double y)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p0;
@@ -1762,8 +1657,8 @@ pdf_dev_lineto (double x, double y)
int
pdf_dev_rlineto (double x, double y)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p0;
@@ -1778,8 +1673,8 @@ pdf_dev_curveto (double x0, double y0,
double x1, double y1,
double x2, double y2)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p0, p1, p2;
@@ -1792,44 +1687,12 @@ pdf_dev_curveto (double x0, double y0,
}
int
-pdf_dev_vcurveto (double x0, double y0,
- double x1, double y1)
-{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
- pdf_path *cpa = &gs->path;
- pdf_coord *cpt = &gs->cp;
- pdf_coord p0, p1;
-
- p0.x = x0; p0.y = y0;
- p1.x = x1; p1.y = y1;
-
- return pdf_path__curveto(cpa, cpt, cpt, &p0, &p1);
-}
-
-int
-pdf_dev_ycurveto (double x0, double y0,
- double x1, double y1)
-{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
- pdf_path *cpa = &gs->path;
- pdf_coord *cpt = &gs->cp;
- pdf_coord p0, p1;
-
- p0.x = x0; p0.y = y0;
- p1.x = x1; p1.y = y1;
-
- return pdf_path__curveto(cpa, cpt, &p0, &p1, &p1);
-}
-
-int
pdf_dev_rcurveto (double x0, double y0,
double x1, double y1,
double x2, double y2)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p0, p1, p2;
@@ -1845,8 +1708,8 @@ pdf_dev_rcurveto (double x0, double y0,
int
pdf_dev_closepath (void)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_coord *cpt = &gs->cp;
pdf_path *cpa = &gs->path;
@@ -1857,8 +1720,8 @@ pdf_dev_closepath (void)
void
pdf_dev_dtransform (pdf_coord *p, const pdf_tmatrix *M)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_tmatrix *CTM = &gs->matrix;
ASSERT(p);
@@ -1871,8 +1734,8 @@ pdf_dev_dtransform (pdf_coord *p, const pdf_tmatrix *M)
void
pdf_dev_idtransform (pdf_coord *p, const pdf_tmatrix *M)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_tmatrix *CTM = &gs->matrix;
ASSERT(p);
@@ -1885,8 +1748,8 @@ pdf_dev_idtransform (pdf_coord *p, const pdf_tmatrix *M)
void
pdf_dev_transform (pdf_coord *p, const pdf_tmatrix *M)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_tmatrix *CTM = &gs->matrix;
ASSERT(p);
@@ -1900,8 +1763,8 @@ pdf_dev_transform (pdf_coord *p, const pdf_tmatrix *M)
void
pdf_dev_itransform (pdf_coord *p, const pdf_tmatrix *M)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_tmatrix *CTM = &gs->matrix;
ASSERT(p);
@@ -1916,8 +1779,8 @@ int
pdf_dev_arc (double c_x , double c_y, double r,
double a_0 , double a_1)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord c;
@@ -1932,8 +1795,8 @@ int
pdf_dev_arcn (double c_x , double c_y, double r,
double a_0 , double a_1)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord c;
@@ -1950,8 +1813,8 @@ pdf_dev_arcx (double c_x , double c_y,
int a_d ,
double xar)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord c;
@@ -1966,8 +1829,8 @@ int
pdf_dev_bspline (double x0, double y0,
double x1, double y1, double x2, double y2)
{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
+ dpx_stack *gss = &gs_stack;
+ pdf_gstate *gs = dpx_stack_top(gss);
pdf_path *cpa = &gs->path;
pdf_coord *cpt = &gs->cp;
pdf_coord p1, p2, p3;
@@ -1982,7 +1845,6 @@ pdf_dev_bspline (double x0, double y0,
return pdf_path__curveto(cpa, cpt, &p1, &p2, &p3);
}
-#if 0
int
pdf_dev_rectstroke (double x, double y,
double w, double h,
@@ -1998,7 +1860,6 @@ pdf_dev_rectstroke (double x, double y,
return pdf_dev__rectshape(&r, M, 'S');
}
-#endif
int
pdf_dev_rectfill (double x, double y,
@@ -2027,36 +1888,3 @@ pdf_dev_rectclip (double x, double y,
return pdf_dev__rectshape(&r, NULL, 'W');
}
-
-int
-pdf_dev_rectadd (double x, double y,
- double w, double h)
-{
- pdf_rect r;
-
- r.llx = x;
- r.lly = y;
- r.urx = x + w;
- r.ury = y + h;
- path_added = 1;
-
- return pdf_dev__rectshape(&r, NULL, ' ');
-}
-
-void
-pdf_dev_set_fixed_point (double x, double y)
-{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
- gs->pt_fixee.x = x;
- gs->pt_fixee.y = y;
-}
-
-void
-pdf_dev_get_fixed_point (pdf_coord *p)
-{
- m_stack *gss = &gs_stack;
- pdf_gstate *gs = m_stack_top(gss);
- p->x = gs->pt_fixee.x;
- p->y = gs->pt_fixee.y;
-}