1 | /* |
---|
2 | * TransFig: Facility for Translating Fig code |
---|
3 | * Copyright (c) 1985 Supoj Sutantavibul |
---|
4 | * Copyright (c) 1991 Micah Beck |
---|
5 | * |
---|
6 | * Permission to use, copy, modify, distribute, and sell this software and its |
---|
7 | * documentation for any purpose is hereby granted without fee, provided that |
---|
8 | * the above copyright notice appear in all copies and that both that |
---|
9 | * copyright notice and this permission notice appear in supporting |
---|
10 | * documentation. The authors make no representations about the suitability |
---|
11 | * of this software for any purpose. It is provided "as is" without express |
---|
12 | * or implied warranty. |
---|
13 | * |
---|
14 | * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
---|
15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO |
---|
16 | * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
---|
17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
---|
18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
---|
19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
---|
20 | * PERFORMANCE OF THIS SOFTWARE. |
---|
21 | * |
---|
22 | */ |
---|
23 | |
---|
24 | #include <stdio.h> |
---|
25 | #include "alloc.h" |
---|
26 | #include "object.h" |
---|
27 | |
---|
28 | static double forward_arrow_wid = 4; |
---|
29 | static double forward_arrow_ht = 8; |
---|
30 | static int forward_arrow_type = 0; |
---|
31 | static int forward_arrow_style = 0; |
---|
32 | static double forward_arrow_thickness = 1; |
---|
33 | |
---|
34 | static double backward_arrow_wid = 4; |
---|
35 | static double backward_arrow_ht = 8; |
---|
36 | static int backward_arrow_type = 0; |
---|
37 | static int backward_arrow_style = 0; |
---|
38 | static double backward_arrow_thickness = 1; |
---|
39 | |
---|
40 | F_arrow * |
---|
41 | forward_arrow() |
---|
42 | { |
---|
43 | F_arrow *a; |
---|
44 | |
---|
45 | if (NULL == (Arrow_malloc(a))) { |
---|
46 | put_msg(Err_mem); |
---|
47 | return(NULL); |
---|
48 | } |
---|
49 | a->type = forward_arrow_type; |
---|
50 | a->style = forward_arrow_style; |
---|
51 | a->thickness = forward_arrow_thickness; |
---|
52 | a->wid = forward_arrow_wid; |
---|
53 | a->ht = forward_arrow_ht; |
---|
54 | return(a); |
---|
55 | } |
---|
56 | |
---|
57 | F_arrow * |
---|
58 | backward_arrow() |
---|
59 | { |
---|
60 | F_arrow *a; |
---|
61 | |
---|
62 | if (NULL == (Arrow_malloc(a))) { |
---|
63 | put_msg(Err_mem); |
---|
64 | return(NULL); |
---|
65 | } |
---|
66 | a->type = backward_arrow_type; |
---|
67 | a->style = backward_arrow_style; |
---|
68 | a->thickness = backward_arrow_thickness; |
---|
69 | a->wid = backward_arrow_wid; |
---|
70 | a->ht = backward_arrow_ht; |
---|
71 | return(a); |
---|
72 | } |
---|
73 | |
---|
74 | F_arrow * |
---|
75 | make_arrow(type, style, thickness, wid, ht) |
---|
76 | int type, style; |
---|
77 | double thickness, wid, ht; |
---|
78 | { |
---|
79 | F_arrow *a; |
---|
80 | |
---|
81 | if (NULL == (Arrow_malloc(a))) { |
---|
82 | put_msg(Err_mem); |
---|
83 | return(NULL); |
---|
84 | } |
---|
85 | a->type = type; |
---|
86 | a->style = style; |
---|
87 | a->thickness = thickness; |
---|
88 | a->wid = wid; |
---|
89 | a->ht = ht; |
---|
90 | return(a); |
---|
91 | } |
---|