1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
// Copyright (C) 1999-2016
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"
//#include "tkmacosx.h"
#include "macosxlib.h"
void macosxBegin()
{
/*
if (tkmacosx)
tkmacosx->begin();
*/
}
void macosxEnd()
{
/*
if (tkmacosx)
tkmacosx->end();
*/
}
void macosxColor(XColor* clr)
{
/*
if (clr) {
float red = clr->red/float(USHRT_MAX);
float green = clr->green/float(USHRT_MAX);
float blue = clr->blue/float(USHRT_MAX);
if (tkmacosx)
tkmacosx->color(red,green,blue);
}
*/
}
void macosxWidth(float ww)
{
/*
if (tkmacosx)
tkmacosx->width(ww);
*/
}
void macosxDash(float* d, int n)
{
/*
if (tkmacosx)
tkmacosx->dash(d,n);
*/
}
void macosxFont(const char* f, float s)
{
/*
if (tkmacosx)
tkmacosx->font(f,s);
*/
}
void macosxClip(Vector v, Vector s)
{
/*
if (tkmacosx) {
Vector vv1 = v*tkmacosx->getCanvasToPage();
Vector vv2 = (v+s)*tkmacosx->getCanvasToPage();
Vector ss = vv2-vv1;
tkmacosx->clip(vv1[0],vv1[1],ss[0],ss[1]);
}
*/
}
void macosxDrawText(Vector v, float ang, const char* text)
{
/*
if (tkmacosx) {
Vector vv = v*tkmacosx->getCanvasToPage();
tkmacosx->drawText(vv[0], vv[1], ang, text);
}
*/
}
void macosxDrawLine(Vector v0, Vector v1)
{
/*
if (tkmacosx) {
Vector vv0 = v0*tkmacosx->getCanvasToPage();
Vector vv1 = v1*tkmacosx->getCanvasToPage();
int n = 2;
float x[2];
float y[2];
x[0] = vv0[0];
y[0] = vv0[1];
x[1] = vv1[0];
y[1] = vv1[1];
tkmacosx->drawLines(x,y,n);
}
*/
}
void macosxDrawLines(Vector* v, int n)
{
/*
if (tkmacosx) {
float xx[n];
float yy[n];
for(int ii=0; ii<n; ii++) {
Vector vv = v[ii]*tkmacosx->getCanvasToPage();
xx[ii] = vv[0];
yy[ii] = vv[1];
}
tkmacosx->drawLines(xx,yy,n);
}
*/
}
void macosxDrawRect(Vector v, Vector s)
{
/*
if (tkmacosx) {
Vector vv1 = v*tkmacosx->getCanvasToPage();
tkmacosx->drawRect(vv1[0], vv1[1], s[0], s[1]);
}
*/
}
void macosxDrawArc(Vector v, float rad, float ang1, float ang2)
{
/*
if (tkmacosx) {
Vector vv = v*tkmacosx->getCanvasToPage();
tkmacosx->drawArc(vv[0], vv[1], rad, ang1, ang2);
}
*/
}
void macosxDrawCurve(Vector v0, Vector t0, Vector t1, Vector v1)
{
/*
if (tkmacosx) {
Vector vv0 = v0*tkmacosx->getCanvasToPage();
Vector tt0 = t0*tkmacosx->getCanvasToPage();
Vector tt1 = t1*tkmacosx->getCanvasToPage();
Vector vv1 = v1*tkmacosx->getCanvasToPage();
tkmacosx->drawCurve(vv0[0], vv0[1], tt0[0], tt0[1],
tt1[0], tt1[1], vv1[0], vv1[1]);
}
*/
}
void macosxFillPolygon(Vector* v, int n)
{
/*
if (tkmacosx) {
float xx[n];
float yy[n];
for(int ii=0; ii<n; ii++) {
Vector vv = v[ii]*tkmacosx->getCanvasToPage();
xx[ii] = vv[0];
yy[ii] = vv[1];
}
tkmacosx->fillPolygon(xx,yy,n);
}
*/
}
void macosxBitmapCreate(void* img, int width, int height,
const Vector& v, const Vector& s)
{
/*
if (tkmacosx) {
Vector vv1 = v*tkmacosx->getCanvasToPage();
Vector vv2 = (v+s)*tkmacosx->getCanvasToPage();
Vector ss = vv2-vv1;
tkmacosx->bitmapCreate(img, width, height, vv1[0], vv1[1], ss[0], ss[1]);
}
*/
}
|