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
|
# $Id$
# $Name$
package Tk::Zinc;
#require Tk;
use Tk;
#use AutoLoader;
#use Exporter;
use Carp;
use base qw(Tk::Widget);
Construct Tk::Widget 'Zinc';
use vars qw($VERSION);
# the following line initialize $VERSION to either the tag used for
# CVS checkout -r tag_x_y_z
# (typically at package creation) or the file revision
# if no tag has been used $VERSION is initialized to
# the file revision number
my $TAG= q$Name$; # this line is automagically modified by CVS
my $REVISION = q$Revision$ ; # this line is automagically modified by CVS
($VERSION) = $TAG =~ /^\D*(\d+[\w]+)/ ;
if (defined $VERSION) {
$VERSION =~ s/_/\./g;
}
else {
$VERSION = $REVISION;
}
bootstrap Tk::Zinc $Tk::VERSION;
sub Tk_cmd { \&Tk::zinc }
sub CreateOptions
{
return (shift->SUPER::CreateOptions,'-render')
}
Tk::Methods("add", "addtag", "anchorxy", "bbox", "becomes", "bind", "cget",
"chggroup", "clone", "configure", "contour", "coords", "currentpart",
"cursor", "dchars", "dtag", "find", "fit", "focus", "gdelete", "gettags",
"gname", "group", "hasanchors", "hasfields", "hastag", "index",
"insert", "itemcget", "itemconfigure", "lower", "monitor",
"numparts", "postscript", "raise", "remove", "rotate", "scale",
"select", "smooth", "tapply", "tdelete", "transform", "translate",
"treset", "trestore", "tsave", "type", "vertexat");
## coord0 is a compatibility function usefull for porting old application
## previously running with Tk::Zinc V <= 3.2.6a
## The Zinc methode coords0 can/should replace coords as long as no control points are
## used in curve or rectangle or an arc...
## This can dramaticaly simplify the port of an old application from Zinc V<3.2.6a to
## a newer version of Zinc. HOWEVER YOU STILL MUST CHANGE THE CODE OF THIS OLD APPICATION
##
## Remember: the incompatible change in Zinc is due to the introduction of
## control points in curves (and a future release, in arc or rectangle items...)
sub coords0 {
if (wantarray) {
## we are in list context, so we should convert the returned value
## to match the specification of Zinc Version <= 3.2.6a
my @res = &Tk::Zinc::coords(@_);
if ( !ref $res[0] ) {
## The first item of the list is not a reference, so the
## list is guarranted to be a flat list (x, y, x, y, ... x, y)
return @res;
}
else {
## The list is a list of references like : [x y] or [x y symbol]
## In the latter case, coord0 should warn that there is a control point!
## coord0 will return a flatten list of (x, y, ... x , y)
my @res0;
foreach my $ref (@res) {
my @array = @{$ref};
if ($#array > 1) {
my $item = $_[1];
my $zinc = $_[0];
my $type = $zinc->type($item);
carp "Using Zinc coord0 compatibility method with item $item (type=$type) which contains a control point: @array";
}
push @res0, $array[0];
push @res0, $array[1];
}
return @res0;
}
}
else {
## contexte scalaire
## le résultat n'était pas utilisé jusqu'à présent, vu le bug...
## donc inutile de le convertir!
return &Tk::Zinc::coords(@_);
}
}
1;
__END__
=head1 NAME
Tk::Zinc - TkZinc is a kind of Canvas which proposes many new functionnalities
=for category Tk Widget Classes
=head1 SYNOPSIS
I<$zinc> = I<$parent>-E<gt>B<Zinc>(?I<options>?);
=head1 DESCRIPTION
I<Zinc> widget is very similar to Tk Canvase in that it supports
structured graphics. Like the Canvas, TkZinc implements items used to
display graphical entities. Those items can be manipulated and bindings can be
associated with them to implement interaction behaviors. But unlike the
Canvas, TkZinc can structure the items in a hierarchy (with the use of
group items), has support for affine 2D transforms (i.e. translation, scaling, and
rotation), clipping can be set for sub-trees of the item hierarchy, the item set
is quite more powerful including field specific items for Air Traffic systems and
new rendering techniques such as transparency and gradients.
Since the 3.2.2 version, TkZinc also offers as a runtime option, the support
for openGL rendering, giving access to features such as antialiasing, transparency,
color gradients and even a new, openGL oriented, item type triangles.
TkZinc full documentation is available as part of the Zinc software as a
pdf file, B<refman.pdf> and html pages B<refman/index.html>.
As a complement to the reference manual, small Perl/Tk demos of TkZinc are
also available through a small application named zinc-demos, highly inspired
from the widget application included in Tk. The aim of these demos are both
to demonstrates the power of TkZinc and to help newcomers start using
TkZinc with small examples.
=head1 WHERE CAN I FIND TkZinc?
TkZinc is available as source in tar.gz format or as Debian or RedHat/Mandrake
packages at http://www.openatc.org/zinc or http://freshmeat.net/projects/zincisnotcanvas/
=head1 AUTHOR
Patrick Lecoanet <lecoanet@cena.fr>
=head1 COPYRIGHT
Zinc has been developed by the CENA (Centres d'Etudes de la Navigation
Aérienne) for its own needs in advanced HMI (Human Machine Interfaces or Interactions).
Because we are confident in the benefit of free software, the CENA delivered this
toolkit under the GNU Library General Public License.
This code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
Parts of this software are derived from the Tk toolkit which is copyrighted
under another open source license by The Regents of the University of California
and Sun Microsystems, Inc. The general polygon clipper, GPC, is copyrighted by
the Advanced Interfaces Group, Department of Computer Science, University of
Manchester. GPC can't be used for commercial purposes without an agreement and a monetary
contribution to the University of Manchester. Please contact them at gpc@cs.man.ac.uk
It is possible to use Zinc without including GPC, it is a compile time decision. The GL
font rendering is derived from Mark Kilgard code described in `A Simple OpenGL-based
API for Texture Mapped Text' and is copyrighted by Mark Kilgard under an open source license.
=head1 SEE ALSO
L<Tk(1)>, L<zinc-demos(1)>.
=cut
|