aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN.N. <federico__@users.sourceforge.net>2007-09-20 08:25:26 +0000
committerN.N. <federico__@users.sourceforge.net>2007-09-20 08:25:26 +0000
commit43053b8b1ed8dade310703b08358b1b702897eaf (patch)
tree67a3218a91e50407854f850e5ccdfaa210310bd8
parent4b9bb3a0789aac299eacd44bba6d3a5638091d95 (diff)
new gui external: tracker
svn path=/trunk/externals/ffext/; revision=8739
-rw-r--r--tracker/COPYING280
-rw-r--r--tracker/README2
-rw-r--r--tracker/demo1.pd346
-rw-r--r--tracker/makefile18
-rwxr-xr-xtracker/tk2c.bash24
-rw-r--r--tracker/tracker-help-pd50
-rw-r--r--tracker/tracker.c589
-rw-r--r--tracker/tracker.h61
-rw-r--r--tracker/tracker.tk76
9 files changed, 1446 insertions, 0 deletions
diff --git a/tracker/COPYING b/tracker/COPYING
new file mode 100644
index 0000000..2128a66
--- /dev/null
+++ b/tracker/COPYING
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tracker/README b/tracker/README
new file mode 100644
index 0000000..1cf7e37
--- /dev/null
+++ b/tracker/README
@@ -0,0 +1,2 @@
+this is a 2D grid editor you can use like a tracker
+see the help patch for a demonstration
diff --git a/tracker/demo1.pd b/tracker/demo1.pd
new file mode 100644
index 0000000..fc763fb
--- /dev/null
+++ b/tracker/demo1.pd
@@ -0,0 +1,346 @@
+#N canvas 145 93 697 679 10;
+#X obj 34 132 tracker 2 16 0 4 4 6 0 8 2 6 4 6 10 16 0 16 0 2 14 16 4
+8 5 12 3 7 4 12 1 3 7 11 8 16;
+#X obj 34 108 r sequencer;
+#N canvas 49 507 560 341 metronome 0;
+#X obj 252 172 s \$0-playstop;
+#X msg 261 135 color \$1;
+#X obj 115 105 tgl 25 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X obj 261 112 * -1;
+#X obj 115 105 cnv 5 25 25 empty \$0-playstop empty 20 12 0 14 -1 -262144
+0;
+#X obj 131 115 cnv 5 5 5 empty empty empty 20 12 0 14 -1 -66577 0;
+#X obj 125 110 cnv 5 5 15 empty empty empty 20 12 0 14 -1 -66577 0
+;
+#X obj 119 105 cnv 5 5 25 empty empty empty 20 12 0 14 -1 -66577 0
+;
+#X obj 260 89 == 0;
+#X obj 257 40 t f f;
+#X obj 312 73 metro;
+#X obj 145 105 nbx 3 25 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 20
+-1 -262144 -1 353 256;
+#X obj 145 147 t b f;
+#X obj 145 212 /;
+#X msg 145 184 60000;
+#X obj 341 122 f;
+#X obj 369 121 + 1;
+#X msg 363 86 0;
+#X obj 364 60 sel 0;
+#X obj 285 246 s metro;
+#X obj 344 200 / 16;
+#X obj 345 222 i;
+#X obj 380 200 i;
+#X obj 379 178 / 64;
+#X obj 347 287 s metro/16;
+#X obj 391 262 s metro/64;
+#X obj 347 247 change;
+#X obj 382 225 change;
+#X obj 345 148 t f f f f f f f f;
+#X connect 1 0 0 0;
+#X connect 2 0 9 0;
+#X connect 3 0 1 0;
+#X connect 8 0 3 0;
+#X connect 9 0 8 0;
+#X connect 9 1 10 0;
+#X connect 9 1 18 0;
+#X connect 10 0 15 0;
+#X connect 11 0 12 0;
+#X connect 12 0 14 0;
+#X connect 12 1 13 1;
+#X connect 13 0 10 1;
+#X connect 14 0 13 0;
+#X connect 15 0 16 0;
+#X connect 15 0 28 0;
+#X connect 16 0 15 1;
+#X connect 17 0 15 1;
+#X connect 18 0 17 0;
+#X connect 20 0 21 0;
+#X connect 21 0 26 0;
+#X connect 22 0 27 0;
+#X connect 23 0 22 0;
+#X connect 26 0 24 0;
+#X connect 27 0 25 0;
+#X connect 28 0 19 0;
+#X connect 28 2 20 0;
+#X connect 28 4 23 0;
+#X coords 0 -1 1 1 107 51 1 110 84;
+#X restore 34 35 pd metronome;
+#X floatatom 20 418 5 0 0 0 - - -;
+#X msg 20 440 \; sequencer getrow \$1;
+#X obj 34 351 s sequencer.out;
+#X obj 102 389 r sequencer.out;
+#X obj 102 414 unpack f f;
+#X obj 151 450 -;
+#X obj 138 528 %;
+#X obj 89 552 +;
+#X obj 138 477 r metro;
+#X obj 136 132 tracker 10 16 77 45 167 700 699 80 0 0 0 0 560 30 0 94
+0 200 0 0 0 0 36 20 0 20 340 300 567 300 100 20 165 888 0 777 0 100
+120 0 0 0 56 345 270 888 330 50 999 76 800 999 46 0 0 999 0 20 0 0
+30 0 236 0 564 0 500 0 0 0 0 5 647 0 0 0 0 400 0 0 60 0 467 546 0 0
+0 0 300 170 0 13 564 0 0 45 0 0 0 0 0 24 547 0 0 0 0 0 0 0 0 34 534
+0 37 57 0 0 7 0 0 28 289 0 165 0 0 56 51 0 0 9 5 57 0 245 0 0 0 119
+0 27 36 0 0 0 0 0 0 0 185 54 534 0 0 0 0 0 0 0 0 90;
+#X obj 136 108 r pattern;
+#X obj 136 351 s pattern.out;
+#X msg 89 578 \; pattern getrow \$1;
+#X obj 138 502 % 16;
+#N canvas 0 0 450 300 (subpatch) 0;
+#X array array1 11 float 4;
+#X coords 0 999 10 0 200 140 1;
+#X restore 416 32 graph;
+#X obj 192 425 r pattern.out;
+#X obj 192 473 drip;
+#X obj 192 449 t a b;
+#X msg 228 471 0;
+#X obj 231 498 f;
+#X obj 254 498 + 1;
+#X obj 192 498 t f b;
+#X obj 192 520 pack f f;
+#X obj 192 543 tabwrite array1;
+#X obj 423 453 tabosc4~ array1;
+#X obj 311 541 delwrite~ d 1000;
+#X obj 313 367 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144
+-1 -1 2;
+#X obj 313 387 * 12;
+#X obj 350 490 *~ 0.8;
+#X obj 402 640 dac~;
+#X obj 313 408 lop~ 0.1;
+#X obj 406 583 hip~ 60;
+#X obj 20 393 r metro/64;
+#X obj 414 612 moog~;
+#X obj 422 560 mtof~;
+#X obj 474 578 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
+-1 -1 8800 1;
+#X obj 420 509 delread~ d 600;
+#X obj 369 513 *~ 0.7;
+#X obj 311 558 delwrite~ c 1000;
+#X obj 313 513 lop~ 1200;
+#X obj 420 492 delread~ c 500;
+#X obj 471 559 line;
+#X obj 474 538 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
+-1 -1 8800 1;
+#X msg 502 558 \$1 8000;
+#X obj 371 430 sig~;
+#X obj 501 372 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X obj 314 429 mtof~;
+#X obj 365 389 r metro;
+#X obj 368 409 % 16;
+#X obj 398 428 sel 0 12;
+#X obj 414 388 r metro;
+#X obj 458 411 sig~;
+#X obj 518 372 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X obj 361 594 *~ 0.4;
+#N canvas 0 0 450 300 (subpatch) 0;
+#X array shape 998 float 3;
+#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0.142857 0.14 0.137143 0.134285 0.131428 0.114286
+0.114286 0.114286 0.114286 0.114286 0.0999998 0.0999998 0.0999998 0.0999998
+0.0999998 0.0857141 0.082857 0.0799999 0.0771427 0.0742856 0.0571427
+0.0542856 0.0514285 0.0485713 0.0457142 0.042857 0.042857 0.042857
+0.042857 0.042857 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857 -0.0142857
+-0.0142857 -0.0142857 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08 -3.91155e-08
+-3.91155e-08 -3.85568e-08 0.0028571 0.00571424 0.00857138 0.0114285
+0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857
+0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857
+0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857
+0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0157142 0.0171428
+0.0185714 0.0199999 0.0214285 0.0228571 0.0242856 0.0257142 0.0271428
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.042857
+0.042857 0.042857 0.042857 0.042857 0.042857 0.042857 0.042857 0.042857
+0.042857 0.042857 0.042857 0.042857 0.042857 0.042857 0.042857 0.042857
+0.042857 0.042857 0.042857 0.0428571 0.0457142 0.0485713 0.0514285
+0.0542856 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427
+0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427
+0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427
+0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427
+0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427
+0.0571427 0.0571427 0.0599999 0.062857 0.0657142 0.0685713 0.0714284
+0.0714284 0.0714284 0.0714284 0.0714284 0.0714284 0.0714284 0.0714284
+0.0714284 0.0714284 0.0714284 0.0714284 0.0714284 0.0714284 0.0714284
+0.0714284 0.0714284 0.0714284 0.0714284 0.0714284 0.0857141 0.0857141
+0.0857141 0.0857141 0.0857141 0.0857141 0.0857141 0.0857141 0.0857141
+0.0857141 0.0999998 0.0999998 0.0999998 0.0999998 0.0999998 0.0999998
+0.0999998 0.0999998 0.0999998 0.0999998 0.114285 0.117143 0.12 0.122857
+0.125714 0.142857 0.142857 0.142857 0.142857 0.157143 0.16 0.162857
+0.165714 0.168571 0.171428 0.174285 0.177143 0.18 0.182857 0.2 0.2
+0.2 0.2 0.2 0.214285 0.217143 0.22 0.222857 0.225714 -2.47732e-08 -0.00285716
+-0.0057143 -0.00857144 -0.0114286 -0.0714285 -0.0742856 -0.0771428
+-0.0799999 -0.082857 -0.157143 -0.16 -0.162857 -0.165714 -0.168571
+-0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2 -0.2
+-0.2 -0.2 -0.197143 -0.194285 -0.191428 -0.188571 -0.185714 -0.185714
+-0.185714 -0.185714 -0.185714 -0.185714 -0.185714 -0.185714 -0.185714
+-0.185714 -0.171428 -0.171428 -0.171428 -0.171428 -0.171428 -0.171428
+-0.168571 -0.165714 -0.162857 -0.16 -0.157143 -0.157143 -0.157143 -0.157143
+-0.157143 -0.142857 -0.142857 -0.142857 -0.142857 -0.142857 -0.128571
+-0.127143 -0.125714 -0.124286 -0.122857 0.0571428 0.0599999 0.062857
+0.0657142 0.0685713 0.157143 0.16 0.162857 0.165714 0.168571 0.2 0.2
+0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.214285 0.214285
+0.214285 0.214285 0.214285 0.214285 0.214285 0.214285 0.214285 0.214285
+0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 -0.82857 -0.831427
+-0.834284 -0.837141 -0.839998 -0.842856 -0.842856 -0.842856 -0.842856
+-0.842856 -0.842856 0.0428571 0.0428571 0.0428571 0.0428571 0.0428571
+0.0428571 0.0428571 0.0428571 0.0428571 0.0428571 0.0428571 0.0428571
+0.0428571 0.0428571 0.0428571 0.0428571 0.0428571 0.0428571 0.0428571
+0.0428571 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.122041
+0.121633 0.121224 0.120816 0.120408 0.12 0.119592 0.119184 0.118775
+0.118367 0.117959 0.117551 0.117143 0.116735 0.116326 0.115918 0.11551
+0.115102 0.114694 0.114286 0.113571 0.112857 0.112143 0.111428 0.110714
+0.11 0.109285 0.108571 0.107857 0.107143 0.106428 0.105714 0.105 0.104285
+0.103571 0.102857 0.102143 0.101428 0.100714 0.0999998 0.0992855 0.0985712
+0.0978569 0.0971426 0.0964283 0.095714 0.0949998 0.0942855 0.0935712
+0.0928569 0.0921426 0.0914283 0.090714 0.0899997 0.0892855 0.0885712
+0.0878569 0.0871426 0.0864283 0.085714 0.085306 0.0848978 0.0844896
+0.0840815 0.0836733 0.0832651 0.082857 0.0824488 0.0820406 0.0816325
+0.0812243 0.0808161 0.080408 0.0799998 0.0795916 0.0791835 0.0787753
+0.0783671 0.077959 0.0775508 0.0771426 0.0767345 0.0763263 0.0759182
+0.07551 0.0751018 0.0746937 0.0742855 0.0738773 0.0734692 0.073061
+0.0726528 0.0722447 0.0718365 0.0714283 0.0710202 0.070612 0.0702038
+0.0697957 0.0693875 0.0689793 0.0685712 0.068163 0.0677548 0.0673467
+0.0669385 0.0665304 0.0661222 0.065714 0.0653059 0.0648977 0.0644895
+0.0640814 0.0636732 0.063265 0.0628569 0.0624487 0.0620405 0.0616324
+0.0612242 0.0608161 0.0604079 0.0599997 0.0595916 0.0591834 0.0587753
+0.0583671 0.0579589 0.0575508 0.0571426 0.0567346 0.0563264 0.0559182
+0.0555101 0.0551019 0.0546938 0.0542856 0.0538774 0.0534693 0.0530611
+0.052653 0.0522448 0.0518366 0.0514285 0.0510203 0.0506121 0.050204
+0.0497958 0.0493877 0.0489795 0.0485713 0.0481632 0.047755 0.0473469
+0.0469387 0.0465305 0.0461224 0.0457142 0.045306 0.0448979 0.0444897
+0.0440816 0.0436734 0.0432652 0.0428571 0.0424489 0.0420408 0.0416326
+0.0412244 0.0408163 0.0404081 0.04 0.0395918 0.0391836 0.0387755 0.0383673
+0.0379591 0.037551 0.0371428 0.0367347 0.0363265 0.0359183 0.0355102
+0.035102 0.0346939 0.0342857 0.0338775 0.0334694 0.0330612 0.032653
+0.0322449 0.0318367 0.0314286 0.0310204 0.0306122 0.0302041 0.0297959
+0.0293877 0.0289796 0.0285714 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713 0.0285713
+0.0285713 0.0285713 0.0285713 0.0292856 0.0299999 0.0307142 0.0314285
+0.0321428 0.032857 0.0335713 0.0342856 0.0349999 0.0357142 0.0364285
+0.0371427 0.037857 0.0385713 0.0392856 0.0399999 0.0407142 0.0414285
+0.0421427 0.042857 0.0435713 0.0442856 0.0449999 0.0457142 0.0464284
+0.0471427 0.047857 0.0485713 0.0492856 0.0499999 0.0507141 0.0514284
+0.0521427 0.052857 0.0535713 0.0542856 0.0549998 0.0557141 0.0564284
+0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0571427 0.0585713
+0.0599999 0.0614284 0.062857 0.0642856 0.0657141 0.0671427 0.0685713
+0.0699998 0.0714284 0.0785713 0.0857141 0.092857 0.0999998 0.0999998
+0.0999998 0.0999998 0.0999998 0.0999998 0.102857 0.105714 0.108571
+0.111428 0.114286 0.117143 0.12 0.122857 0.125714 0.128571 0.13 0.131428
+0.132857 0.134285 0.135714 0.137143 0.138571 0.14 0.141428 0.142857
+0.16 0.162857 0.165714 0.168571 0.171428 0.185714 0.185714 0.185714
+0.185714 0.185714 0.614285 0.614285 0.614285 0.642856 0.645713 0.64857
+0.651427 0.654285 0.714284;
+#X coords 0 1 998 -1 200 140 1;
+#X restore 415 187 graph;
+#X obj 423 470 tabread4~ shape;
+#X obj 395 479 -~ 0;
+#X obj 417 408 % 20;
+#X obj 465 388 sel 0 12;
+#X obj 455 430 *~ 6;
+#X obj 460 610 sig~ 1.5;
+#X connect 0 0 5 0;
+#X connect 1 0 0 0;
+#X connect 3 0 4 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 7 0 10 1;
+#X connect 7 1 8 1;
+#X connect 8 0 9 1;
+#X connect 9 0 10 0;
+#X connect 10 0 15 0;
+#X connect 11 0 16 0;
+#X connect 12 0 14 0;
+#X connect 13 0 12 0;
+#X connect 16 0 9 0;
+#X connect 18 0 20 0;
+#X connect 19 0 24 0;
+#X connect 20 0 19 0;
+#X connect 20 1 21 0;
+#X connect 21 0 22 1;
+#X connect 22 0 23 0;
+#X connect 22 0 25 1;
+#X connect 23 0 22 1;
+#X connect 24 0 25 0;
+#X connect 24 1 22 0;
+#X connect 25 0 26 0;
+#X connect 27 0 58 0;
+#X connect 29 0 30 0;
+#X connect 30 0 33 0;
+#X connect 31 0 28 0;
+#X connect 31 0 42 0;
+#X connect 33 0 49 0;
+#X connect 34 0 36 0;
+#X connect 35 0 3 0;
+#X connect 36 0 32 1;
+#X connect 36 0 32 0;
+#X connect 36 0 56 0;
+#X connect 37 0 36 1;
+#X connect 38 0 37 0;
+#X connect 39 0 40 0;
+#X connect 40 0 28 0;
+#X connect 40 0 34 0;
+#X connect 42 0 41 0;
+#X connect 43 0 40 0;
+#X connect 43 0 36 2;
+#X connect 44 0 38 0;
+#X connect 45 0 46 0;
+#X connect 46 0 44 0;
+#X connect 47 0 49 0;
+#X connect 48 0 47 0;
+#X connect 49 0 27 0;
+#X connect 50 0 51 0;
+#X connect 51 0 52 0;
+#X connect 52 0 48 0;
+#X connect 52 1 48 0;
+#X connect 53 0 60 0;
+#X connect 54 0 62 0;
+#X connect 55 0 54 0;
+#X connect 56 0 31 0;
+#X connect 58 0 59 0;
+#X connect 59 0 31 0;
+#X connect 59 0 34 0;
+#X connect 60 0 61 0;
+#X connect 61 0 55 0;
+#X connect 61 1 55 0;
+#X connect 62 0 49 0;
+#X connect 63 0 36 2;
diff --git a/tracker/makefile b/tracker/makefile
new file mode 100644
index 0000000..826444f
--- /dev/null
+++ b/tracker/makefile
@@ -0,0 +1,18 @@
+all: tracker.pd_linux
+tracker.pd_linux: tracker.c tracker.h tracker.tk2c
+
+CFLAGS = -DPD -DUNIX -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wno-shadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch \
+ -I/usr/include -I../pd/src
+
+.SUFFIXES: .pd_linux .tk .tk2c
+
+.tk.tk2c:
+ sh tk2c.bash < $*.tk >$*.tk2c
+.c.pd_linux:
+ $(CC) $(CFLAGS) -o $*.o -c $*.c
+ $(LD) -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+ strip --strip-unneeded $*.pd_linux
+clean:
+ rm -f *.o *.pd_* so_locations *.tk2c
diff --git a/tracker/tk2c.bash b/tracker/tk2c.bash
new file mode 100755
index 0000000..9dfeb03
--- /dev/null
+++ b/tracker/tk2c.bash
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+#set -x
+
+while read line
+do
+ for word in $line
+ do
+ if [ "X"$word != "X"${word#\#} ]
+ then
+ echo // ${line#\#}
+ break
+ else
+ line=${line//\'/\\\'}
+#useless, slashes never gets in
+ line=${line//\\/\\\\}
+#this one's dirty, i know
+ line=${line//;/\\\\;}
+ line=${line//\"/\\\"}
+ echo 'sys_gui("'$line'\n");'
+ break
+ fi
+ done
+done
diff --git a/tracker/tracker-help-pd b/tracker/tracker-help-pd
new file mode 100644
index 0000000..d22b855
--- /dev/null
+++ b/tracker/tracker-help-pd
@@ -0,0 +1,50 @@
+#N canvas 637 183 541 529 10;
+#X obj 65 282 tracker 10 10 9 8 7 6 5 4 3 2 1 0 10 9 8 7 6 5 4 3 2 1 11
+10 9 8 7 6 5 4 3 2 12 11 10 9 8 7 6 5 4 3 13 12 11 10 9 8 7 6 5 4 14
+13 12 11 10 9 8 7 6 5 15 14 13 12 11 10 9 8 7 6 16 15 14 13 12 11 10
+9 8 7 17 16 15 14 13 12 11 10 9 8 18 17 16 15 14 13 12 11 10 9;
+#X msg 65 69 setrow 0 10 11 12 13 14 15 16 17 18 19;
+#X msg 79 91 setrow 0 999 999 999 999 999 999 999 999 999 999;
+#X msg 130 196 set 2 3 \$1;
+#X floatatom 130 177 5 0 0 0 - - -;
+#N canvas 0 0 450 300 display_output 0;
+#X obj 60 51 inlet;
+#X obj 60 147 outlet;
+#X obj 60 85 list prepend set;
+#X obj 60 113 list trim;
+#X connect 0 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X restore 65 436 pd display_output;
+#X msg 65 467 9;
+#X msg 99 143 getrow \$1;
+#X obj 99 120 r \$0-row;
+#X obj 373 399 s \$0-row;
+#X obj 373 348 f;
+#X obj 400 348 + 1;
+#X obj 373 372 % 10;
+#X obj 373 317 metro 100;
+#X obj 373 289 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X floatatom 445 372 5 0 0 0 - - -;
+#X text 210 189 <- set single value;
+#X text 231 116 ^- set whole row;
+#X text 172 145 <- output one row;
+#X msg 144 232 get 2 3;
+#X text 203 233 <- output single value;
+#X connect 0 0 5 0;
+#X connect 1 0 0 0;
+#X connect 2 0 0 0;
+#X connect 3 0 0 0;
+#X connect 4 0 3 0;
+#X connect 5 0 6 0;
+#X connect 7 0 0 0;
+#X connect 8 0 7 0;
+#X connect 10 0 11 0;
+#X connect 10 0 12 0;
+#X connect 11 0 10 1;
+#X connect 12 0 9 0;
+#X connect 13 0 10 0;
+#X connect 14 0 13 0;
+#X connect 15 0 9 0;
+#X connect 19 0 0 0;
diff --git a/tracker/tracker.c b/tracker/tracker.c
new file mode 100644
index 0000000..cc6e7fa
--- /dev/null
+++ b/tracker/tracker.c
@@ -0,0 +1,589 @@
+/* ------------------------------------------------------------------------ */
+/* Copyright (c) 2007 Federico Ferri. */
+/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */
+/* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+/* */
+/* tracker: a general purpose gbrid-like widget */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* See file LICENSE for further informations on licensing terms. */
+/* */
+/* This program 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 General Public License for more details. */
+/* */
+/* You should have received a copy of the GNU General Public License */
+/* along with this program; if not, write to the Free Software Foundation, */
+/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+/* */
+/* Based on PureData by Miller Puckette and others. */
+/* Many thanks to Yves Degoyon for its externals. */
+/* ------------------------------------------------------------------------ */
+
+#include <stdlib.h>
+#include "tracker.h"
+
+t_widgetbehavior tracker_widgetbehavior;
+static t_class* tracker_class;
+static t_symbol* keyname_sym;
+
+#define MARGIN_X 3
+#define MARGIN_Y 2
+
+static const char* tracker_isedititem(t_tracker* x, int r, int c) {
+ if(x->x_active_row == r && x->x_active_row >= 0 &&
+ x->x_active_column == c && x->x_active_column >= 0 &&
+ x->x_buf[0]) return ">";
+ else return "";
+}
+
+static int tracker_getdisplayval(t_tracker* x, int r, int c) {
+ if(tracker_isedititem(x, r, c) == ">") {
+ return atoi(x->x_buf);
+ } else {
+ return x->x_data[r][c];
+ }
+}
+
+/* ---- drawing stuff ------------------------------------------------------ */
+
+static void tracker_draw_new(t_tracker* x, t_glist* glist) {
+ int r,c;
+ t_canvas* canvas = glist_getcanvas(glist);
+ sys_vgui(".x%x.c create rectangle %d %d %d %d -outline black -fill gray -tags %xSHAPE\n", canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), text_xpix(&x->x_obj, glist)+x->x_columns*x->x_cell_width+2*MARGIN_X, text_ypix(&x->x_obj, glist)+x->x_rows*x->x_cell_height+2*MARGIN_Y, x);
+ sys_vgui(".x%x.c create rectangle %d %d %d %d -fill #dddddd -outline {} -tags {%xCURSOR}\n", canvas, 0, 0, 0, 0, x);
+ for(r = 0; r < x->x_rows; r++) {
+ for(c = 0; c < x->x_columns; c++) {
+ sys_vgui(".x%x.c create text %d %d -text %d%s -font -*-courier-bold--normal--%d-* -anchor nw -tags {%xTEXT %xTEXT.%d.%d} -fill black\n", canvas, text_xpix(&x->x_obj, glist)+c*x->x_cell_width+MARGIN_X, text_ypix(&x->x_obj, glist)+r*x->x_cell_height+MARGIN_Y, tracker_getdisplayval(x, r, c), tracker_isedititem(x, r, c), glist_getfont(glist), x, x, r, c);
+ }
+ }
+ //canvas_fixlinesfor(canvas, (t_text*)x);
+ tracker_draw_update(x);
+}
+
+static void tracker_draw_update(t_tracker* x) {
+ int r,c;
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ for(r = 0; r < x->x_rows; r++) {
+ for(c = 0; c < x->x_columns; c++) {
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -text %d%s\n", canvas, x, r, c, tracker_getdisplayval(x, r, c), tracker_isedititem(x, r, c));
+ }
+ }
+ canvas_fixlinesfor(canvas, (t_text*)x);
+}
+
+static void tracker_draw_update_row(t_tracker* x, int r) {
+ int c;
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ for(c = 0; c < x->x_columns; c++) {
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -text %d%s\n", canvas, x, r, c, tracker_getdisplayval(x, r, c), tracker_isedititem(x, r, c));
+ }
+ canvas_fixlinesfor(canvas, (t_text*)x);
+}
+
+static void tracker_draw_update_single(t_tracker* x, int r, int c) {
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -text %d%s\n", canvas, x, r, c, tracker_getdisplayval(x, r, c), tracker_isedititem(x, r, c));
+ canvas_fixlinesfor(canvas, (t_text*)x);
+}
+
+static void tracker_draw_update_cursor_pos(t_tracker* x) {
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ if(x->x_cursor_pos >= 0) {
+ sys_vgui(".x%x.c coords %xCURSOR %d %d %d %d\n", canvas, x, text_xpix(&x->x_obj, x->x_glist)+MARGIN_X-1, text_ypix(&x->x_obj, x->x_glist)+x->x_cursor_pos*x->x_cell_height+MARGIN_Y-1, text_xpix(&x->x_obj, x->x_glist)+x->x_columns*x->x_cell_width+MARGIN_X+1, text_ypix(&x->x_obj, x->x_glist)+(x->x_cursor_pos+1)*x->x_cell_height+MARGIN_Y+1);
+ } else {
+ sys_vgui(".x%x.c coords %xCURSOR %d %d %d %d\n", canvas, x, 0, 0, 0, 0);
+ }
+ canvas_fixlinesfor(canvas, (t_text*)x);
+}
+
+static void tracker_draw_move(t_tracker* x, t_glist* glist) {
+ int r,c;
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ sys_vgui(".x%x.c coords %xSHAPE %d %d %d %d\n", canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), text_xpix(&x->x_obj, glist)+x->x_columns*x->x_cell_width+2*MARGIN_X, text_ypix(&x->x_obj, glist)+x->x_rows*x->x_cell_height+2*MARGIN_Y);
+ if(x->x_cursor_pos >= 0) {
+ sys_vgui(".x%x.c coords %xCURSOR %d %d %d %d\n", canvas, x, text_xpix(&x->x_obj, x->x_glist)+MARGIN_X-1, text_ypix(&x->x_obj, x->x_glist)+x->x_cursor_pos*x->x_cell_height+MARGIN_Y-1, text_xpix(&x->x_obj, x->x_glist)+x->x_columns*x->x_cell_width+MARGIN_X+1, text_ypix(&x->x_obj, x->x_glist)+(x->x_cursor_pos+1)*x->x_cell_height+MARGIN_Y+1);
+ } else {
+ sys_vgui(".x%x.c coords %xCURSOR %d %d %d %d\n", canvas, x, 0, 0, 0, 0);
+ }
+ for(r = 0; r < x->x_rows; r++) {
+ for(c = 0; c < x->x_columns; c++) {
+ sys_vgui(".x%x.c coords %xTEXT.%d.%d %d %d\n", canvas, x, r, c, text_xpix(&x->x_obj, glist)+c*x->x_cell_width+MARGIN_X, text_ypix(&x->x_obj, glist)+r*x->x_cell_height+MARGIN_Y);
+ }
+ }
+ canvas_fixlinesfor(canvas, (t_text*)x);
+}
+
+static void tracker_draw_erase(t_tracker* x, t_glist* glist) {
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ sys_vgui(".x%x.c delete %xSHAPE\n", canvas, x);
+ sys_vgui(".x%x.c delete %xTEXT\n", canvas, x);
+ sys_vgui(".x%x.c delete %xCURSOR\n", canvas, x);
+}
+
+static void tracker_draw_select(t_tracker* x, t_glist* glist) {
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ if(x->x_selected) {
+ sys_vgui(".x%x.c itemconfigure %xSHAPE -fill blue\n", canvas, x);
+ sys_vgui(".x%x.c itemconfigure %xTEXT -fill white\n", canvas, x);
+ sys_vgui(".x%x.c itemconfigure %xCURSOR -fill blue\n", canvas, x);
+ } else {
+ sys_vgui(".x%x.c itemconfigure %xSHAPE -fill gray\n", canvas, x);
+ sys_vgui(".x%x.c itemconfigure %xTEXT -fill black\n", canvas, x);
+ sys_vgui(".x%x.c itemconfigure %xCURSOR -fill #dddddd\n", canvas, x);
+ }
+ if(x->x_active_row >= 0 && x->x_active_column >= 0)
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -fill red\n", canvas, x, x->x_active_row, x->x_active_column);
+}
+
+/* ---- widget behavior stuff ---------------------------------------------- */
+
+static void tracker_getrect(t_gobj* z, t_glist* owner, int* xp1, int* yp1, int* xp2, int* yp2) {
+ t_tracker* x = (t_tracker*)z;
+
+ *xp1 = text_xpix(&x->x_obj, owner);
+ *yp1 = text_ypix(&x->x_obj, owner);
+ *xp2 = text_xpix(&x->x_obj, owner)+x->x_columns*x->x_cell_width+2*MARGIN_X;
+ *yp2 = text_ypix(&x->x_obj, owner)+x->x_rows*x->x_cell_height+2*MARGIN_Y;
+}
+
+static void tracker_save(t_gobj* z, t_binbuf* b) {
+ t_tracker* x = (t_tracker*)z;
+ int ei,gi;
+
+ binbuf_addv(b, "ssiisii", gensym("#X"), gensym("obj"),
+ (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix,
+ gensym("tracker"), x->x_columns, x->x_rows);
+
+ /* save data: */
+ int tmp;
+ for (ei = 0; ei < x->x_rows; ei++) {
+ for (gi = 0; gi < x->x_columns; gi++) {
+ tmp = (int)x->x_data[ei][gi];
+ binbuf_addv(b, "i", tmp);
+ }
+ }
+
+ binbuf_addv(b, ";");
+}
+
+static void tracker_properties(t_gobj* z, t_glist* owner) {
+ char buf[800];
+ t_tracker* x = (t_tracker*)z;
+
+ sprintf(buf, "pdtk_tracker_dialog %%s %d %d\n",
+ (int)x->x_columns, (int)x->x_rows);
+ //post("buf=%s", buf);
+ gfxstub_new(&x->x_obj.ob_pd, x, buf);
+}
+
+static void tracker_dialog(t_tracker* x, t_symbol* s, int argc, t_atom* argv) {
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ int ei;
+ if(!x) {
+ post("tracker: error: trying to set properties on an unexisting object");
+ return;
+ }
+ if(argc != 2) {
+ post("tracker: error in number of arguments (%d)", argc);
+ return;
+ }
+ if(argv[0].a_type != A_FLOAT || argv[1].a_type != A_FLOAT) {
+ post("tracker: error in format of arguments");
+ return;
+ }
+
+ tracker_draw_erase(x, x->x_glist);
+
+ /*
+ x->x_columns = argv[0].a_w.w_float;
+ if(x->x_columns <= 0) x->x_columns = 100;
+ x->x_rows = argv[1].a_w.w_float;
+ if(x->x_rows <= 0) x->x_rows = 100;
+ */
+
+ tracker_resize(x, (int)argv[1].a_w.w_float, (int)argv[0].a_w.w_float);
+
+ tracker_draw_new(x, x->x_glist);
+ canvas_fixlinesfor(canvas, (t_text*)x);
+}
+
+static void tracker_select(t_gobj* z, t_glist* glist, int selected) {
+ t_tracker* x = (t_tracker*)z;
+
+ x->x_selected = selected;
+ tracker_draw_select(x, glist);
+}
+
+static void tracker_activate(t_gobj* z, t_glist* glist, int state) {
+ post("tracker: activate(%d)", state);
+}
+
+static void tracker_vis(t_gobj* z, t_glist* glist, int vis) {
+ t_tracker* x = (t_tracker*)z;
+ t_rtext* y;
+
+ if(vis) {
+ tracker_draw_new(x, glist);
+ } else {
+ tracker_draw_erase(x, glist);
+ }
+}
+
+static void tracker_delete(t_gobj* z, t_glist* glist) {
+ canvas_deletelinesfor(glist_getcanvas(glist), (t_text*)z);
+}
+
+static void tracker_displace(t_gobj* z, t_glist* glist, int dx, int dy) {
+ t_tracker* x = (t_tracker*)z;
+ int oldx = text_xpix(&x->x_obj, glist);
+ int oldy = text_ypix(&x->x_obj, glist);
+ x->x_obj.te_xpix += dx;
+ x->x_obj.te_ypix += dy;
+ if(oldx != x->x_obj.te_xpix || oldy != x->x_obj.te_ypix) {
+ tracker_draw_move(x, x->x_glist);
+ }
+}
+
+static void tracker_reset_buffer(t_tracker* x) {
+ int n = MAX_BUF;
+ while(n--) x->x_buf[n] = 0;
+ x->x_buf[MAX_BUF] = 0;
+}
+
+static void tracker_key(void* z, t_floatarg fkey) {
+ t_tracker* x = (t_tracker*)z;
+ int k = (int)fkey, n = 0;
+
+ //if(k) post("key=%d (0x%.2x) ('%c')", k, k, k);
+
+ if(k >= '0' && k <= '9') {
+ //k -= '0';
+ if(x->x_active_row >= 0 && x->x_active_column >= 0) {
+ while(x->x_buf[n]) n++;
+ if (n < MAX_BUF && n < x->x_ndigits) x->x_buf[n] = (char)k;
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ }
+ } else if(k == '\n') {
+ n = atoi(x->x_buf);
+ if(x->x_active_row >= 0 && x->x_active_column >= 0) {
+ int oldr,oldc;
+ tracker_setitem(x, x->x_active_row, x->x_active_column, n);
+ tracker_reset_buffer(x);
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ //tracker_select_item(x, -1, -1);
+ }
+ } else if(k == '\x7f' || k == 8) {
+ if(x->x_active_row >= 0 && x->x_active_column >= 0) {
+ while(x->x_buf[n]) n++;
+ n--;
+ if(n >= 0) x->x_buf[n] = 0;
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ }
+ } else if(k == '\x1b' || k == 27) {
+ tracker_reset_buffer(x);
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ } else if(k == '+') {
+ tracker_reset_buffer(x);
+ tracker_motion(x, 0, -1);
+ } else if(k == '-') {
+ tracker_reset_buffer(x);
+ tracker_motion(x, 0, 1);
+ // VIM-STYLE CURSOR MOVEMENT (how to use arrow keys?)
+ } else if(k == 'J' || k == 'j') { tracker_select_movecur(x, 0, -1);
+ } else if(k == 'K' || k == 'k') { tracker_select_movecur(x, 0, 1);
+ } else if(k == 'H' || k == 'h') { tracker_select_movecur(x, -1, 0);
+ } else if(k == 'L' || k == 'l') { tracker_select_movecur(x, 1, 0);
+ }
+}
+
+static void tracker_motion(t_tracker* x, t_floatarg dx, t_floatarg dy) {
+ if(x->x_active_row >= 0 && x->x_active_column >= 0) {
+ if(dy == 1) {
+ x->x_data[x->x_active_row][x->x_active_column]--;
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ } else if(dy == -1) {
+ x->x_data[x->x_active_row][x->x_active_column]++;
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ }
+ }
+}
+
+static void tracker_select_movecur(t_tracker* x, int dx, int dy) {
+ int r = x->x_active_row, c = x->x_active_column;
+ if(r >= 0 && c >= 0) {
+ r += dy;
+ if(r < 0) r = 0;
+ if(r >= x->x_rows) r = x->x_rows - 1;
+ c += dx;
+ if(c < 0) c = 0;
+ if(c >= x->x_columns) c = x->x_columns - 1;
+ tracker_select_item(x, r, c);
+ }
+}
+
+static void tracker_select_item(t_tracker* x, int r, int c) {
+ t_canvas* canvas = glist_getcanvas(x->x_glist);
+ // -1, -1 unselects
+ if(r >= 0 && c >= 0) {
+ if(r != x->x_active_row || c != x->x_active_column) {
+ if(x->x_active_row >= 0 && x->x_active_column >= 0) {
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -fill black\n", canvas, x, x->x_active_row, x->x_active_column);
+ tracker_reset_buffer(x);
+ tracker_draw_update_single(x, x->x_active_row, x->x_active_column);
+ }
+ x->x_active_row = r;
+ x->x_active_column = c;
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -fill red\n", canvas, x, x->x_active_row, x->x_active_column);
+ }
+ } else {
+ if(x->x_active_row >= 0 && x->x_active_column >= 0) {
+ sys_vgui(".x%x.c itemconfigure %xTEXT.%d.%d -fill black\n", canvas, x, x->x_active_row, x->x_active_column);
+ }
+ x->x_active_row = -1;
+ x->x_active_column = -1;
+ }
+}
+
+static int tracker_click(t_gobj* z, t_glist* glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) {
+ t_tracker* x = (t_tracker*)z;
+ t_canvas* canvas = glist_getcanvas(glist);
+
+ if(doit) {
+ glist_grab(glist, &x->x_obj.te_g,
+ (t_glistmotionfn)tracker_motion, tracker_key, xpix, ypix);
+
+ int r,c,rx,ry;
+ rx = xpix - text_xpix(&x->x_obj, glist) - MARGIN_X;
+ ry = ypix - text_ypix(&x->x_obj, glist) - MARGIN_Y;
+ c = rx / x->x_cell_width;
+ r = ry / x->x_cell_height;
+ tracker_select_item(x, r, c);
+ tracker_reset_buffer(x);
+ }
+
+ return 1;
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void tracker_update(t_tracker* x, t_symbol* s, int argc, t_atom* argv) {
+ tracker_draw_update(x);
+}
+
+static void tracker_resize(t_tracker* x, int newrows, int newcols) {
+ int ei,ej;
+
+ t_float** oldbuf = x->x_data;
+ int oldrows = x->x_rows;
+ int oldcols = x->x_columns;
+
+ x->x_data = (t_float**)getbytes(newrows*sizeof(t_float*));
+ for(ei = 0; ei < newrows; ei++) {
+ x->x_data[ei] = (t_float*)getbytes(newcols*sizeof(t_float));
+ for(ej = 0; ej < newcols; ej++) {
+ x->x_data[ei][ej] = oldbuf[ei % oldrows][ej % oldcols];
+ }
+ }
+
+ for(ei = 0; ei < oldrows; ei++) {
+ freebytes(oldbuf[ei], oldcols*sizeof(t_float));
+ }
+ freebytes(oldbuf, oldrows*sizeof(t_float));
+
+ x->x_rows = newrows;
+ x->x_columns = newcols;
+}
+
+static void tracker_free(t_tracker* x) {
+ int ei;
+ for(ei = 0; ei < x->x_rows; ei++) {
+ freebytes(x->x_data[ei], x->x_columns*sizeof(t_float));
+ }
+ freebytes(x->x_data, x->x_rows*sizeof(t_float));
+ //pd_unbind(&x->x_obj.ob_pd, keyname_sym);
+}
+
+static t_tracker* tracker_new(t_symbol* s, int argc, t_atom* argv) {
+ t_tracker* x;
+ t_pd* x2;
+ int ei;
+
+ //post("tracker_new: create %s argc=%d", s->s_name, argc);
+
+ x = (t_tracker*)pd_new(tracker_class);
+ x->outlet0 = outlet_new(&x->x_obj, &s_list); //&s_float ??
+
+ tracker_reset_buffer(x);
+
+ //pd_bind(&x->x_obj.ob_pd, keyname_sym);
+
+ x->x_data = (t_float**)getbytes(sizeof(t_float*));
+ x->x_data[0] = (t_float*)getbytes(sizeof(t_float));
+ x->x_data[0][0] = 0;
+ x->x_columns = 1;
+ x->x_rows = 1;
+ x->x_ndigits = 3;
+ x->x_cursor_pos = -1;
+
+ int cols,rows;
+ if(argc == 0) {
+ // set default values
+ cols = 10;
+ rows = 10;
+ } else {
+ if(argc <= 2) {
+ post("tracker: error: wrong # of arguments (<2)");
+ return NULL;
+ }
+ cols = argv[0].a_w.w_float;
+ rows = argv[1].a_w.w_float;
+ }
+ tracker_resize(x, rows, cols);
+
+ if(argc == (2+cols*rows)) {
+ // restore saved data
+ for(ei = 2; ei < argc; ei++) {
+ x->x_data[(ei-2)/cols][(ei-2)%cols] = argv[ei].a_w.w_float;
+ }
+ }
+ x->x_glist = (t_glist*)canvas_getcurrent();
+
+ /* calculate font metrics */
+ int font = glist_getfont(x->x_glist);
+ int width = sys_fontwidth(font);
+ int height = sys_fontheight(font);
+ x->x_cell_width = width*(x->x_ndigits+1);
+ x->x_cell_height = height;
+
+ return x;
+}
+
+static void tracker_getrow(t_tracker* x, t_float row) {
+ int ei,introw;
+
+ introw = (int)row;
+ introw = introw % x->x_rows;
+ if(introw < 0) introw = 0;
+
+ t_atom *atombuf = (t_atom*)getbytes(sizeof(t_atom)*x->x_columns);
+ for(ei = 0; ei < x->x_columns; ei++) {
+ SETFLOAT(&atombuf[ei], x->x_data[introw][ei]);
+ }
+ outlet_list(x->outlet0, &s_list, x->x_columns, atombuf);
+ freebytes(atombuf, sizeof(t_atom)*x->x_columns);
+
+ if(1) {
+ x->x_cursor_pos = ((t_int)row) % x->x_rows;
+ if(x->x_cursor_pos < 0) x->x_cursor_pos = 0;
+ tracker_draw_update_cursor_pos(x);
+ }
+}
+
+static void tracker_setrow(t_tracker* x, t_symbol* s, int argc, t_atom* argv) {
+ if(argc < 2) {
+ post("tracker: setrow: too few arguments");
+ return;
+ }
+ int ei,introw;
+
+ introw = (int)argv[0].a_w.w_float;
+ introw = introw % x->x_rows;
+ if(introw < 0) introw = 0;
+
+ for(ei = 1; ei < argc; ei++) {
+ if((ei-1) >= x->x_columns) break;
+
+ if(argv[ei].a_type == A_FLOAT) {
+ x->x_data[introw][ei-1] = argv[ei].a_w.w_float;
+ } else {
+ post("tracker: warning: non-float atom converted to zero-value");
+ x->x_data[introw][ei-1] = 0;
+ }
+ }
+
+ tracker_draw_update_row(x, introw);
+}
+
+static void tracker_getitem(t_tracker* x, t_float row, t_float col) {
+ t_atom a;
+ int introw,intcol;
+
+ introw = (int)row;
+ introw = introw % x->x_rows;
+ if(introw < 0) introw = 0;
+ intcol = (int)col;
+ intcol = introw % x->x_columns;
+ if(intcol < 0) intcol = 0;
+
+ SETFLOAT(&a, x->x_data[introw][intcol]);
+
+ outlet_list(x->outlet0, &s_list, 1, &a);
+}
+
+static void tracker_setitem(t_tracker* x, t_float row, t_float col, t_float val) {
+ int introw,intcol;
+
+ introw = (int)row;
+ introw = introw % x->x_rows;
+ if(introw < 0) introw = 0;
+ intcol = (int)col;
+ intcol = intcol % x->x_columns;
+ if(intcol < 0) intcol = 0;
+
+ x->x_data[introw][intcol] = val;
+
+ tracker_draw_update_single(x, introw, intcol);
+}
+
+static void tracker_list(t_tracker* x, t_symbol* s, int ac, t_atom* av) {
+// startpost("tracker: list> %s", s->s_name);
+// postatom(ac, av);
+// endpost();
+}
+
+void tracker_setup(void) {
+keyname_sym = gensym("#keyname");
+#include "tracker.tk2c"
+ tracker_class = class_new(
+ gensym("tracker"),
+ (t_newmethod)tracker_new,
+ (t_method)tracker_free,
+ sizeof(t_tracker),
+ 0,
+ A_GIMME,
+ 0
+ );
+ class_addlist(tracker_class, tracker_list);
+ class_addmethod(tracker_class, (t_method)tracker_update, gensym("update"), A_GIMME, 0);
+ class_addmethod(tracker_class, (t_method)tracker_dialog, gensym("dialog"), A_GIMME, 0);
+ class_addmethod(tracker_class, (t_method)tracker_setrow, gensym("setrow"), A_GIMME, 0);
+ class_addmethod(tracker_class, (t_method)tracker_getrow, gensym("getrow"), A_FLOAT, 0);
+ class_addmethod(tracker_class, (t_method)tracker_setitem, gensym("set"), A_FLOAT, A_FLOAT, A_FLOAT, 0);
+ class_addmethod(tracker_class, (t_method)tracker_getitem, gensym("get"), A_FLOAT, A_FLOAT, 0);
+
+ tracker_widgetbehavior.w_getrectfn = tracker_getrect;
+ tracker_widgetbehavior.w_displacefn = tracker_displace;
+ tracker_widgetbehavior.w_selectfn = tracker_select;
+ //tracker_widgetbehavior.w_activatefn = NULL;
+ tracker_widgetbehavior.w_activatefn = tracker_activate;
+ tracker_widgetbehavior.w_deletefn = tracker_delete;
+ tracker_widgetbehavior.w_visfn = tracker_vis;
+ tracker_widgetbehavior.w_clickfn = tracker_click;
+
+#if PD_MINOR_VERSION >= 37
+ class_setpropertiesfn(tracker_class, tracker_properties);
+ class_setsavefn(tracker_class, tracker_save);
+#else
+ tracker_widgetbehavior.w_propertiesfn = tracker_properties;
+ tracker_widgetbehavior.w_savefn = tracker_save;
+#endif
+
+ class_setwidget(tracker_class, &tracker_widgetbehavior);
+ class_sethelpsymbol(tracker_class, gensym("tracker.pd"));
+}
diff --git a/tracker/tracker.h b/tracker/tracker.h
new file mode 100644
index 0000000..7df761c
--- /dev/null
+++ b/tracker/tracker.h
@@ -0,0 +1,61 @@
+/* Copyright (c) 2007 Federico Ferri
+ * For information on usage and redistribution, and for a DISCLAIMER OF ALL
+ * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+#ifndef __G_GRID_H
+#define __G_GRID_H
+
+#include <ctype.h>
+#include "m_pd.h"
+#include "m_imp.h"
+#include "g_canvas.h"
+#include "s_stuff.h"
+#include "t_tk.h"
+#include <unistd.h>
+#include <stdio.h>
+
+#define MAX_BUF 10
+
+typedef struct _tracker
+{
+ t_object x_obj;
+ t_glist *x_glist;
+ t_int x_selected; // selected flag (in edit mode)
+ t_int x_columns; // # of cols
+ t_int x_rows; // # of rows
+ t_int x_active_row; // selected item row
+ t_int x_active_column; // selected item col
+ t_int x_ndigits; // cell width (+1 of margin added automatically)
+ t_int x_cursor_pos; // visual cursor position (row indicator)
+ char x_buf[MAX_BUF+1]; // edit buffer
+ t_int x_cell_width; // cell width in pixels (auto computed)
+ t_int x_cell_height; // cell height in pixels (auto computed)
+ t_float** x_data; // data (2d matrix)
+ t_outlet* outlet0; // outlet
+} t_tracker;
+
+static void tracker_draw_new(t_tracker* x, t_glist* glist);
+static void tracker_draw_update(t_tracker* x);
+static void tracker_draw_move(t_tracker* x, t_glist* glist);
+static void tracker_draw_erase(t_tracker* x, t_glist* glist);
+static void tracker_draw_select(t_tracker* x, t_glist* glist);
+static void tracker_getrect(t_gobj* z, t_glist* owner, int* xp1, int* yp1, int* xp2, int* yp2);
+static void tracker_save(t_gobj* z, t_binbuf* b);
+static void tracker_properties(t_gobj* z, t_glist* owner);
+static void tracker_dialog(t_tracker* x, t_symbol* s, int argc, t_atom* argv);
+static void tracker_select(t_gobj* z, t_glist* glist, int selected);
+static void tracker_vis(t_gobj* z, t_glist* glist, int vis);
+static void tracker_delete(t_gobj* z, t_glist* glist);
+static void tracker_displace(t_gobj* z, t_glist* glist, int dx, int dy);
+static void tracker_resize(t_tracker* x, int newrows, int newcols);
+static void tracker_free(t_tracker* x);
+static void tracker_getrow(t_tracker* x, t_float row);
+static void tracker_setrow(t_tracker* x, t_symbol* s, int argc, t_atom* argv);
+static void tracker_getitem(t_tracker* x, t_float row, t_float col);
+static void tracker_setitem(t_tracker* x, t_float row, t_float col, t_float val);
+static void tracker_motion(t_tracker* x, t_floatarg dx, t_floatarg dy);
+static void tracker_select_item(t_tracker* x, int r, int c);
+static void tracker_select_movecur(t_tracker* x, int dx, int dy);
+void tracker_setup(void);
+
+#endif // __G_GRID_H
diff --git a/tracker/tracker.tk b/tracker/tracker.tk
new file mode 100644
index 0000000..9d2a844
--- /dev/null
+++ b/tracker/tracker.tk
@@ -0,0 +1,76 @@
+proc tracker_apply {id} {
+# strip "." from the TK id to make a variable name suffix
+ set vid [string trimleft $id .]
+# for each variable, make a local variable to hold its name...
+ set var_graph_width [concat graph_width_$vid]
+ global $var_graph_width
+ set var_graph_height [concat graph_height_$vid]
+ global $var_graph_height
+
+ set cmd [concat $id dialog \
+ [eval concat $$var_graph_width] \
+ [eval concat $$var_graph_height] \
+ \;]
+ #puts stderr $cmd
+ pd $cmd
+}
+
+proc tracker_cancel {id} {
+ set cmd [concat $id cancel \;]
+ #puts stderr $cmd
+ pd $cmd
+}
+
+proc tracker_ok {id} {
+ tracker_apply $id
+ tracker_cancel $id
+}
+
+proc pdtk_tracker_dialog {id width height} {
+ set vid [string trimleft $id .]
+
+ set var_graph_width [concat graph_width_$vid]
+ global $var_graph_width
+ set var_graph_height [concat graph_height_$vid]
+ global $var_graph_height
+
+ set $var_graph_width $width
+ set $var_graph_height $height
+
+ toplevel $id
+ wm title $id {tracker}
+ wm protocol $id WM_DELETE_WINDOW [concat tracker_cancel $id]
+
+ label $id.label -text {GRID PROPERTIES}
+ pack $id.label -side top
+
+ frame $id.buttonframe
+ pack $id.buttonframe -side bottom -fill x -pady 2m
+ button $id.buttonframe.cancel -text {Cancel}\
+ -command "tracker_cancel $id"
+ button $id.buttonframe.apply -text {Apply}\
+ -command "tracker_apply $id"
+ button $id.buttonframe.ok -text {OK}\
+ -command "tracker_ok $id"
+ pack $id.buttonframe.cancel -side left -expand 1
+ pack $id.buttonframe.apply -side left -expand 1
+ pack $id.buttonframe.ok -side left -expand 1
+
+ frame $id.1rangef
+ pack $id.1rangef -side top
+ label $id.1rangef.lwidth -text "Width :"
+ #entry $id.1rangef.width -textvar $var_graph_width -width 7
+ spinbox $id.1rangef.width -textvariable $var_graph_width -width 7 -from 1 -to 99 -increment 1
+ pack $id.1rangef.lwidth $id.1rangef.width -side left
+
+ frame $id.2rangef
+ pack $id.2rangef -side top
+ label $id.2rangef.lheight -text "Height :"
+ #entry $id.2rangef.height -textvar $var_graph_height -width 7
+ spinbox $id.2rangef.height -textvariable $var_graph_height -width 7 -from 1 -to 99 -increment 1
+ pack $id.2rangef.lheight $id.2rangef.height -side left
+
+ bind $id.1rangef.width <KeyPress-Return> [concat tracker_ok $id]
+ bind $id.2rangef.height <KeyPress-Return> [concat tracker_ok $id]
+ focus $id.1rangef.width
+}