diff options
author | N.N. <matju@users.sourceforge.net> | 2005-10-04 02:12:44 +0000 |
---|---|---|
committer | N.N. <matju@users.sourceforge.net> | 2005-10-04 02:12:44 +0000 |
commit | a7dc40f29086515c31667490c03211812b84e2ed (patch) | |
tree | 71e6e490e08d6afb03295098f6beb204f616ad6b | |
parent | 31beef22c1f976ee0d0b7d10157e726f234cff4e (diff) |
added the remainder of the files (or almost) from GF 0.8.0
svn path=/trunk/; revision=3651
-rw-r--r-- | externals/gridflow/COPYING | 340 | ||||
-rw-r--r-- | externals/gridflow/ChangeLog | 454 | ||||
-rw-r--r-- | externals/gridflow/Makefile.gf | 166 | ||||
-rw-r--r-- | externals/gridflow/README | 46 | ||||
-rw-r--r-- | externals/gridflow/TODO | 507 | ||||
-rwxr-xr-x | externals/gridflow/bin/backtrace | 18 | ||||
-rwxr-xr-x | externals/gridflow/bin/demangle | 4 | ||||
-rwxr-xr-x | externals/gridflow/bin/jmax2pd | 29 | ||||
-rwxr-xr-x | externals/gridflow/bin/plusminus | 39 | ||||
-rw-r--r-- | externals/gridflow/bundled/pd/g_canvas.h | 602 | ||||
-rwxr-xr-x | externals/gridflow/configure | 1136 | ||||
-rw-r--r-- | externals/gridflow/devices4ruby/ChangeLog | 12 | ||||
-rw-r--r-- | externals/gridflow/devices4ruby/README | 27 | ||||
-rw-r--r-- | externals/gridflow/doc/Makefile | 2 | ||||
-rw-r--r-- | externals/gridflow/doc/gridflow.css | 15 | ||||
-rw-r--r-- | externals/gridflow/images/README | 53 | ||||
-rw-r--r-- | externals/gridflow/images/lucida-typewriter-12.grid.gz | bin | 0 -> 2203 bytes | |||
-rw-r--r-- | externals/gridflow/images/test.mpeg | bin | 0 -> 345 bytes | |||
-rw-r--r-- | externals/gridflow/images/tux.tga.gz | bin | 0 -> 20629 bytes |
19 files changed, 3450 insertions, 0 deletions
diff --git a/externals/gridflow/COPYING b/externals/gridflow/COPYING new file mode 100644 index 00000000..eeb586b3 --- /dev/null +++ b/externals/gridflow/COPYING @@ -0,0 +1,340 @@ + 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 + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + 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. + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/externals/gridflow/ChangeLog b/externals/gridflow/ChangeLog new file mode 100644 index 00000000..32329982 --- /dev/null +++ b/externals/gridflow/ChangeLog @@ -0,0 +1,454 @@ +/* $Id: ChangeLog,v 1.1 2005-10-04 02:12:43 matju Exp $ */ + +version 0.8.0 (2005.06.06): + + * removed support for jMax 2.5 and jMax 4.1 + * added GCC 3.4 support + * added AMD64 support + * added support for puredata "datastructure" pointers (aka gpointer) + * changing the @-prefix for a #-prefix, where the old prefix still works + (the old syntax is backwards-compatible, + the new syntax is forwards-compatible) + * 13 object-classes rewritten from Ruby to Pd abstractions + * merged [@],[@!] -> [#] and added message "op" + * removed all one-input ops (see next...) + * new two-input ops: abs- sq- avg hypot sqrt rand (soon erf* clip+ clip-) + * [#fold],[#scan]: removed seed arg and right outlet; added msgs "op" and "seed" + * [#inner],[#convolve] : added msgs "op" and "seed" + * [#inner],[#convolve] : removed three first args (usually * + 0) + * [#inner] : removed middle inlet + * major changes to the bridge API (Ruby<->PureData) + * project "Linux Devices For Ruby" got merged in, as devices4ruby/ + * source code cleanup + * internals: split Grid into Grid+GridPtr + * internals: GridObject no longer manages GridOutlet + * internals: added classes P,PtrGrid,... + * internals: beginning to use C++'s Standard Template Library (sometimes) + * [gridflow] now has "formats" msg (to list available formats) + * [#store] added msg "op" + * [#out x11] removed flag "verbose" + * some spaces may now be omitted in gf-lists. e.g.: + ( ( 2 1 ) ( ) ) ( 3 4 ( 5 ) ) can be shortened to: ((2 1) ()) (3 4 (5)) + * new object classes: + [display], [#reverse], [#unpack], [#centroid2], [ls], [renamefile], [unix_time], + [exec], [plotter_control], [#text_to_image], [#hueshift], [rubyarray] + * in pd_examples added Alx's epicycloid.pd, scratch_video.pd, threshold.pd + and Matju's goop.pd + +version 0.7.7 (2004.08.24): + + * GridFlow runs on MacOS 10.2 with PureData 0.37 + * updated drag_rectangle.pd, nervous_video.pd, fire.pd, color_correction.pd + * updated feedback_fractal.pd (added morphing) + * added pd_examples/waves.pd, pd_examples/sand.pd + * added pd_examples/color_detect.pd (supersedes chroma_key.pd) + * added pd_examples/spectrogram.pd, pd_examples/photo_pianoroll.pd + * removed [rtmetro] (obsolete) + * [@store]: added methods: put_at, reassign + * [pingpong]: added $1 + * [demux] renamed to [shunt] and extra optional arg added (for initial value) + * new object classes: + [range], [#mouse], [#pack], [#color], [bindpatcher], + [#camera], [#fade_lin], [#peephole] + * videodev: added method "get" + * [@out quartz] now works properly + * [@downscale_by] accepts any number of channels + * [@inner2] removed; instead use [@transpose] with [@inner] + * videodev: "transfer" message allows to change the queue's length + * quicktime(hw): added messages "parameter", "framerate", "size" + * quicktime(hw): fixed encoding bug + * png: fixed memory leak + * ./configure --lite disables float32 float64 int64 + * ./configure --verbose prints useless details + * doc: rewrote installation instructions + * x11: fixed memory leak in resizing window + * on MacOS 10 [@out window] now defaults to [@out quartz] + * doc: added credits section + +version 0.7.6 (2004.03.22): + + * GridFlow runs on MacOS 10.2 (only with jMax 2.5) + * [@out quartz] makes a native MacOS (Cocoa+Quartz) window (warning: very buggy) + * support for Apple QuickTime movie decoding (format/quicktimeapple.c) + * file suffix detector is now extensible + * added: Ruby interface for libUSB (base/usb.c) + * x11: now emits "keypress" and "keyrelease" messages + * [@downscale_by] now supports 4 channels (therefore [peephole] does too) + * fixed bugs in: x11, @draw_image, @import, @export, ... + * "open x11" now allows any DISPLAY spec + * now includes the pictures used in the examples + (not a separate download anymore) + * [@out x11 here override_redirect] (override window manager; be careful with this) + * [pd_netsocket] does like [netsend]/[netreceive] but two-way + (warning: not complete yet) + * support for nested lists in incoming messages + * new object classes: + [delcom_usb]: support for Delcom USB I/O controller + [joystick_port]: support for linux joystick drivers + [foreach], [rubysprintf], [listflatten] + [messageprepend], [messageappend], [@transpose] + [@fade], [@centroid] + jMax emulation: [listmake], [listlength], [listelement], [listsublist] + jMax emulation: [listprepend], [listappend], [listreverse], [oneshot] + jMax emulation: [inv+], [inv*] + * Pd main window: adding GridFlow menu, Ruby/Tcl evaluators (with command-history) + * added bin/jmax2pd (converts .jmax files to .pd files) + * ported all .jmax examples to .pd (using jmax2pd) (20 out of 20) + * support for variable number of inlets/outlets (only with PureData) + +version 0.7.5 (2003.09.28): + + * type aliases: int32,i32,i; int16,i16,s; uint8,u8,b; float32,f32,f + * added support for float64 (alias f64, d) + * added support for int64 (alias i64, l) + * doc: added number type table + * @convolve: supports even-sized grids + * fixed bug: puredata gf clock ran way too fast + * rewrote the profiler subsystem (and removed bugs) + * @scale_by: now works with any number of channels + * renamed samples/ to jmax_examples/ + * Algebraic Properties Descriptions (internal, used for accelerations) + * @convolve,@outer,@for,@inner,@draw_polygon: much faster + * quicktime: support for pluggable codecs (eg: dv, divx, rpza, ...) + * quicktime: fixed more bugs + * quicktime: major speed increase + * quicktime: added "colorspace" option + * videodev: fixed bugs + * videodev: removed obsolete option "noinit" + * videodev: added option "colormodel" (especially because of new camera drivers) + * sdl: added automatic resizing of window + * png: read support + * jMax bridge: more stable than ever + * PureData bridge: *much* more stable than ever + * Operator1, Operator2 renamed to Numop1, Numop2 + * x11: now also called "window", so you can write "@out window", "open window" + * new object classes: + @draw_image: picture-in-picture, with alpha blending, etc + jmax4_udpsend: send to a jMax 4.0.x system via UDP + jmax4_udpreceive: receive from a jMax 4.0.x system via UDP + pd_netsend: send to a pd system via UDP + pd_netreceive: receive from a pd system via UDP + @eight: (like @four, but with eight of them ;-) + peephole: like [@out x11] but as inset of a patcher (jMax 2.5 only) + * support for upcoming jMax 4.1 + * "open file" autodetects how to handle a file, by filename suffix + +version 0.7.2 (2003.04.24): + + * fixed bugs in: make install, jpeg reading + * added support for float32 + * added direct .jmax decoding + * added direct .pd encoding + * pd examples moved to separate directory + * ported some .jmax examples to .pd (automated) (8 out of 20) + * added motion_detect.pd + * new classes: demux, and more jmax emulations + * @in,@out: keyword "option" may be omitted + * configure: added --ruby-prefix + * adding custom C++ pre-preprocessor + * better type checking of message arguments (better error reporting too) + * @print supports 3 dimensions, and msg "base" with arg 2,8,10,16 + * can now write loadbang-messages into an object box using the comma + * major cleanup of the source code + * added operator *>>8 (multiplication by value then division by 256) + * new classes: @rgb_to_yuv, @yuv_to_rgb + * @rotate now works with multiple axis (can work on 3D points, etc) + +version 0.7.1 (2003.03.24): + + * fixed important bugs (crashes and such) + * @store,@ can now receive in inlet 1 while sending from outlet 0. + * @, when inlet 1 grid size is small but not 1, is now much faster. + * added memcpy() usage logging (see profiler_dump) + * added examples: drag_rectangle.jmax, plot.jmax, eclipse.jmax + * added example: cellular_1d.pd + * added classes: fork, jmax_udpsend, jmax_udpreceive + * added classes: @rotate, @remap_image, @type + * added operators: gcd,lcm (common divisors/multiples) + * quicktime: added encoding, added seek, fixed bugs + * @in inlet 1 tells frame number (int), end-of-file (bang) + * @in: added: set, option loop (controlling auto-rewind) + * updated cross_fade.jmax (much faster) + * @two,@three,@four allow inlet 0 bang trigger + * configure: simpler config for jMax 2.5 + * PD help patches (by Uli Berthold) + * PD: "make install" takes care of help patches and library + * CVS web interface on artengine.ca (thanks to Alex) + +version 0.7.0 (2003.02.01): + + * new classes: @cast, @join, @ravel, @grade, @perspective + * new grid protocol supports several number types (added uint8,int16) + * added number type support in most classes + * added "option cast" for @in in some formats + * can now specify number types in grid literals + * added some MMX support (accelerates by 0%..40%) + * @import: added optional 2nd arg specifying type. + * @import: can convert symbols to grids of their ascii codes. + * new [@import per_message] yields one grid per incoming message + * [fps]: added options "user" "system" "cpu" for selecting clock + * aalib: added options autodraw, draw, dump + * aalib: added raw input (two channels: characters, attributes) + * x11: added support for 256-color mode using a private colormap. + * x11: added "use_stripes" for alternate 256-color rendering. + * fixed problems with earlier versions of Ruby (like 1.6.2) + * new samples: polygon.jmax + * videodev_effects.jmax: added sort-effects, centre-of-gravity-tracking + * the time profiler is back to working !!! + * @scale_by, @downscale_by: added right inlet, for configuration + * @store is a bit faster + * ppm: accelerated by large amount + * @outer,@inner,@inner2,@fold accelerated by obscene amount + +version 0.6.5 (2003.01.10): + + * can now encode Targa-24, Targa-32, JPEG-24 + * can now output through aalib (ascii art library) + * fixed problems with libruby.a + * tested with the new version of Ruby (1.8) + * new classes: + fps, @rgb_to_greyscale, @greyscale_to_rgb, @solarize, + @complex_sq, @export_symbol, @draw_polygon, + @apply_colormap_channelwise + * new class FPatcher, a ruby patcher/abstraction system + * @scale_to,@contrast,@spread,@posterize now available in + PureData & Ruby; they also now accept arguments. + * [@scale_to]: back to working; inlets "height" and "width" merged + * [route grid_begin] replaced by [route grid] + * [route grid_end] replaced by [@finished] + * Most everything is 10-50% faster + * changes in the internal transmission of grids + * new two-input operators: div, swapdiv, put, ignore + * compilable on MacOS 10 + +version 0.6.4 (2002.12.23): + + * can now decode JPEG (using libjpeg.so) + * many bugs fixed (especially in file formats) + * operators: log* added; tanh renamed to tanh* + * @two,@three,@four are no longer specific to the jMax side + * format grid: option headerless for reading any kind of file + * format grid: option headerful (revert to actual .grid format mode) + * fixed problems with GNU C++ version 3 + * format ppm: accelerated writing + * format modifier gzfile: gzip support also works with [@out] + * format x11: the "here" specifier is now optional + * added @checkers + * [@scale_by {y x}] for different y,x scale factors + * [@in blah blah] means "open blah blah" -> [@in] (and same with @out) + * added @downscale_by with or without smoothing + * format targa: can now decode 32 bit RGBA + * @layer: combines RGBA foreground with RGB background, yielding RGB. + * format grid options: endian big, endian little, endian same + * formats ppm,grid: use 'option rewind' to overwrite same file + (by default, rewind is no longer done after each frame) + ('option rewind' also rewinds on reading) + +version 0.6.3 (2002.12.06): + + * removing the custom leak detector ("Valgrind" program used instead) + * removed all (?) memory leaks + * videodev: new options: frequency, transfer [read|mmap], noinit + * profiler summary code rewritten + * profiler wrapper code removed + * x11: option setcursor <0-63>, option hidecursor + * x11: outlet 0 tells cursor position / button state + * more C++ification of the code + * many bugs fixed (especially crashes) + +version 0.6.2 (2002.09.17): + + * jMax objects written in (or using) Ruby now can work in PureData too. + * new format: SDL (portable output to window) + * can now compile bridges without libruby.so + * changed grid-protocol: added direct object-to-object streaming. + * bug: gridflow's clock tick back to a decent value (sorry) + * all inlets supporting grids also convert int/float as 0-D grids + * @fold and @scan now accept grids in right inlet and constructor + * @convolve is 2-3 times faster + * %,swap% are now called rem,swaprem; new %,swap% is the true modulo. + * @for now allows vectorial from/to/step values + * @identity_transform removed, change to eg: [@for{0 0}{240 320}{1 1}] + * PD users: grid literals are written like: + [@for ( 0 0 ) ( 240 320 ) ( 1 1 )] with all those spaces + * @inner,@inner2,@convolve can take right inlet grid as 4th argument + * re-enabled and improved the memory leak detector (use --debug) + * fixed many bugs and leaks + * fixed bugs in @store + * added sample: zoom.pd + +version 0.6.1 (2002.08.29): + + * now compiling GridFlow as C++ (replacing C) + * now you can use Ruby 1.7, which is faster + note: if you do so, make sure your version is dated 2002 + * new objects: rubyprint, printargs, @print, @scan, @inner + * new format: apple quicktime (using libquicktime.so) + * @in gzip support (example: "open ppm gzfile teapot.ppm.gz") + also works with targa and grid + * BitPacking now supports 1 to 4 channels instead of just 3 + * using mkmf.rb makefile generation; some MSWindows support thru Cygwin + * added geiger counter simulator in [rtmetro] + * libruby.so is only needed when using GridFlow through jMax + * now can do grid literals in @ and @outer, like [@ + {0 1}] + * syntax of @redim,@import changed from [@redim 2 3] to [@redim {2 3}] + * "3 3 # 1 0 0 1" into inlet does automatic @redim, for all objects + * grid literals accept {2 3 # 1 4 5} as an implicit [@redim {2 3}] + * objects rewritten in Ruby language: @in, @out + * updated samples, templates, documentation. + * fixed bugs + +version 0.6.0 (2002.07.31): + + * THIS IS AN EXPERIMENTAL BRANCH (VERY BUGGY) + REAL PROJECTS SHOULD USE VERSION 0.5.0 INSTEAD + * GridFlow rewritten as a plugin for Ruby instead of jMax. + * GridFlow now includes a Ruby-for-jMax bridge. + * you need Ruby 1.6.6 (including libruby.so) or compatible + * you don't need GNU Bash anymore (configurator is now a Ruby program) + * format handlers for .ppm, .tga, .grid rewritten in Ruby + * merged all Makefiles together, etc. + * sources are in base/ and format/ instead of c/src/ + * many bugs removed, many bugs added. + * will read ~/.gridflow_startup if it exists + +version 0.5.0 (2002.06.08): + + * big changes to the internals (especially use of macros) + * can compile without X11; added --no-x11 in ./configure + * removed support for jMax 2.4 + * auto-detects jMax 2.5 and jMax 3.0 + * @inner renamed to @inner2 (new, proper @inner coming soon) + * faster unary operators + * added unary operator: sq (faster squaring) + * further separation of GridFlow from jMax + * major format API changes (added Stream class) + * format "grid" now supports 8 bits per value + * support for HeroineWarrior's LibMPEG3 (reading + seeking) + * libmpeg.so (Greg Ward's) now also looked up as "libwardsmpeg.so" + * added objects: rtmetro, pingpong + * Moved CVS repository from Hostname.2y.net to Artengine.ca + * updated samples + +version 0.4.1 (2002.01.02): + + * cvs repository now has public access + * now can run configure without jmax/fts being present + * standalone version now works on Silicon Graphics and Corel Netwinder. + * MPEG format readonly (single file at a time; mpeg video layer only) + * grid TCP: non-blocking read + * fixed all known memory leaks + * X11 Shared Memory now disables itself properly on remote display + * updated help files + * updated help screenshots in the manual + * fixed profiler bugs + * fts emulation moved to c/src/ and tests moved to tests/ + +version 0.4.0 (2001.11.28): + + * package name changed from "video4jmax" to "gridflow" + * documentation *rewritten*, more precise, more structured + * documentation format is now XML (includes HTMLized version) + * can now compile without jmax/fts (if you need quicker testing...) + * added format "grid" for storing any kind of grid to disk. + * added TCP client/server socket support (with format "grid" only) + * added (timewise) profiler + * @convolve now takes up to three arguments + * Format API changes again + * "connect" merged into "open" + * "size" merged into "option" + * @video_out merged into @out + * format videodev can now do full framerate (instead of just half) + * added X11 Shared Memory support (faster image transfer locally) + * added @scale_by for quick scaling by integer factors. + * @identity_transform, @scale_to are much faster. + * many other accelerations + +version 0.3.0 (2001.11.04): + + * reworked File Format API + * grid objects now all accept lists of integers (auto-convert to 1D grid) + * many accelerations (incl large speedup on chains of binary operations) + * transformed @video_out (X11) into a "File Format" (really) and: + * allows multiple displays + * auto-resizing window + * can set output as wallpaper + * can read from the screen (screenshot) + * @video_out now a backward-compatibility wrapper + * format videodev now uses double buffer mmap (somewhat faster) + * @video_in_file, @video_out_file renamed to @in, @out (with aliases) + * new objects: + @convolve, @inner, @for + * more samples: Fire, Ripple, Game of Life, Chroma Key, Convolve, Saturation + * much improved samples: Color Correction, Linear Transform. + * use [@store uint8] for low-ram storage of values 0-255. + * videodev: added option norm 0=pal 1=ntsc 2=secam 3=auto + +version 0.2.2 (2001.08.15): + + * @video_out auto-updates on X11 ExposeEvent + * updated documentation and help + * fixed installation/config of help and summary + * split BitPacking module from @video_out + * added support for BTTV input (that is, using mmap() command) + * new videodev options: channel,tuner,contrast,hue,etc. + * now with 30 binary operators, and 3 unary operators + * added many new samples + * new objects: + @!, @fold, @outer, @dim, @redim, + @posterize, @contrast, @two, @three, + @identity_transform, @scale_to, @spread + +version 0.2.1 (2001.08.01): + + * added private CVS repository on hostname.2y.net + * added configuration script (detects video4linux 1.x) + * added documentation in HTML format + * added File Format API + * format "ppm": PPM P6 RGB24 support read-write + * format "targa": Targa RGB24 support read-only + * format "videodev": Video4linux read (using read() command only) + * @store no longer slowing down its downstream + * many other accelerations + * Tuple changed to Dim; Index removed + * Grid element type is typedef Number + * @ supports grids in right inlet + * now there are 20 binary operators + +version 0.2.0 (2001.05.05): + + * package name changed from "video" to "video4jmax" + * new kind of post() cancels repetitive log entries + * major modifications to existing objects + * new "grid transmission system" + (Tuple,Index,GridInlet,GridOutlet,GridObject) + * vout -> @video_out + * vin_file -> @video_in_file + * vout_file -> @video_out_file + * added @import, @export + * added @, @store + +version 0.1.1 (2001.04.03): + + * removed vout's grab + * vout width and height parameters swapped + * vout_file class is mostly like vout but writes to a file in PPM format. + +version 0.1.0 (2001.03.14): + + * fixed the bits_per_pixel bug + * merged in some other variations on the main sample + * included Christian's makefiles for jmax 2.5 + +version 0.0.7 (2001.03.08): + + * vout should support most types of RGB visuals now + * autodraw now works: 0=none; 1=page; 2=line; 3=pixel + * less global variables + * putting all of this under the GPL + +version 0.0.5 (2001.03.05): + + * vout class, two params: width, height; 24-bit BGR only; refresh by +finishing scanline or sending bang; "grab" (hack); "reset" for resetting +the pixel pointer. diff --git a/externals/gridflow/Makefile.gf b/externals/gridflow/Makefile.gf new file mode 100644 index 00000000..a7c55274 --- /dev/null +++ b/externals/gridflow/Makefile.gf @@ -0,0 +1,166 @@ +# $Id: Makefile.gf,v 1.1 2005-10-04 02:12:43 matju Exp $ +# This is an annex that covers what is not covered by the generated Makefile + +SYSTEM = $(shell uname -s | sed -e 's/^MINGW.*/NT/') +INSTALL_DATA = install -m 644 +INSTALL_LIB = $(INSTALL_DATA) +INSTALL_DIR = mkdir -p + +all2:: gridflow-for-puredata # doc-all + +# suffixes (not properly used) +ifeq (1,1) # Linux, MSWindows with Cygnus, etc +OSUF = .o +LSUF = .so +ESUF = +else # MSWindows without Cygnus (not supported yet) +OSUF = .OBJ +LSUF = .DLL +ESUF = .EXE +endif + +#----------------------------------------------------------------# + +CFLAGS += -Wall # for cleanliness +# but it's normal to have unused parameters +#ifeq ($(HAVE_GCC3),yes) +#CFLAGS += -Wno-unused-parameter +#else +CFLAGS += -Wno-unused +#endif + +ifeq ($(HAVE_DEBUG),yes) + CFLAGS += -O0 # debuggability +else + CFLAGS += -O3 -funroll-loops # speed +endif + +CFLAGS += -fno-omit-frame-pointer +CFLAGS += -g # gdb info +CFLAGS += -fPIC # some OSes/machines need that for .so files + +#----------------------------------------------------------------# + +cpu/mmx.asm cpu/mmx_loader.c: cpu/mmx.rb + $(RUBY_INSTALL_NAME) cpu/mmx.rb cpu/mmx.asm cpu/mmx_loader.c + +cpu/mmx.o: cpu/mmx.asm + nasm -f elf cpu/mmx.asm -o cpu/mmx.o + +clean2:: + rm -f $(OBJS) base/*.fcs format/*.fcs cpu/*.fcs + +install2:: ruby-install puredata-install + (cd devices4ruby; make install) + +uninstall:: ruby-uninstall + # add uninstallation of other files here. + +unskew:: + find . -mtime -0 -ls -exec touch '{}' ';' + +kloc:: + wc base/*.[ch] format/*.[cm] bridge/*.c optional/*.c 2>/dev/null + wc base/*.rb format/*.rb bridge/*.rb devices4ruby/*.rb \ + optional/*.rb configure extra/*.rb 2>/dev/null + +edit:: + (nedit base/grid.[ch] base/number.c base/flow_objects.c \ + base/flow_objects.rb base/main.c \ + */main.rb base/test.rb &) + +CONF = config.make config.h Makefile +BACKTRACE = ([ -f core ] && gdb `which ruby` core) +TEST = base/test.rb math + +test:: + rm -f core + ($(RUBY_INSTALL_NAME) -w $(TEST)) || $(BACKTRACE) + +VALG = NO_MMX=1 valgrind --suppressions=extra/gf.valgrind2 -v +VALG += --num-callers=8 +VALG += --show-reachable=yes +# VALG += --gdb-attach=yes + +vtest:: + rm -f core + ($(VALG) $(RUBY_INSTALL_NAME) -w $(TEST) &> gf-valgrind) || $(BACKTRACE) + less gf-valgrind + +vvtest:: + rm -f core + ($(VALG) --leak-check=yes $(RUBY_INSTALL_NAME) -w $(TEST) &> gf-valgrind) || $(BACKTRACE) + less gf-valgrind + +test16:: test + (ruby-1.6.7 -w $(TEST)) || $(BACKTRACE) + +testpd:: + rm -f gridflow.pd_linux && make && \ + rm -f /opt/lib/ruby/site_ruby/1.7/i586-linux/gridflow.so && \ + make && make install && \ + (pd -path . -lib gridflow test.pd || gdb `which pd` core) + +munchies:: + $(RUBY_INSTALL_NAME) base/test.rb munchies + +foo:: + @echo "LDSOFLAGS = $(LDSOFLAGS)" + +#----------------------------------------------------------------# + +ifeq ($(HAVE_PUREDATA),yes) +# pd_linux pd_nt pd_irix5 pd_irix6 + +ifeq (${SYSTEM},Darwin) + OS = DARWIN + PDSUF = .pd_darwin + PDBUNDLEFLAGS = -bundle -undefined suppress +else + ifeq (${SYSTEM},NT) + OS = NT + PDSUF = .dll + PDBUNDLEFLAGS = -shared -I$(PUREDATA_PATH)/src + PDLIB = -L/usr/local/lib $(LIBRUBYARG_SHARED) $(PUREDATA_PATH)/bin/pd.dll + else + OS = LINUX + PDSUF = .pd_linux + endif +endif + +PD_LIB = gridflow$(PDSUF) + +$(PD_LIB): bridge/puredata.c.fcs base/grid.h $(CONF) + $(CXX) -Ibundled/pd $(LDSOFLAGS) $(BRIDGE_LDFLAGS) $(CFLAGS) $(PDBUNDLEFLAGS) \ + $< -xnone -o $@ + +gridflow-for-puredata:: $(PD_LIB) + +DOK = $(PUREDATA_PATH)/doc/5.reference/gridflow + +puredata-install:: + mkdir -p $(DOK)/flow_classes + cp pd_help/*.pd $(DOK) + cp doc/*.html $(DOK) + cp doc/flow_classes/*.p* $(DOK)/flow_classes + cp -r images/ $(PUREDATA_PATH)/extra/gridflow + cp $(PD_LIB) pd_abstractions/*.pd $(PUREDATA_PATH)/extra + for z in camera_control motion_detection color mouse centroid centre_of_gravity fade \ + apply_colormap_channelwise checkers contrast posterize ravel remap_image solarize spread \ + rgb_to_greyscale greyscale_to_rgb rgb_to_yuv yuv_to_rgb; do \ + cp pd_abstractions/\#$$z.pd $(PUREDATA_PATH)/extra/\@$$z.pd; done + mkdir -p $(PUREDATA_PATH)/extra/gridflow/icons + $(INSTALL_DATA) java/peephole.gif $(PUREDATA_PATH)/extra/gridflow/icons/peephole.gif + +else + +gridflow-for-puredata:: + @#nothing + +puredata-install:: + @#nothing + +endif # HAVE_PUREDATA + +beep:: + @for z in 1 2 3 4 5; do echo -ne '\a'; sleep 1; done diff --git a/externals/gridflow/README b/externals/gridflow/README new file mode 100644 index 00000000..c334cecf --- /dev/null +++ b/externals/gridflow/README @@ -0,0 +1,46 @@ +,-o----o----o----o-. +| GridFlow 0.8.0 | +`-o--------------o-' + | +.---------------------------------------------------------------- +| Directory layout + + ./base ............. object classes written in C++ and Ruby + ./bin .............. programs startable as applications + ./bridge ........... connectors between Ruby and PureData/etc + ./bundled .......... files from other packages, bundled here for convenience + ./cpu .............. cpu-specific code + ./CVSROOT .......... project information for version control + (not in official releases) + ./format ........... format handlers written in C++ and Ruby (optional) + ./devices4ruby ..... misc Ruby plugins for hardware interfaces + ./doc .............. complete documentation in HTML, with XML source + ./doc/images ....... images that go with the HTML doc + ./extra ............ useful small programs (mostly in Ruby) + ./images ........... sample images shared by ./samples, ./help, ./doc + ./optional ......... optional classes but not format handlers + ./pd_abstractions .. Pd object classes written in Pd + ./pd_help .......... Pd-style help (old; the new goes in ./doc) + ./pd_examples ...... more complex Pd programs showing off more practical uses. + + + +Legalese + + 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. + + 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 COPYING for further informations on licensing terms. + + + +CVS + + $Id: README,v 1.1 2005-10-04 02:12:43 matju Exp $ diff --git a/externals/gridflow/TODO b/externals/gridflow/TODO new file mode 100644 index 00000000..0a4c01d6 --- /dev/null +++ b/externals/gridflow/TODO @@ -0,0 +1,507 @@ +/* $Id: TODO,v 1.1 2005-10-04 02:12:43 matju Exp $ */ + +matju cvs update -dP : +P format/quicktimeapple.c +cvs update: warning: pd_examples/binary_operations.pd was lost +C pd_examples/color_correction.pd +C pd_examples/convolve.pd +C pd_examples/drag_rectangle.pd +C pd_examples/eclipse.pd +C pd_examples/linear_transform.pd +C pd_examples/waves.pd + +Checking in README; +/home/cvs/gridflow/README,v <-- README +new revision: 1.22; previous revision: 1.21 +done +$helo_domain: web.artengine.ca +$from_address: matju@web.artengine.ca (matju) +loginfo.rb is writing changelog...done +loginfo.rb is parsing log message...done +loginfo.rb is testing modules...log info for `/home/cvs/gridflow/README' is not ready +done +loginfo.rb is composing a mail...done +loginfo.rb is posting email to gridflow ...ERROR: cannot send email using MTA on ns +450 <gridflow>: Recipient address rejected: User unknown in local recipient table + +done +loginfo.rb is deleting tmp files...done + +AMD64 : + char 1 1 + short 2 2 + int 4 4 + long 4 8 + long long 8 8 + float 4 4 + double 8 8 + void * 4 8 + +<ClaudiusMaximus> hmm, sending a [reassign( message to the right inlet of a [#store] segfaults Pd + +<ClaudiusMaximus> hmmm, i get a segfault with a simple patch sending "reassign, put_at ( 0 0 ), reassign" to the right inlet of [#store ( 3 3 # 0 )] + +<alx1> matju: for the ./configure, I often get an error from aalib since common installs do not put the headers +<alx1> matju: would it be possible to make it a user defined choice like --with-aalib and turn it off by default? +<alx1> matju: not noticing that configure returns an error leads to an error when compiling +<alx1> back to the [display] object, it lingers for a moment after deletion +<alx1> and returns a 'pd_activate' error after I move it +<alx1> matju: once I delete it, unlike the other gui objects, it takes about one second before it dissapears, maybe a difference in tcl versions? + +for 0.8.0: + +drag_rectangle.pd is fucked (x11 error) +FObject#send_out2 : bself is NULL, rself=4097cbe8 +[gf] ruby: ObjectSpace._id2ref(0x4097cbe8/2) +[gf] returns: #<GridFlow::FormatX11 [FormatX11 out]> + +test with waves.pd, 24 by 32. +==1673== 809108 bytes in 187 blocks are still reachable in loss record 64 of 64 +==1673== at 0x40026DAA: __builtin_vec_new (vg_replace_malloc.c:203) +==1673== by 0x40026E01: operator new[](unsigned) (vg_replace_malloc.c:216) +==1673== by 0x41FE269F: Grid::init(P<Dim>, NumberTypeE) (base/grid.h.fcs:910) +==1673== by 0x41FCBE27: Grid::init_from_ruby_list(int, unsigned long*, NumberTypeE) (base/grid.c.fcs:100) +==1673== by 0x41FCC679: Grid::init_from_ruby(unsigned long) (base/grid.c.fcs:117) +==1673== by 0x41FE223F: Grid::Grid(unsigned long) (base/grid.h.fcs:888) +==1673== by 0x42093152: convert(unsigned long, Grid**) (base/grid.h.fcs:921) +==1673== by 0x4208F72B: GridOuter::initialize_wrap(int, unsigned long*, unsigned long) (base/flow_objects.c.fcs:862) + +[ ] try removing or modifying -falign on PPC/OSX +[ ] c++ typecasting is nuts (see class Pt<T>) +[ ] make c++ refcount and ruby gc to cooperate. +[ ] encoding of quicktime RGBA only works with [#cast b]. +[ ] add classmethod support to source filter +[ ] document the source filter +[ ] make example on separable convkernels +[ ] add concepts of hot inlet and conf inlet at the code level +[ ] [display] should use clocks to update tk less often +[ ] [display] leaks in server ? +[ ] optional args don't work in source_filter.rb +[ ] deprecation warnings +[ ] Add a video latency patch (in examples) +[ ] can't have FPatcher and GridObject behaviour at once ?? +[ ] Numop: warn on misalignment +[ ] wrap Dim (?) +[ ] wrap GridInlet (?) +[ ] wrap GridOutlet (?) +[ ] wrap Grid (?) +[ ] wrap Numop +[ ] remove GridInlet* ? +[ ] configure chokes if GCC3 doesn't have the C++ plugin +[ ] [#change] +[ ] [#import~] +[ ] [#export~] +[ ] [#expr] +[ ] 8-align STACK_ARRAY and ARRAY_NEW ? +[ ] #: option swap +[ ] consider including [mysql] [renamefile] [ls] [shell] +[ ] re-enable int64,float64 +[ ] <alx_> #define RUBY_STACK_END "0xbfffd5c0" (!?!?!?) +[ ] remember who i am supposed to credit for making pd_help back in march 2003... alx knows +[ ] added #matrix_solve, #slice +[ ] Copy-on-Write (COW) +[ ] < 10 bugs in buglist +[ ] Fully hyperlinked manual +[ ] internals documentation +[ ] internal grid protocol redesigned +[ ] raise limit of in/outlets from 10 to 100 or unlimited. +[ ] unbork make test and plain ruby mode. +[ ] add support for "anything" methods (def _0_(sel,*a)) +[ ] look into -ftree-vectorize + +for 0.8.1: + + * wrap Pd API completely. + * test.rb should become much more serious. (the @pack bug really sucked) + +Bugs (High Priority) (!!! Fix all of these before 0.8.0 !!!) + +pick a number: [147] + +[147] [#store] blows up in nervous_video (reassign) +[146] [#peephole] resize problem +[145] "list -1"->[@import] only tells error message once every other time +[144] small leak remaining in x11. may have to do with non-use of XDestroyImage. +[141] shouldn't be able to call Pd from a non-main Ruby thread. +[140] is [@convolve] actually cross-convolution? + that is, convolves with a mirror image of the convolution matrix. +[139] [#peephole] + <mis> matju: BUG-ALERT - peephole does not delete until a screen refresh + <mis> matju: I was just about to do that + <mis> matju: it works... almost + <mis> matju: if you try to move the GOPed abstraction the peepholes don't move along + <mis> he :) better yet, the abstraction's bounding box's lower right corner will not move up or to the left of the low right corner of the peephole it contains. Instead it will resize itself as you move it around. +[138] [#peephole] crash +[137] [gf] peeperr: problem with set_geometry, wrong size. +[136] fix C_INCLUDE_PATH vs CPLUS_INCLUDE_PATH +[134] #import with zero size crashes? +[133] numop ** can freeze GF +[129] jmax2pd: [display] should not be translated +[128] jmax2pd(?): loadbang-messages (comma) don't get translated to .pd ?? +[119] osx: SDL doesn't work here +[118] error messages can be unclear (eg. file not open... is it #in's, or #out's?) +[117] osx: [#store] crash instead of raising +[112] Pt<T>: some casts aren't done properly +[107] MMX computations may be done misaligned, which may be bad. +[105] when file not found, mpeg error messages are wrong, they say the filename is "". +[102] osx: error: shmget failed (cannot allocate memory) in X11, for regular pictures +[100] osx: libgridflow.so installs in wrong directory (of course) +[090] doesn't check whether ruby/version.h matches .so / .a +[027] tcp test is broken +[089] is LINK TO="..." not properly handled? see part of install.xml that uses it. +[088] FIX MOULINETTE.RB ! <attr name type default> +[078] "unsupported codec" bogus errors. +[097] bin/backtrace does not detect scripts +[005] can't open "": Success; loading a nonquicktime file using quicktime +[006] #in#open problem with String argument. +[010] separate bridge makefiles from other makefiles!!! +[011] research bugs in nonblock IO with Ruby. (eg. serial port) +[025] format_grid: write test for other bpv's +[026] latency is not that good. (GC ?) +[030] FormatGrid: not properly tested (crashes sometimes) +[031] stdout should be redirected if bridge is present +[032] error handling sometimes leads to crash +[033] error handling shows inanely useless messages (sometimes) +[034] format/mpeg3.c,quicktime.c might cause lockup on exit +[038] some seeds aren't typechecked +[039] jpeg file cat crashes on second file (jpeglib buffering?) +[040] GRID_FINISH triggered while backstore ??? + +Bugs (Low Priority) +[079] can trap segfaults in codecs of libquicktime. +[090] http://poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC30 +[076] EINTR not handled properly in a lot of code? +[041] what would be a way to make GF work well with Pd's idea of a list? +[043] TCP server socket busy even after kill +[045] write unit tests about required functionality +[046] write unit tests about error checking +[047] make system to ensure everything is working before a release. +[048] potential issues between fork() and X11 ? +[050] BitPacking has trouble with masks that extend beyond int25be +[051] remove the crap given by -w of ruby +[054] it's possible to crash by sending data in two inlets of a same object at once +[059] mess with options in format grid +[060] look for "!@#$" in source +[029] #join on small chunks is way too slow +[009] T_DATA #dup #clone ??? + +--- make the development process more test-driven: + * file every feature request and bug report into base/test.rb so + that gridflow fails those tests; + * THEN make gridflow pass those tests. + +=================== + +Community +[ ] put new examples on website + +Distribution +[ ] should now plan which features are pre-1.0 and which are post-1.0 +[ ] review all documentation +[ ] review all examples +[ ] make CDs + +Installation +[ ] make the installer help the user more: + * .h was found + * compiled with .h correctly + * .so|.a was found + * linked with .so|.a correctly +[ ] installable doc +[ ] installable includes ? +[ ] produce linux binaries ("static") +[ ] produce cygwin32 or mingw32 binaries +[ ] produce macosx binaries +[ ] produce linux rpm/deb +[ ] less compile-time checks and more run-time checks +[ ] should GridFlow be bundled with some of its own dependencies? +[ ] reintroduce --puredata-dist-dir ? +[ ] --prefix (pour ruby) +[ ] install vs site-install mess +[ ] bridge should check that the gridflow.so file matches. +[ ] make uninstall +[ ] have option for gprof +[ ] cross-compile: + http://www.libsdl.org/extras/win32/cross/ + http://rooster.stanford.edu/~ben/linux/cross.php + +Documentation +[ ] make a short feature list as a promo +[ ] add credits +[ ] indiquer comment faire un rapport à propos d'une carte v4l ou d'un mode x11 non-supporté +[ ] project_policy.xml +[ ] specify policy for <help>, <icon>, etc. +[ ] things you type verbatim are all in KBD blocks +[ ] placeholders for your own values are all in I blocks +[ ] document our own release procedures, how our CVS works +[ ] document how to report bugs, basic troubleshooting +[ ] document our distribution of the archives +[ ] ascii conventions: [foo] vs "foo", etc. +[ ] document internals +[ ] describe indexmap in doc +[ ] document backward compatibility issues +[ ] typical uses: <typical></typical> +[ ] architecture: class->type/shape->use->role +[ ] it should be indicated whether an object is supported by pd/ruby/c++ +[ ] heavily hyperlink documentation +[ ] automate more parts of the documentation +[ ] benchmarks (especially: simple video i/o) +[ ] mimic [pdp_help_input] [pdp_help_output]: they are convenient +--- remember to keep doc/help/screenshots/examples up to date +[ ] <jtm_> the suggestion would be to add a link at the end of each section leading to the next section + +Source Filter +[ ] add \ruby \end blocks (multiline inlined rubyscripts) +[ ] \attr + +Architecture +[0.8] <pat> aussi les erreurs que donne gf c'est beaucoup de ligne pour juste un file not found ;) +[0.8] reentrancy of objects (to allow true recursion) +[0.8] inlet-variables (variables associated to inlets) +[ ] eliminate the Dim class, replacing by Grid itself (?). +[ ] pull mode (functional-style) +[ ] bidirectional messages (constraint/relational-style) +[ ] send-reply messages (imperative-style) +[ ] add reflection (#global:classes, #global:methods, ...) +[ ] use MétaRuby typing to make things friendlier. +[ ] transmitting grids by diffs? +[0.8] dispatch on _n_-prefixed methods (one selector any inlet) + and _#{i}_-named methods (any selector one inlet) +[0.8] generalize the backstore +[ ] Outlet#buffer should harmonise with the lcm of its corresponding Inlet#factor's. +[ ] lazy grids: Grid#operator Pt<T> makes sure all the grid is received + and Grid#range(int start, int n, T bogus) makes sure the + specified part of the grid is received. +[0.8] accounting: grids messages packets numbers bytes copybytes +[0.8] memory profiling +[0.8] compare Ruby API with both flext/pyext +[ ] add a "query" class for debugging other objects? + (would be able to extract extra info from each object/class) +[ ] add a GridFlow::LaterException or something + (which tells to retry later with the same packet because another + grid reception is not completed yet.) +[ ] interpret nested lists as n-dimensional. +[0.8] MMX memcpy() ? +[0.8] MMX _runtime_ autodetection + +Operators +[ ] User-defined operators; compound operators... e.g. [# {{* 7} + {>> 3}}] +[ ] n-ary operators... make [#] variable-inlet +[ ] binary ops to replace unaries : rand -> ???, sqrt -> ??? +[ ] trinary ops? eg. */ *>> *+ ?: minmax &<< >>& +[ ] numop2: rol, ror +[ ] numop1: weight (in bits) + +Bridge +[ ] UnknownAtom class +[ ] Pd bridge should support list-literals inside messages +[ ] GFBridge object visible from Ruby + +Computation Objects +[ ] #counter (similar to #for) +[ ] #inner inlet 2 -> 1, and other incompatibilities i wanted to introduce +[ ] #for "step" argument should have default {1...} +[ ] zero option in #convolve (?) +[ ] #convolve2 (simpler) +[ ] #convolve rewritten as combination of #convolve2+#border ? +[ ] #convolve(2): should allow n-D convolution +[ ] #complex_sq is backwards +[ ] #store: option zero (?) +[ ] #import~, #export~ +[ ] #fold, #scan: option reverse (right-to-left) +[ ] #join: option swap +[ ] #matrix_inverse, #matrix_solve +[ ] #reverse (on given dimension number) +[ ] #timeline (or rtmetro): sequencing of events from grid +[ ] #replace_if, #random_select, #markov_chain, #unpack, #sort, #slice, #splice +[ ] #polygon_perimeter, #polygon_area, #draw_polygon smoothly +[ ] fuzzy #store (interpolate) +[ ] write a complete benchmark script +[ ] spatial biquads (ask Tom) +[ ] string operations to compensate for the feebleness of PD in that area. + this includes [#sprintf]. +[ ] #pack should become type-conscious (cast option, like #import) +--- see also APL/J/NArray/PDL/Aplus/Yorick/IPOW reference + +Effects +[ ] #mosaic +[ ] #gaussian_blur, #sobel, #pixelize, #despeckle (median) +[ ] #dither, #draw_lines, #draw_points, #fire, #border, #queue +[ ] #chroma_key: i0=RGBpicture i1=RGBcolor i2=tolerance o0=RGBApicture + with fuzzy flag; (don't call it #chroma_key though) + maybe #mask... +[ ] turtle (logo style) +[ ] effectv +[ ] create abstractions for usage patterns (eg: like @remap_image) +[ ] see gimp for ideas +[ ] kaleidoscopes +[ ] FFTW +[ ] bilinear interpolation a+(b-a)*x+(c-a)*y+(a-b-c+d)*x*y (#scale_by smoothly?) +[ ] #scale_by/#downscale_by fractional values +[ ] bicubic interpolation +[ ] multilinear interpolation (n-dimensional?) +[ ] #daltonism +[ ] #perlin ? + +Input/Output +[ ] replace "open <driver> <source> <filename>" by "open <driver> <mrl>" +[ ] videodev: is it possible to reach 60 fps ? +[ ] a #store that is persistent (saved in .pd) ? +[ ] Grid: support storage in all six types +[ ] Grid: bpv 1,2,4 uint +[ ] Grid: text version of the format +[ ] Gimp, GStreamer, ffmpeg, xine, mplayer, GEM, PDP, OSC +[ ] RubyX11 0.6 +[ ] support for output inside of a GUI app (Tk/Gtk/Qt/...) +[ ] get subtitling of tv channels +[ ] add messages "load", "save" as open,bang,close combos. (?) +[ ] use 1.8.0's IO#read(Integer,String)->String +[ ] SDL: should support multiple windows +[ ] x11,sdl,aalib: use buffering to synchronise frames at a constant rate. +[ ] x11: sync with the actual vsync of the monitor +[ ] x11: maybe vram-to-vram copy using X11's Pixmap remote-objects +[ ] shell object? +[ ] #import, 'grid tcp': option: sudden vs gradual transmission through gridflow. +[ ] HPGL, [unixtime] +[ ] [parallel_port], [serial_port], [usb_mouse] + +Format +[ ] remaining number type support in formats +[ ] all: possibly get rid of the "format" notion ? +[ ] PNM: P1,P2,P3,P4,P5 support +[ ] XBM, XPM, GIF support +[ ] fork: pseudoformat for launching format handler as separate process +[ ] put_at/reassign in x11/sdl/quartz +[ ] /dev/dsp, /dev/mixer +[ ] Generic SHM/MMAP Drivers +[ ] "open grid pipe" and such. +[ ] TCP: non-blocking write +[ ] TCP: buffer n grids +[ ] multi: multi-file (by glob pattern, e.g.: foo*.ppm) +[ ] AVI +[ ] format grid: "headerless until 10" (text files) + +User Interface +[ ] color picker +[ ] gridbox (akin to intbox) or grid edition dialog, etc. +[ ] peephole: + [ ] works without x11 (for osx...) + [ ] does it really work with something other than 3 channels ? + [ ] add a popup menu that makes sense +[ ] make ruby/tcl evaluator boxes retractable +[ ] vector slider (n parallel sliders in one, Dim(n)) +[ ] 2d slider +[ ] radial slider (angle chooser) +[ ] drag-and-drop palette of object construction +[ ] object construction menu specialized for each class + (generated from class reflection/metadata) + +Extra/Examples/Etc +[ ] make demo app(s) in Ruby/Tk: bin/playmovie +[ ] .pd: read; write better +[ ] examples/generique.pd +[ ] add examples from the workshop, etc + +how about creating aliases like "open window" = "open x11 here" (or arbitrary +user-defined sequence of messages settable in ~/.gridflow_startup) and "open +videodev" -> "open videodev /dev/video0, option channel 1, option size 240 320" +maybe there should be a separate ~/.gridflow_config that would be saveable from +gridflow, and ~/.gridflow_startup would be edited only by the user but +~/.gridflow_config would still be a text file. i say that +because the startup is a ruby script so gridflow couldn't just do +search-and-replace in there, because the option could be inside a "if" +expression and such... at most, gridflow could _append_ text to +.gridflow_startup, to be non-intrusive... + +Feature Requests + +From: Dave Bergevin <dabergevin@eisa.com> + [ ] synchronized audio with the video when using mpeg1 & 2 + [ ] full screen mode (without the menu bars or frames) +From: Alexandre Castonguay <acastonguay@artengine.ca> + [ ] server side pd to handle multiple incoming commands, audio + video streams + [ ] support for audio in the mpeg streams + +<matju> alx: + le tab completion ne donnerait pas seulement les noms possibles pour le +prochain argument dans le objectbox; il donnerait aussi une description de +l'argument (surtout dans le cas où l'argument a beaucoup de valeurs +possibles) + je pense que le help de Pd est une bonne idée (le concept hands-on) +mais ça pourrait aller plus loin. + j'ai pensé intégrer le manuel de référence de gridflow directement dans +le programme, disponible au runtime, dans l'éventualité d'un GUI qui +saurait en tirer avantage. sinon on pourrait faire des hacks cool genre un +message "help" au inlet 0 enverrait une description de la classe dans le log. + (sauf que dans ce cas: [rubyprint] est tenu d'afficher directement tout +ce qu'il reçoit. alors doit-il écrire "help" ou écrire le help ? + +alx1->matju: détection de plusieurs personnes; détection avec deux caméras +(?); détecter les formes; détecter les couleurs; support mpeg4; hotspots + +> http://redshift.sourceforge.net/debugging-GC/ [ruby-talk:53835] +> You might also want to search the web for "malloc debugger". + +... I am Jack's Overwritten Stack Pointer... + +<ircbridge> <GPS> Tcl_GetObjResult Tcl_GetErrorInfo ... +<ircbridge> <GPS> Tcl_GetStringResult may also be helpful. (note I can't +seem to find Tcl_GetErrorInfo (maybe I dreamed it up)) +<ircbridge> <GPS> matju: BTW CatchObjCmd might help too +<ircbridge> <GPS> I see that the new Tcl_Dict commands have taken over the HEAD's CatchObjCmd + +ClaudiusMaximus reports that allocating a 197M grid causes a crash (turns out C++ +throws exception, can't allocate, signal ABRT) + +ClaudiusMaximus says: I want to be able to send output from Pd+Gridflow to a video4linux +loopback device so that other v4l programs can access the stream. +I found the video loopback device here: http://motion.sourceforge.net/vloopback/ + +<alx2> matju: iSight on linux : +http://episteme.arstechnica.com/6/ubb.x?a=tpc&s=50009562&f=8300945231&m=40110681 +<alx2> matju: apparently it needs something called 'coriander'...I'm checking into it +<alx2> matju: the person who got it working mentions libdc1394 +<alx2> matju: ah coriander is a GUI for firewire +<alx2> matju: on this page : +http://www.tele.ucl.ac.be/PEOPLE/DOUXCHAMPS/ieee1394/cameras/index.html +<alx2> matju: I learn that the iSight is compliant with version 1.30 of IIDC +<alx2> matju: the docs for coriander mention that the author needed to create a major and minor device for the camera. +<alx2> matju: retyping (damn pdf's) -> there are two devices to create: raw1394 and video1394 +<alx2> matju: raw1394 has major 171 and minor 0 while video1394 had major 171 and minor 16 +<matju> thanks +<alx2> matju: any useful info? +<matju> i'll see, doing something else at the moment +<alx2> matju: having a camera like the iSight supported could be fantastic for video capture/detection on a laptop. Not to mention that the bttv cards are getting harder to locate + +-mfpmath=sse2 + +<MiS> <matju> alx2: btw you cannot set helpfiles explicitly on _abstractions_... +<MiS> yes you can +<MiS> and specify -helppath to add a path to help. So selecting 'Help' + in the pop-up on an abstraction will open a help fiel for that abstraction + +"Bangs in a geiger counter have a l*dt probability of occuring + in a dt time interval. Therefore the time till the next event + follows a Exp(l) law, for which: + f(t) = l*exp(-l*t) + F(t) = integral of l*exp(-l*t)*dt = 1-exp(-l*t) + F^-1(p) = -log(1-p)/l + //return (uint64)(1000LL*ms*-log(1-drand()));" +matju 2002 + + +remember to check for volatile VALUEs if GC problems ever occur + +ruby -ve '[30,31,62,63].each {|x| printf "%d bits: %s\n",x,(1<<(x-1)).class }' + +linx: + http://cast.rubyforge.org (parsing C code) + http://ruby-contract.rubyforge.org/doc/ + + +sand.pd differential mode, 0.8: +fps min med max avg stdev +17.57 54.82 55.81 78.00 56.89 3.93 : before +after ... + + diff --git a/externals/gridflow/bin/backtrace b/externals/gridflow/bin/backtrace new file mode 100755 index 00000000..ac1358af --- /dev/null +++ b/externals/gridflow/bin/backtrace @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +if ARGV.length != 1 + puts "usage: core.rb <corefile>" + exit 1 +end +qfile=ARGV[0].gsub /'/, "\\\\'" +x=`gdb --batch -c '#{qfile}'`.split"\n" +m=/`([^']+)/.match x[0] +f=File.open("/tmp/backtrace_#{$$}.gdb","w") +f.puts"bt" +f.puts"quit" +f.close +cmd="gdb #{m[1]} #{qfile} --command=/tmp/backtrace_#{$$}.gdb" +x=`#{cmd}`.split("\n") +i=nil +x.each_with_index {|line,i| break if /^#0/ =~ line } +x[0..i]=[] +puts x diff --git a/externals/gridflow/bin/demangle b/externals/gridflow/bin/demangle new file mode 100755 index 00000000..923bca25 --- /dev/null +++ b/externals/gridflow/bin/demangle @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +f = File.popen "gdb", "r+" +f.puts "maintenance demangle #{ARGV[0]}", "quit" +puts f.read.split("\n")[-2].sub(/^\(gdb\) /,"") diff --git a/externals/gridflow/bin/jmax2pd b/externals/gridflow/bin/jmax2pd new file mode 100755 index 00000000..5510656a --- /dev/null +++ b/externals/gridflow/bin/jmax2pd @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +require "gridflow" +require "gridflow/extra/jmax_format.rb" +require "gridflow/extra/puredata_format.rb" +include GridFlow +#GridFlow.verbose = true + +iname,oname = ARGV +if not iname + raise "usage: jmax2pd <input.jmax> [<output.pd>]" +end +if not oname + oname = iname.sub(/\.jmax$/,".pd") +end +keep=["broken","jpatcher","button","slider","messbox"] +GridFlow.instance_eval{@fclasses_set.delete_if {|k,v| + not keep.include? k +}} +#p GridFlow.instance_eval{@fclasses_set.keys.sort} + +jfr = JMaxFileReader.new(File.open(iname),FObject) +FObject.broken_ok = true +FObject.do_loadbangs = false +my_patcher = jfr.parse +pfw = PureDataFileWriter.new(oname) +pfw.write_patcher my_patcher +pfw.close + diff --git a/externals/gridflow/bin/plusminus b/externals/gridflow/bin/plusminus new file mode 100755 index 00000000..685014ce --- /dev/null +++ b/externals/gridflow/bin/plusminus @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby +# NOTE: this works with diff -u only!!! + +puts "-"*64 + +$plustot=0 +$minustot=0 + +def show + printf "%20s %+5d %+5d (net %+5d)\n", $file, $plus, -$minus, $plus-$minus +end + +loop{ + line = gets + break if not line + if /^diff/.match line then + x = line.split(/\s+/) + $plustot+=$plus if $plus + $minustot+=$minus if $minus + show if $file + $file = x[-1] + $on=false + $plus=0 + $minus=0 + elsif /^\@\@/ =~ line then $on=true + elsif $on and /^\+/ =~ line then $plus+=1 + elsif $on and /^\-/ =~ line then $minus+=1 + end +} + +$plustot+=$plus if $plus +$minustot+=$minus if $minus +show if $file + +$file="total" +$plus=$plustot +$minus=$minustot +puts "-"*64 +show diff --git a/externals/gridflow/bundled/pd/g_canvas.h b/externals/gridflow/bundled/pd/g_canvas.h new file mode 100644 index 00000000..45bcd4a9 --- /dev/null +++ b/externals/gridflow/bundled/pd/g_canvas.h @@ -0,0 +1,602 @@ +/* Copyright (c) 1997-1999 Miller Puckette. +* For information on usage and redistribution, and for a DISCLAIMER OF ALL +* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +/* this file defines the structure for "glists" and related structures and +functions. "Glists" and "canvases" and "graphs" used to be different +structures until being unified in version 0.35. + +A glist occupies its own window if the "gl_havewindow" flag is set. Its +appearance on its "parent" or "owner" (if it has one) is as a graph if +"gl_isgraph" is set, and otherwise as a text box. + +A glist is "root" if it has no owner, i.e., a document window. In this +case "gl_havewindow" is always set. + +We maintain a list of root windows, so that we can traverse the whole +collection of everything in a Pd process. + +If a glist has a window it may still not be "mapped." Miniaturized +windows aren't mapped, for example, but a window is also not mapped +immediately upon creation. In either case gl_havewindow is true but +gl_mapped is false. + +Closing a non-root window makes it invisible; closing a root destroys it. + +A glist that's just a text object on its parent is always "toplevel." An +embedded glist can switch back and forth to appear as a toplevel by double- +clicking on it. Single-clicking a text box makes the toplevel become visible +and raises the window it's in. + +If a glist shows up as a graph on its parent, the graph is blanked while the +glist has its own window, even if miniaturized. + +*/ + +/* NOTE: this file describes Pd implementation details which may change +in future releases. The public (stable) API is in m_pd.h. */ + +#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) +extern "C" { +#endif + +/* --------------------- geometry ---------------------------- */ +#define IOWIDTH 7 /* width of an inlet/outlet in pixels */ +#define IOMIDDLE ((IOWIDTH-1)/2) +#define GLIST_DEFGRAPHWIDTH 200 +#define GLIST_DEFGRAPHHEIGHT 140 +/* ----------------------- data ------------------------------- */ + +typedef struct _updateheader +{ + struct _updateheader *upd_next; + unsigned int upd_array:1; /* true if array, false if glist */ + unsigned int upd_queued:1; /* true if we're queued */ +} t_updateheader; + + /* types to support glists grabbing mouse motion or keys from parent */ +typedef void (*t_glistmotionfn)(void *z, t_floatarg dx, t_floatarg dy); +typedef void (*t_glistkeyfn)(void *z, t_floatarg key); + +EXTERN_STRUCT _rtext; +#define t_rtext struct _rtext + +EXTERN_STRUCT _gtemplate; +#define t_gtemplate struct _gtemplate + +EXTERN_STRUCT _guiconnect; +#define t_guiconnect struct _guiconnect + +EXTERN_STRUCT _tscalar; +#define t_tscalar struct _tscalar + +EXTERN_STRUCT _canvasenvironment; +#define t_canvasenvironment struct _canvasenvironment + +typedef struct _selection +{ + t_gobj *sel_what; + struct _selection *sel_next; +} t_selection; + + /* this structure is instantiated whenever a glist becomes visible. */ +typedef struct _editor +{ + t_updateheader e_upd; /* update header structure */ + t_selection *e_updlist; /* list of objects to update */ + t_rtext *e_rtext; /* text responder linked list */ + t_selection *e_selection; /* head of the selection list */ + t_rtext *e_textedfor; /* the rtext if any that we are editing */ + t_gobj *e_grab; /* object being "dragged" */ + t_glistmotionfn e_motionfn; /* ... motion callback */ + t_glistkeyfn e_keyfn; /* ... keypress callback */ + t_binbuf *e_connectbuf; /* connections to deleted objects */ + t_binbuf *e_deleted; /* last stuff we deleted */ + t_guiconnect *e_guiconnect; /* GUI connection for filtering messages */ + struct _glist *e_glist; /* glist which owns this */ + int e_xwas; /* xpos on last mousedown or motion event */ + int e_ywas; /* ypos, similarly */ + int e_selectline_index1; /* indices for the selected line if any */ + int e_selectline_outno; /* (only valid if e_selectedline is set) */ + int e_selectline_index2; + int e_selectline_inno; + t_outconnect *e_selectline_tag; + unsigned int e_onmotion: 3; /* action to take on motion */ + unsigned int e_lastmoved: 1; /* one if mouse has moved since click */ + unsigned int e_textdirty: 1; /* one if e_textedfor has changed */ + unsigned int e_selectedline: 1; /* one if a line is selected */ +} t_editor; + +#define MA_NONE 0 /* e_onmotion: do nothing on mouse motion */ +#define MA_MOVE 1 /* drag the selection around */ +#define MA_CONNECT 2 /* make a connection */ +#define MA_REGION 3 /* selection region */ +#define MA_PASSOUT 4 /* send on to e_grab */ +#define MA_DRAGTEXT 5 /* drag in text editor to alter selection */ + +/* editor structure for "garrays". We don't bother to delete and regenerate +this structure when the "garray" becomes invisible or visible, although we +could do so if the structure gets big (like the "editor" above.) */ + +typedef struct _arrayvis +{ + t_updateheader av_upd; /* update header structure */ + t_garray *av_garray; /* owning structure */ +} t_arrayvis; + +/* the t_tick structure describes where to draw x and y "ticks" for a glist */ + +typedef struct _tick /* where to put ticks on x or y axes */ +{ + float k_point; /* one point to draw a big tick at */ + float k_inc; /* x or y increment per little tick */ + int k_lperb; /* little ticks per big; 0 if no ticks to draw */ +} t_tick; + +/* the t_glist structure, which describes a list of elements that live on an +area of a window. + +*/ + +struct _glist +{ + t_object gl_obj; /* header in case we're a glist */ + t_gobj *gl_list; /* the actual data */ + struct _gstub *gl_stub; /* safe pointer handler */ + int gl_valid; /* incremented when pointers might be stale */ + struct _glist *gl_owner; /* parent glist, supercanvas, or 0 if none */ + int gl_pixwidth; /* width in pixels (on parent, if a graph) */ + int gl_pixheight; + float gl_x1; /* bounding rectangle in our own coordinates */ + float gl_y1; + float gl_x2; + float gl_y2; + int gl_screenx1; /* screen coordinates when toplevel */ + int gl_screeny1; + int gl_screenx2; + int gl_screeny2; + t_tick gl_xtick; /* ticks marking X values */ + int gl_nxlabels; /* number of X coordinate labels */ + t_symbol **gl_xlabel; /* ... an array to hold them */ + float gl_xlabely; /* ... and their Y coordinates */ + t_tick gl_ytick; /* same as above for Y ticks and labels */ + int gl_nylabels; + t_symbol **gl_ylabel; + float gl_ylabelx; + t_editor *gl_editor; /* editor structure when visible */ + t_symbol *gl_name; /* symbol bound here */ + int gl_font; /* nominal font size in points, e.g., 10 */ + struct _glist *gl_next; /* link in list of toplevels */ + t_canvasenvironment *gl_env; /* root canvases and abstractions only */ + unsigned int gl_havewindow:1; /* true if we own a window */ + unsigned int gl_mapped:1; /* true if, moreover, it's "mapped" */ + unsigned int gl_dirty:1; /* (root canvas only:) patch has changed */ + unsigned int gl_loading:1; /* am now loading from file */ + unsigned int gl_willvis:1; /* make me visible after loading */ + unsigned int gl_edit:1; /* edit mode */ + unsigned int gl_isdeleting:1; /* we're inside glist_delete -- hack! */ + unsigned int gl_stretch:1; /* stretch contents on resize */ + unsigned int gl_isgraph:1; /* show as graph on parent */ +}; + +#define gl_gobj gl_obj.te_g +#define gl_pd gl_gobj.g_pd + +/* a data structure to describe a field in a pure datum */ + +#define DT_FLOAT 0 +#define DT_SYMBOL 1 +#define DT_LIST 2 +#define DT_ARRAY 3 + +typedef struct _dataslot +{ + int ds_type; + t_symbol *ds_name; + t_symbol *ds_arraytemplate; /* filled in for arrays only */ +} t_dataslot; + + +/* T.Grill - changed t_pd member to t_pdobj to avoid name clashed */ +typedef struct _template +{ + t_pd t_pdobj; /* header */ + struct _gtemplate *t_list; /* list of "struct"/gtemplate objects */ + t_symbol *t_sym; /* name */ + int t_n; /* number of dataslots (fields) */ + t_dataslot *t_vec; /* array of dataslots */ +} t_template; + +struct _array +{ + int a_n; /* number of elements */ + int a_elemsize; /* size in bytes; LATER get this from template */ + char *a_vec; /* array of elements */ + t_symbol *a_templatesym; /* template for elements */ + int a_valid; /* protection against stale pointers into array */ + t_gpointer a_gp; /* pointer to scalar or array element we're in */ + t_gstub *a_stub; +}; + + /* structure for traversing all the connections in a glist */ +typedef struct _linetraverser +{ + t_canvas *tr_x; + t_object *tr_ob; + int tr_nout; + int tr_outno; + t_object *tr_ob2; + t_outlet *tr_outlet; + t_inlet *tr_inlet; + int tr_nin; + int tr_inno; + int tr_x11, tr_y11, tr_x12, tr_y12; + int tr_x21, tr_y21, tr_x22, tr_y22; + int tr_lx1, tr_ly1, tr_lx2, tr_ly2; + t_outconnect *tr_nextoc; + int tr_nextoutno; +} t_linetraverser; + +/* function types used to define graphical behavior for gobjs, a bit like X +widgets. We don't use Pd methods because Pd's typechecking can't specify the +types of pointer arguments. Also it's more convenient this way, since +every "patchable" object can just get the "text" behaviors. */ + + /* Call this to get a gobj's bounding rectangle in pixels */ +typedef void (*t_getrectfn)(t_gobj *x, struct _glist *glist, + int *x1, int *y1, int *x2, int *y2); + /* and this to displace a gobj: */ +typedef void (*t_displacefn)(t_gobj *x, struct _glist *glist, int dx, int dy); + /* change color to show selection: */ +typedef void (*t_selectfn)(t_gobj *x, struct _glist *glist, int state); + /* change appearance to show activation/deactivation: */ +typedef void (*t_activatefn)(t_gobj *x, struct _glist *glist, int state); + /* warn a gobj it's about to be deleted */ +typedef void (*t_deletefn)(t_gobj *x, struct _glist *glist); + /* making visible or invisible */ +typedef void (*t_visfn)(t_gobj *x, struct _glist *glist, int flag); + /* field a mouse click (when not in "edit" mode) */ +typedef int (*t_clickfn)(t_gobj *x, struct _glist *glist, + int xpix, int ypix, int shift, int alt, int dbl, int doit); + /* ... and later, resizing; getting/setting font or color... */ + +struct _widgetbehavior +{ + t_getrectfn w_getrectfn; + t_displacefn w_displacefn; + t_selectfn w_selectfn; + t_activatefn w_activatefn; + t_deletefn w_deletefn; + t_visfn w_visfn; + t_clickfn w_clickfn; +}; + +/* -------- behaviors for scalars defined by objects in template --------- */ +/* these are set by "drawing commands" in g_template.c which add appearance to +scalars, which live in some other window. If the scalar is just included +in a canvas the "parent" is a misnomer. There is also a text scalar object +which really does draw the scalar on the parent window; see g_scalar.c. */ + +/* note how the click function wants the whole scalar, not the "data", so +doesn't work on array elements... LATER reconsider this */ + + /* bounding rectangle: */ +typedef void (*t_parentgetrectfn)(t_gobj *x, struct _glist *glist, + t_word *data, t_template *tmpl, float basex, float basey, + int *x1, int *y1, int *x2, int *y2); + /* displace it */ +typedef void (*t_parentdisplacefn)(t_gobj *x, struct _glist *glist, + t_word *data, t_template *tmpl, float basex, float basey, + int dx, int dy); + /* change color to show selection */ +typedef void (*t_parentselectfn)(t_gobj *x, struct _glist *glist, + t_word *data, t_template *tmpl, float basex, float basey, + int state); + /* change appearance to show activation/deactivation: */ +typedef void (*t_parentactivatefn)(t_gobj *x, struct _glist *glist, + t_word *data, t_template *tmpl, float basex, float basey, + int state); + /* making visible or invisible */ +typedef void (*t_parentvisfn)(t_gobj *x, struct _glist *glist, + t_word *data, t_template *tmpl, float basex, float basey, + int flag); + /* field a mouse click */ +typedef int (*t_parentclickfn)(t_gobj *x, struct _glist *glist, + t_scalar *sc, t_template *tmpl, float basex, float basey, + int xpix, int ypix, int shift, int alt, int dbl, int doit); + +struct _parentwidgetbehavior +{ + t_parentgetrectfn w_parentgetrectfn; + t_parentdisplacefn w_parentdisplacefn; + t_parentselectfn w_parentselectfn; + t_parentactivatefn w_parentactivatefn; + t_parentvisfn w_parentvisfn; + t_parentclickfn w_parentclickfn; +}; + + /* cursor definitions; used as return value for t_parentclickfn */ +#define CURSOR_RUNMODE_NOTHING 0 +#define CURSOR_RUNMODE_CLICKME 1 +#define CURSOR_RUNMODE_THICKEN 2 +#define CURSOR_RUNMODE_ADDPOINT 3 +#define CURSOR_EDITMODE_NOTHING 4 +#define CURSOR_EDITMODE_CONNECT 5 +#define CURSOR_EDITMODE_DISCONNECT 6 +EXTERN void canvas_setcursor(t_glist *x, unsigned int cursornum); + +extern t_canvas *canvas_editing; /* last canvas to start text edting */ +extern t_canvas *canvas_whichfind; /* last canvas we did a find in */ +extern t_canvas *canvas_list; /* list of all root canvases */ +extern t_class *vinlet_class, *voutlet_class; +extern int glist_valid; /* incremented when pointers might be stale */ + +/* ------------------- functions on any gobj ----------------------------- */ +EXTERN void gobj_getrect(t_gobj *x, t_glist *owner, int *x1, int *y1, + int *x2, int *y2); +EXTERN void gobj_displace(t_gobj *x, t_glist *owner, int dx, int dy); +EXTERN void gobj_select(t_gobj *x, t_glist *owner, int state); +EXTERN void gobj_activate(t_gobj *x, t_glist *owner, int state); +EXTERN void gobj_delete(t_gobj *x, t_glist *owner); +EXTERN void gobj_vis(t_gobj *x, t_glist *glist, int flag); +EXTERN int gobj_click(t_gobj *x, struct _glist *glist, + int xpix, int ypix, int shift, int alt, int dbl, int doit); +EXTERN void gobj_save(t_gobj *x, t_binbuf *b); +EXTERN void gobj_properties(t_gobj *x, struct _glist *glist); +EXTERN void gobj_save(t_gobj *x, t_binbuf *b); + +/* -------------------- functions on glists --------------------- */ +EXTERN t_glist *glist_new( void); +EXTERN void glist_init(t_glist *x); +EXTERN void glist_add(t_glist *x, t_gobj *g); +EXTERN void glist_cleanup(t_glist *x); +EXTERN void glist_free(t_glist *x); + +EXTERN void glist_clear(t_glist *x); +EXTERN t_canvas *glist_getcanvas(t_glist *x); +EXTERN int glist_isselected(t_glist *x, t_gobj *y); +EXTERN void glist_select(t_glist *x, t_gobj *y); +EXTERN void glist_deselect(t_glist *x, t_gobj *y); +EXTERN void glist_noselect(t_glist *x); +EXTERN void glist_selectall(t_glist *x); +EXTERN void glist_delete(t_glist *x, t_gobj *y); +EXTERN void glist_retext(t_glist *x, t_text *y); +EXTERN void glist_grab(t_glist *x, t_gobj *y, t_glistmotionfn motionfn, + t_glistkeyfn keyfn, int xpos, int ypos); +EXTERN int glist_isvisible(t_glist *x); +EXTERN int glist_istoplevel(t_glist *x); +EXTERN t_glist *glist_findgraph(t_glist *x); +EXTERN int glist_getfont(t_glist *x); +EXTERN void glist_sort(t_glist *canvas); +EXTERN void glist_read(t_glist *x, t_symbol *filename, t_symbol *format); +EXTERN void glist_mergefile(t_glist *x, t_symbol *filename, t_symbol *format); + +EXTERN float glist_pixelstox(t_glist *x, float xpix); +EXTERN float glist_pixelstoy(t_glist *x, float ypix); +EXTERN float glist_xtopixels(t_glist *x, float xval); +EXTERN float glist_ytopixels(t_glist *x, float yval); +EXTERN float glist_dpixtodx(t_glist *x, float dxpix); +EXTERN float glist_dpixtody(t_glist *x, float dypix); + +EXTERN void glist_redrawitem(t_glist *owner, t_gobj *gobj); +EXTERN void glist_getnextxy(t_glist *gl, int *xval, int *yval); +EXTERN void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv); +EXTERN t_glist *glist_addglist(t_glist *g, t_symbol *sym, + float x1, float y1, float x2, float y2, + float px1, float py1, float px2, float py2); +EXTERN void glist_arraydialog(t_glist *parent, t_symbol *name, + t_floatarg size, t_floatarg saveit, t_floatarg newgraph); +EXTERN t_binbuf *glist_writetobinbuf(t_glist *x, int wholething); +EXTERN int glist_isgraph(t_glist *x); +EXTERN void glist_redraw(t_glist *x); +EXTERN void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime, + char *tag, int x1, int y1, int x2, int y2); +EXTERN void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag); +EXTERN void canvas_create_editor(t_glist *x, int createit); +void canvas_deletelinesforio(t_canvas *x, t_text *text, + t_inlet *inp, t_outlet *outp); + + +/* -------------------- functions on texts ------------------------- */ +EXTERN void text_setto(t_text *x, t_glist *glist, char *buf, int bufsize); +EXTERN void text_drawborder(t_text *x, t_glist *glist, char *tag, + int width, int height, int firsttime); +EXTERN void text_eraseborder(t_text *x, t_glist *glist, char *tag); +EXTERN int text_xcoord(t_text *x, t_glist *glist); +EXTERN int text_ycoord(t_text *x, t_glist *glist); +EXTERN int text_xpix(t_text *x, t_glist *glist); +EXTERN int text_ypix(t_text *x, t_glist *glist); +EXTERN int text_shouldvis(t_text *x, t_glist *glist); + +/* -------------------- functions on rtexts ------------------------- */ +#define RTEXT_DOWN 1 +#define RTEXT_DRAG 2 +#define RTEXT_DBL 3 +#define RTEXT_SHIFT 4 + +EXTERN t_rtext *rtext_new(t_glist *glist, t_text *who); +EXTERN t_rtext *glist_findrtext(t_glist *gl, t_text *who); +EXTERN void rtext_draw(t_rtext *x); +EXTERN void rtext_erase(t_rtext *x); +EXTERN t_rtext *rtext_remove(t_rtext *first, t_rtext *x); +EXTERN int rtext_height(t_rtext *x); +EXTERN void rtext_displace(t_rtext *x, int dx, int dy); +EXTERN void rtext_select(t_rtext *x, int state); +EXTERN void rtext_activate(t_rtext *x, int state); +EXTERN void rtext_free(t_rtext *x); +EXTERN void rtext_key(t_rtext *x, int n, t_symbol *s); +EXTERN void rtext_mouse(t_rtext *x, int xval, int yval, int flag); +EXTERN void rtext_retext(t_rtext *x); +EXTERN int rtext_width(t_rtext *x); +EXTERN int rtext_height(t_rtext *x); +EXTERN char *rtext_gettag(t_rtext *x); +EXTERN void rtext_gettext(t_rtext *x, char **buf, int *bufsize); + +/* -------------------- functions on canvases ------------------------ */ +EXTERN t_class *canvas_class; + +EXTERN t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv); +EXTERN t_symbol *canvas_makebindsym(t_symbol *s); +EXTERN void canvas_vistext(t_canvas *x, t_text *y); +EXTERN void canvas_fixlinesfor(t_canvas *x, t_text *text); +EXTERN void canvas_deletelinesfor(t_canvas *x, t_text *text); +EXTERN void canvas_stowconnections(t_canvas *x); +EXTERN void canvas_restoreconnections(t_canvas *x); +EXTERN void canvas_redraw(t_canvas *x); + +EXTERN t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *sym,t_symbol* s); +EXTERN void canvas_rminlet(t_canvas *x, t_inlet *ip); +EXTERN t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *sym); +EXTERN void canvas_rmoutlet(t_canvas *x, t_outlet *op); +EXTERN void canvas_redrawallfortemplate(t_canvas *tmpl); +EXTERN void canvas_zapallfortemplate(t_canvas *tmpl); +EXTERN void canvas_setusedastemplate(t_canvas *x); +EXTERN t_canvas *canvas_getcurrent(void); +EXTERN void canvas_setcurrent(t_canvas *x); +EXTERN void canvas_unsetcurrent(t_canvas *x); +EXTERN t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s); +EXTERN t_canvas *canvas_getrootfor(t_canvas *x); +EXTERN void canvas_dirty(t_canvas *x, t_int n); +EXTERN int canvas_getfont(t_canvas *x); +typedef int (*t_canvasapply)(t_canvas *x, t_int x1, t_int x2, t_int x3); + +EXTERN t_int *canvas_recurapply(t_canvas *x, t_canvasapply *fn, + t_int x1, t_int x2, t_int x3); + +EXTERN void canvas_resortinlets(t_canvas *x); +EXTERN void canvas_resortoutlets(t_canvas *x); +EXTERN void canvas_free(t_canvas *x); +EXTERN void canvas_updatewindowlist( void); +EXTERN void canvas_editmode(t_canvas *x, t_floatarg yesplease); +EXTERN int canvas_isabstraction(t_canvas *x); +EXTERN int canvas_istable(t_canvas *x); +EXTERN int canvas_showtext(t_canvas *x); +EXTERN void canvas_vis(t_canvas *x, t_floatarg f); +EXTERN t_canvasenvironment *canvas_getenv(t_canvas *x); +EXTERN void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir); +EXTERN void canvas_loadbang(t_canvas *x); +EXTERN int canvas_hitbox(t_canvas *x, t_gobj *y, int xpos, int ypos, + int *x1p, int *y1p, int *x2p, int *y2p); +EXTERN int canvas_setdeleting(t_canvas *x, int flag); + +typedef void (*t_undofn)(t_canvas *canvas, void *buf, + int action); /* a function that does UNDO/REDO */ +#define UNDO_FREE 0 /* free current undo/redo buffer */ +#define UNDO_UNDO 1 /* undo */ +#define UNDO_REDO 2 /* redo */ +EXTERN void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf, + const char *name); +EXTERN void canvas_noundo(t_canvas *x); +EXTERN int canvas_getindex(t_canvas *x, t_gobj *y); + +/* T.Grill - made public for dynamic object creation */ +/* in g_editor.c */ +EXTERN void canvas_connect(t_canvas *x, + t_floatarg fwhoout, t_floatarg foutno,t_floatarg fwhoin, t_floatarg finno); +EXTERN void canvas_disconnect(t_canvas *x, + float index1, float outno, float index2, float inno); +EXTERN int canvas_isconnected (t_canvas *x, + t_text *ob1, int n1, t_text *ob2, int n2); +EXTERN void canvas_selectinrect(t_canvas *x, int lox, int loy, int hix, int hiy); + + +/* ---- functions on canvasses as objects --------------------- */ + +EXTERN void canvas_fattenforscalars(t_canvas *x, + int *x1, int *y1, int *x2, int *y2); +EXTERN void canvas_visforscalars(t_canvas *x, t_glist *glist, int vis); +EXTERN int canvas_clicksub(t_canvas *x, int xpix, int ypix, int shift, + int alt, int dbl, int doit); +EXTERN t_glist *canvas_getglistonsuper(void); + +EXTERN void linetraverser_start(t_linetraverser *t, t_canvas *x); +EXTERN t_outconnect *linetraverser_next(t_linetraverser *t); +EXTERN void linetraverser_skipobject(t_linetraverser *t); + +/* --------------------- functions on tscalars --------------------- */ + +EXTERN void tscalar_getrect(t_tscalar *x, t_glist *owner, + int *xp1, int *yp1, int *xp2, int *yp2); +EXTERN void tscalar_vis(t_tscalar *x, t_glist *owner, int flag); +EXTERN int tscalar_click(t_tscalar *x, int xpix, int ypix, int shift, + int alt, int dbl, int doit); + +/* --------- functions on garrays (graphical arrays) -------------------- */ + +EXTERN t_template *garray_template(t_garray *x); + +/* -------------------- arrays --------------------- */ +EXTERN t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *tmpl, + t_floatarg f, t_floatarg saveit); +EXTERN t_array *array_new(t_symbol *templatesym, t_gpointer *parent); +EXTERN void array_resize(t_array *x, t_template *tmpl, int n); +EXTERN void array_free(t_array *x); + +/* --------------------- gpointers and stubs ---------------- */ +EXTERN t_gstub *gstub_new(t_glist *gl, t_array *a); +EXTERN void gstub_cutoff(t_gstub *gs); +EXTERN void gpointer_setglist(t_gpointer *gp, t_glist *glist, t_scalar *x); + +/* --------------------- scalars ------------------------- */ +EXTERN void word_init(t_word *wp, t_template *tmpl, t_gpointer *gp); +EXTERN void word_restore(t_word *wp, t_template *tmpl, + int argc, t_atom *argv); +EXTERN t_scalar *scalar_new(t_glist *owner, + t_symbol *templatesym); +EXTERN void scalar_getbasexy(t_scalar *x, float *basex, float *basey); + +/* ------helper routines for "garrays" and "plots" -------------- */ +EXTERN int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, + t_symbol *elemtemplatesym, + float linewidth, float xloc, float xinc, float yloc, + int xpix, int ypix, int shift, int alt, int dbl, int doit); + +EXTERN void array_getcoordinate(t_glist *glist, + char *elem, int xonset, int yonset, int wonset, int indx, + float basex, float basey, float xinc, + float *xp, float *yp, float *wp); + +EXTERN int array_getfields(t_symbol *elemtemplatesym, + t_canvas **elemtemplatecanvasp, + t_template **elemtemplatep, int *elemsizep, + int *xonsetp, int *yonsetp, int *wonsetp); + +/* --------------------- templates ------------------------- */ +EXTERN t_template *template_new(t_symbol *sym, int argc, t_atom *argv); +EXTERN void template_free(t_template *x); +EXTERN int template_match(t_template *x1, t_template *x2); +EXTERN int template_find_field(t_template *x, t_symbol *name, int *p_onset, + int *p_type, t_symbol **p_arraytype); +EXTERN t_float template_getfloat(t_template *x, t_symbol *fieldname, t_word *wp, + int loud); +EXTERN void template_setfloat(t_template *x, t_symbol *fieldname, t_word *wp, + t_float f, int loud); +EXTERN t_symbol *template_getsymbol(t_template *x, t_symbol *fieldname, + t_word *wp, int loud); +EXTERN void template_setsymbol(t_template *x, t_symbol *fieldname, + t_word *wp, t_symbol *s, int loud); + +EXTERN t_template *gtemplate_get(t_gtemplate *x); +EXTERN t_template *template_findbyname(t_symbol *s); +EXTERN t_canvas *template_findcanvas(t_template *tmpl); + +EXTERN t_float template_getfloat(t_template *x, t_symbol *fieldname, + t_word *wp, int loud); +EXTERN void template_setfloat(t_template *x, t_symbol *fieldname, + t_word *wp, t_float f, int loud); +EXTERN t_symbol *template_getsymbol(t_template *x, t_symbol *fieldname, + t_word *wp, int loud); +EXTERN void template_setsymbol(t_template *x, t_symbol *fieldname, + t_word *wp, t_symbol *s, int loud); + +/* ----------------------- guiconnects, g_guiconnect.c --------- */ +EXTERN t_guiconnect *guiconnect_new(t_pd *who, t_symbol *sym); +EXTERN void guiconnect_notarget(t_guiconnect *x, double timedelay); + +/* ------------- IEMGUI routines used in other g_ files ---------------- */ +EXTERN t_symbol *iemgui_raute2dollar(t_symbol *s); +EXTERN t_symbol *iemgui_dollar2raute(t_symbol *s); + +#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) +} +#endif diff --git a/externals/gridflow/configure b/externals/gridflow/configure new file mode 100755 index 00000000..d9b19139 --- /dev/null +++ b/externals/gridflow/configure @@ -0,0 +1,1136 @@ +#!/usr/bin/env ruby +# $Id: configure,v 1.1 2005-10-04 02:12:43 matju Exp $ +=begin + GridFlow + Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard + + 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 ./COPYING 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. +=end + +require "rbconfig" +require "mkmf" +require "ftools" +include Config +require "win32/process" if CONFIG["arch"] =~ /mingw/ +LOG = File.open "./config.log", "w" + +$verbose=false +LOG.puts "-"*64 +LOG.puts "Environment Variables: " +ENV.each {|k,v| LOG.puts "#{k}=#{v}" } +LOG.puts "-"*64 + +puts +if not File.exist?("./configure") + puts "Run me from the right directory please." + exit 1 +end + +begin + Dir.mkdir "tmp" +rescue Errno::EEXIST +end + +#----------------------------------------------------------------# + +class Or + attr_reader :a + class<<self; alias [] new end + def initialize(*a) @a=a end + def to_s; @a.join " or "; end +end + +def launch2(log,*command) + log << command.join(" ") << "\n" + r,w = IO.pipe + child = launch(nil,w,w,*command) + w.close + log << r.readlines.join << "\n" + ret = join_pid(child) + ret = ret.to_int if RUBY_VERSION > "1.7" + log << "error \##{ret}\n" if ret>0 + return ret<=0 +end + +$conf={ + :LDSOFLAGS => ["-lm"], + :BRIDGE_LDFLAGS => ["-lm"], + :FEATURES => {}, + :OPTIONS => [], + :DEFINES => { + :RUBY_PREFIX => CONFIG['prefix'], + :PREFIX => "/usr/local", + :CPU => nil, + :RUBY_ARCH => CONFIG['arch'], + }, + :CC => "g++", + :OBJS => [], +} + +def launch stdin,stdout,stderr,*command # -> returncode + child = fork + if not child then + STDIN .reopen stdin if stdin + STDOUT.reopen stdout if stdout + STDERR.reopen stderr if stderr + exec *command + #!@#$ what happens with exception upon exec ? + end + child +end + +def join_pid pid + Process.waitpid2(pid)[1] +end + +module Future; end + +class Feature + $features = [] + def self.add(*a,&b) $features << Feature.new(*a,&b) end + def initialize(&b) instance_eval(&b) end + def self.attr2(sym,&b) + eval "def #{sym}(*args,&b) + raise args.inspect if args.length>1 + if b then @#{sym}=b.extend Future + elsif args.length>0 then @#{sym}=args[0] + else if Future===@#{sym} then @#{sym}.call else @#{sym} end end end" + end + attr2 :tag + attr2 :name + attr2 :status #!@#$ + attr2 :uses_so + attr2 :uses_bridge_so + attr2 :uses_o #!@#$ + attr2 :uses_h + attr2 :uses_feature + attr2 :test + attr2 :options #!@#$ + attr2 :unless_feature #!@#$ + attr2 :action #!@#$ + attr2 :defines #!@#$ + + def find_h name + $C_INCLUDE_PATH.find {|x| File.exist?(x+"/"+name)} + end + + def c_test code, link=nil, options=[], feature=nil + link = (uses_so||[]).dup if not link + link=link.flatten + ldlpath = ENV["LD_LIBRARY_PATH"] + uses_h.each {|h| + find_h h or + /framework/ =~ (uses_so||[]).join(" ") or + raise "where is #{h} ?" + } if uses_h + ENV["LD_LIBRARY_PATH"] = ldlpath ? "./tmp:#{ldlpath}" : "./tmp" + link[0,0]=$conf[:LDSOFLAGS].find_all {|x| String===x and /^-L/ =~ x }.flatten + code=code.gsub(/#include#/) { + uses_h.map {|inc| "#include <#{inc}>\n" }.join"" + } + log = "" + log << code << "\n" + binname = "tmp/#{$$}" + sourcename = binname+".cpp" + File.open(sourcename,"w") {|f| f.puts code } + command = ["/usr/bin/env", $conf[:CC]] + + $CFLAGS.split(/ /).reject{|x| x.length==0 } + if not launch2 log,*(command+options+[sourcename, + "-o", binname, *link]) + pat = Regexp.new("^"+Regexp.quote(sourcename)+":\\d+: ") + errs = log.split("\n").find_all {|l| pat =~ l } + raise "gcc compilation error" if not errs or + errs.length==0 + errs = errs[0].gsub(pat,"") + raise "gcc: #{errs}" + end + if not launch2 log,"tmp/#{$$}" + raise "runtime error" + end + return true + ensure + LOG.puts log + ENV["LD_LIBRARY_PATH"] = ldlpath if ldlpath + end + + def asm_test code, *link + log = "" + log << code << "\n" + File.open("tmp/#{$$}.asm","w") {|f| f.puts code } + command = ["/usr/bin/env", "nasm", + "tmp/#{$$}.asm", "-f", "elf", "-o", "tmp/#{$$}.o"] + launch2 log,*command or return false + command = ["#{$conf[:CC]}","-o","tmp/#{$$}","tmp/#{$$}.o",*link] + launch2 log,*command or return false + command = ["tmp/#{$$}"] + launch2 log,*command or return false + true + ensure + LOG.puts log + end +end + +#----------------------------------------------------------------# + +def make_expand(x) + y=x.gsub(/\$\(([^\)]*)\)/) {CONFIG[$1]} + if x!=y then make_expand y else y end +end + +def read_ld_so_conf + return [] unless File.exist?("/etc/ld.so.conf") + x = File.open("/etc/ld.so.conf"){|f| f.read }.split("\s") + x.delete_if { x.length==0 } + x +end + +$C_INCLUDE_PATH = ( + (ENV["CPLUS_INCLUDE_PATH"]||"").split(":") + + (ENV["C_INCLUDE_PATH"]||"").split(":") + + ["/usr/include"]).uniq + +$LIBRARY_PATH = ( + (ENV["LIBRARY_PATH"]||"").split(":") + + ["/usr/lib","/lib"]).uniq + +$LD_LIBRARY_PATH = ( + (ENV["LD_LIBRARY_PATH"]||"").split(":") + + read_ld_so_conf + + ["/usr/lib","/lib"]).uniq + +# making it easier for everybody I hope: +["/Applications/Pd.app/Contents/Resources","/sw","/usr/local",ENV["home"]].each do|base| + if not $LD_LIBRARY_PATH.include? "#{base}/lib" and + not $LIBRARY_PATH.include? "#{base}/lib" then + $conf[:LDSOFLAGS].unshift "-L#{base}/lib" + $LD_LIBRARY_PATH.unshift "#{base}/lib" + $LIBRARY_PATH.unshift "#{base}/lib" + end + #and not $CPLUS_INCLUDE_PATH.include? "#{base}/include" + if not $C_INCLUDE_PATH.include? "#{base}/include" then + $CFLAGS += " -I#{base}/include" + $C_INCLUDE_PATH.unshift "#{base}/include" + end +end + +for var in [:$C_INCLUDE_PATH, :$LIBRARY_PATH, :$LD_LIBRARY_PATH] do + LOG.puts "#{var}: #{eval(var.to_s).inspect}" +end + +$conf[:BINDIR] = make_expand CONFIG['bindir'] + +LOG.puts "-"*64 + +$CFLAGS += " -xc++ -fno-operator-names -fno-omit-frame-pointer" +$CFLAGS += " -I/usr/X11R6/include" +$C_INCLUDE_PATH.unshift "/usr/X11R6/include" + +ruby16a = "#{CONFIG['libdir']}/ruby/#{CONFIG['MAJOR']}.#{CONFIG['MINOR']}/"\ +"#{CONFIG['arch']}/#{CONFIG['LIBRUBY_A']}" +ruby18a = "#{CONFIG['libdir']}/#{CONFIG['LIBRUBY_A']}" +for x in [ruby16a,ruby18a] do + $LIBRUBY_A = make_expand x + break if File.exist? $LIBRUBY_A +end + +FILES = [ + [:directory, "base/", + [:ruby, "main.rb"], + [:ruby, "flow_objects.rb"], + [:ruby, "test.rb"], + [:ruby, "source_filter.rb"], + ], + [:directory, "bridge/", + [:ruby, "puredata.rb"], + [:ruby, "placebo.rb"], + ], + [:directory, "format/", + [:ruby, "main.rb"], + ], + [:directory, "extra/", + [:ruby, "smpte.rb"], + [:ruby, "server_2.rb"], + [:ruby, "server_1_grid.rb"], + [:ruby, "server_1_ppm.rb"], + [:ruby, "jmax_format.rb"], + [:ruby, "puredata_format.rb"], + ], +] + +#----------------------------------------------------------------# +Feature.add { + tag :fast + name "Compile for speed (and not debuggability)" +} +Feature.add { + tag :gcc3 + name "GNU C++ Compiler 3" + options ["HAVE_GCC3"] + test proc { + pi=File.popen "#{$conf[:CC]} -v 2>&1", "r" + vline = pi.readlines.find {|l| /gcc version ([\d\.]+)/.match l } + version = $1 + pi.close + if version < "3" then raise "version #{version} < 3" end + true + } +} +Feature.add { + tag :stl + name "C++ Standard Template Library" + test proc { + c_test %{ + #include <vector> + int main () { + std::vector<int> foo; + }} + } +} +Feature.add { + tag :gcc64 + name "GNU C++ in 64-bit mode" + options ["GCC64"] + test proc { + c_test %{ + #include <stdio.h> + #include <stdlib.h> + #include <cstddef> + #define T(a) printf("%s:%d; ",#a,sizeof(a)); + int main () { + T(void *)T(ptrdiff_t)T(off_t)T(size_t)puts(""); + T(char)T(short)T(int)T(long)T(long long)puts(""); + T(float)T(double)puts(""); + return !( sizeof(void*)==8 ); + }} + } +} + +#----------------------------------------------------------------# + +$stack_end_test = %{ + #include <stdio.h> + #include <ruby.h> + int main () { + void *bp; + printf("#define RUBY_STACK_END 0x%08lx",(long)&bp); + return rb_rescue==0; + } +} +Feature.add { + tag :libruby + name "Ruby as a dynamic library" + uses_bridge_so ["-lruby"] + #uses_h ["ruby.h"] # is in special directory + defines :RUBY_STACK_END => proc { + m = /RUBY_STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + m[1] + } + test proc { c_test $stack_end_test, uses_bridge_so } +} +Feature.add { + tag :librubystatic + unless_feature [:libruby] + name "Ruby as a static library" + #uses_h ["ruby.h"] # is in special directory + uses_bridge_so { + lib = " #{$LIBRUBY_A} #{CONFIG['LIBS']} " + unless CONFIG["arch"] =~ /darwin/ + lib = "-Wl,--whole-archive"+lib+"-Wl,--no-whole-archive" + end + [lib] + } + defines :RUBY_STACK_END => proc { + m = /RUBY_STACK_END\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + m[1] + } + test proc { c_test $stack_end_test, ["-xnone", $LIBRUBY_A, *(CONFIG['LIBS'].split)] } + options ["HAVE_STATIC_RUBY"] #!@#$ useless? +} +#----------------------------------------------------------------# +Feature.add { + tag :pentium + name "Pentium-compatible CPU" + action proc { $conf[:DEFINES][:CPU] ||= "pentium" } + test proc { + (CONFIG["arch"] =~ /i\d86/) or raise "#{CONFIG["arch"]} instead" + c_test ' + #include <stdio.h> + char get_cpuid[]={ + 96,49,192,15,162,139,124,36,36,137,31, + 137,87,4,137,79,8,137,71,12,97,195}; + main() { + char result[16]; + int code; + ((void(*)(char*))get_cpuid)(result); + code = ((int*)result)[3]; + result[12]=0; + fprintf(stderr,"cpuid: name=\"%12s\", flags=0x%08x\n", + result,code); + return 0;}' + } + options ["HAVE_PENTIUM"] +} +Feature.add { + tag :mmx + uses_feature [:pentium] + uses_o ["cpu/mmx.o","cpu/mmx_loader.o"] + name "MMX-compatible CPU (using NASM)" + test proc { + asm_test ' + global main + extern exit + align 16 + SECTION .data + foo: dd 42,0 + SECTION .text + main: + lea esi,[foo] + movq mm0,qword[esi] + paddd mm0,qword[esi] + movq qword [esi],mm0 + emms + cmp dword [foo], 84 + je yes + push long 1 + call exit + yes: + push long 0 + call exit + ', '-lc' + } + options ["HAVE_MMX"] +} +Feature.add { + tag :simd + uses_feature [:pentium] + name "SIMD (MMX/SSE/Altivec) (using GCC)" + test proc { + c_test ' + #include <stdio.h> + typedef int v8qi __attribute__ ((mode(V8QI))); + union vv8qi { v8qi v; char c[8]; }; + int main () { return 0; }',nil,["-mmmx"] + } + options ["HAVE_SIMD"] +} +Feature.add { + tag :profiler + name "profiler (speed measurements)" + uses_feature [:pentium] + options ["HAVE_TSC_PROFILING"] +} +#----------------------------------------------------------------# +Feature.add { + tag :usb + name "USB Library" + uses_h ["usb.h"] + uses_o ["optional/usb.o"] + uses_so ["-lusb"] + test proc { + c_test " + #include# + int main () {return usb_open==0 || usb_get_busses==0;} + " + } + options ["HAVE_USB"] +} +#----------------------------------------------------------------# +Feature.add { + tag :ieee1394 + name "IEEE1394 Libraries for Linux (raw1394/dc1394)" + status :disabled + uses_o ["optional/ieee1394.o"] + uses_so ["-lraw1394","-ldc1394_control"] + uses_h ["libraw1394/raw1394.h","libdc1394/dc1394_control.h"] + test proc { + c_test " + #include# + int main () {return raw1394_get_libversion==0 || dc1394_get_camera_info==0;} + " + } + options ["HAVE_1394"] + uses_o ["format/dc1394.o"] +} +Feature.add { + tag :x11 + name "X11 Display Protocol" + uses_so ["-L/usr/X11R6/lib","-lX11","-lXext"] + uses_h ["X11/Xlib.h"] + test proc { + c_test " + #include# + int main () {return XSetErrorHandler==0;} + " + } + uses_o ["format/x11.o"] +} +Feature.add { + tag :x11_shm + name "X11 acceleration through shared memory" + uses_feature [:x11] + uses_so ["-L/usr/X11R6/lib","-lX11","-lXext"] + uses_h ["X11/Xlib.h","sys/shm.h","X11/extensions/XShm.h"] + test proc { + c_test " + #include# + #include <X11/Xutil.h> + #include <X11/StringDefs.h> + #include <sys/ipc.h> + int main () {return XShmPutImage==0;} + " + } + options ["HAVE_X11_SHARED_MEMORY"] +} +=begin +Feature.add { + tag :opengl + name "OpenGL (only as framebuffer)" + status :disabled + uses_so ["-L/usr/X11R6/lib","-lglut","-lGL","-lGLU"] + uses_h ["GL/glut.h"] + test proc { + c_test " + #include# + int main () {return glutInit==0;} + " + } + uses_o ["format/opengl.o"] +} +=end +Feature.add { + tag :sdl + name "Simple Directmedia Layer (experimental support)" + uses_so { + a=["-lSDL","-lpthread"] + a<<"-lobjc" if CONFIG["arch"] =~ /darwin/ + a + } + uses_h ["SDL/SDL.h"] + test proc { + c_test " + #include# + int main () {return SDL_MapRGB==0;} + " + } + uses_o ["format/sdl.o"] +} +Feature.add { + tag :objcpp + name "GNU/Apple ObjectiveC++ Compiler" + uses_h ["objc/Object.h"] + uses_so ["-lobjc"] + test proc { + c_test " + #include# + int main () { [[Object alloc] init]; } + ", nil, ["-xobjective-c++"] + } +} +Feature.add { + tag :quartz + name "Apple Quartz/Cocoa Display" + uses_so ["-lobjc",["-framework","Cocoa"]] + uses_feature [:objcpp] + uses_h ["objc/Object.h","Cocoa/Cocoa.h"] + test proc { + c_test " + #include# + int main () {return CGImageRelease==0;} + ", nil, ["-xobjective-c++"] + } + uses_o ["format/quartz.o"] +} +Feature.add { + tag :aalib + name "Ascii Art Library" + uses_so ["-laa"] + uses_h ["aalib.h"] + test proc { + c_test " + #define aa_hardwareparams aa_hardware_params + extern \"C\" { + #include# + }; + int main () {return aa_init==0;} + " + } + uses_o ["format/aalib.o"] +} +Feature.add { + tag :jpeg + name "JPEG Library" + uses_so ["-ljpeg"] + uses_h ["jpeglib.h"] + test proc { + c_test " + extern \"C\" { + #include <stdio.h> + #include# + }; + int main () { + return jpeg_write_scanlines==0;} + " + } + uses_o ["format/jpeg.o"] +} +Feature.add { + tag :png + name "PNG Library" + uses_so ["-lpng","-lz"] + uses_h Or[["libpng12/png.h"],["png.h"]] + test proc {|f| + f.c_test %` + extern "C" { + #include <stdio.h> + #include# + }; + int main () { + #define T(a) printf("%s:%d; ",#a,sizeof(a)); + T(png_uint_32)T(long)puts(""); + if (!png_check_sig) return 1; + return 0;} + ` + } + uses_o ["format/png.o"] +} +Feature.add { + tag :videodev + name "Video4linux Digitizer Driver Interface" + uses_h ["linux/videodev.h"] + test proc { + c_test " + #include <stdlib.h> + #include# + int main () { struct video_window foo; return 0; }" + } + uses_o ["format/videodev.o"] +} +Feature.add { + tag :mpeg3 + name "HeroineWarrior LibMPEG3" + uses_so ["-lmpeg3","-lpthread","-lm", + "-L/usr/X11R6/lib"] + uses_h Or["libmpeg3/libmpeg3.h","libmpeg3.h"] + test proc {|f| + f.c_test " + #include# + int main () { return mpeg3_open==0; } + " + } + uses_o ["format/mpeg3.o"] +} +Feature.add { + tag :quicktimeapple + name "Apple's QuickTime" + uses_so [["-framework","Quicktime"]] + uses_h ["Quicktime/quicktime.h","Quicktime/movies.h"] + test proc { + c_test " + #include# + int main () { return EnterMovies==0; } + " + } + uses_o ["format/quicktimeapple.o"] +} +Feature.add { + tag :quicktimehw + unless_feature :quicktimeapple + name "HeroineWarrior QuickTime4Linux (or LibQuickTime)" + uses_so Or[ + ["-lquicktime","-lpthread","-lpng","-ldl","-lglib","-lz"], + ["-lquicktime","-lpthread","-lpng","-ldl","-lglib-1.2","-lz"]] + uses_h ["quicktime/quicktime.h","quicktime/lqt_version.h"] + test proc {|f| + f.c_test %` + #include <stdio.h> + #include# + int main () { + fprintf(stderr,"LQT_VERSION = %s\\n", + #ifdef LQT_VERSION + LQT_VERSION + #else + "(undefined)" + #endif + ); return quicktime_open==0; } + ` + } + uses_o ["format/quicktimehw.o"] +} +Feature.add { + tag :xine + name "Xine movie decoder" + uses_so ["-lxine"] + uses_h ["xine.h"] + status :disabled + test proc {|f| + f.c_test %` + #include <stdio.h> + #include# + int main () { + fprintf(stderr,"Xine version = %d.%d.%d (%s)\\n", + XINE_MAJOR_VERSION, XINE_MINOR_VERSION, + XINE_SUB_VERSION, XINE_VERSION); + return xine_new==0; }` + } + uses_o ["format/xine.o"] +} +#Feature.add { +# tag :example +# name "example (example file optional/example.c)" +# uses_o ["optional/example.o"] +# test proc {|f| +# c_test %` +# #include <stdio.h> +# int main () { +# return 0 /* 0=ok, nonzero=bad */; }` +# } +#} +#----------------------------------------------------------------# +Feature.add { + tag :puredata + name "Miller Puckette's Pure Data" + uses_feature [Or[:libruby,:librubystatic]] + options ["HAVE_PUREDATA"] + defines { + path = $C_INCLUDE_PATH.find {|x| File.exist?(x+"/m_pd.h")} + m = /PD_VERSION_INT\s+(.*)/.match(File.popen("tmp/#{$$}","r"){|f| f.read }) + {:PUREDATA_PATH => File.dirname(path)+"/lib/pd", :PD_VERSION_INT => m[1].to_i} + } + uses_h ["m_pd.h"] + test proc { + c_test %` + #include# + #include <stdio.h> + int main () { + printf("#define PD_VERSION_INT %d\\n", + #ifdef PD_MAJOR_VERSION + (int)(PD_MAJOR_VERSION*100+PD_MINOR_VERSION)); + #else + (int)(PD_VERSION*100)); + #endif + return 0; + } + ` + } +} + +$features_h = {} +$features.each {|f| $features_h[f.tag]=f } + +#--------------------------------# + +def usage + log = "" + log << "usage: ./configure " + log << "[--use-compiler compiler] [--use-compiler-option option]* " + log << "[--use-cpu cpu] [--lite] [--debug] [--debug-harder]" + log << "[--ruby-prefix directory] " + $features_h.keys.map {|k| k.to_s }.sort.each {|k| log << "[--no-#{k}] " } + $features_h.keys.map {|k| k.to_s }.sort.each {|k| log << "[--force-#{k}] " } + puts + while log.length>0 do puts log.slice!(/^.{1,70} /) end +end + +while ARGV.length>0 do + arg=ARGV.shift + case arg + when /=/ + i=arg.index '=' + ARGV.unshift arg[0..i-1], arg[i+1..-1] + when /^--no-/ + name = arg[5..-1].intern + puts "there is no feature called #{name}" if not $features_h[name] + puts "--no: won't check for feature #{name}" + $features_h.delete name + when /^--force-/ + name = arg[8..-1].intern + puts "there is no feature called #{name}" if not $features_h[name] + puts "--force: assuming #{name} is there" + $features_h[name].test nil + when "--static" # experimental + $conf[:STATIC]=true + $conf[:LDSOFLAGS] << "-static" +# ARGV.unshift "--no-libruby" + when "--debug" + puts "Debug Mode (more error checking; less speed)" + $conf[:OPTIONS].push :HAVE_DEBUG + $CFLAGS += " -fno-inline" + when "--debug-harder" + puts "Debug Harder Mode (even more error checking; even less speed)" + $conf[:OPTIONS].push :HAVE_DEBUG + $conf[:OPTIONS].push :HAVE_DEBUG_HARDER + $CFLAGS += " -fno-inline" + when "--lite" + puts "Lite Mode (no float, no int64)" + $conf[:OPTIONS].push :HAVE_LITE + when "--help"; usage; exit 0 + when "--prefix", "--ruby-prefix" + $conf[:DEFINES][:RUBY_PREFIX]=ARGV.shift + when "--use-compiler" + $conf[:CC] = ARGV.shift + when "--use-compiler-option" + $CFLAGS += " "+ARGV.shift + when "--use-cpu" + $conf[:DEFINES][:CPU] = ARGV.shift + when "--verbose" + $verbose=true + when "--bindir" + $conv[:BINDIR] = ARGV.shift + else puts "unknown option \"#{arg}\""; usage; exit 1 + end +end + +# the ||= lines are patches for old versions of ruby. +CONFIG["ruby_version"] ||= "$(MAJOR).$(MINOR)" +CONFIG["rubylibdir"] ||= "$(libdir)/ruby/$(ruby_version)" +CONFIG["archdir"] ||= CONFIG["rubylibdir"] + "/" + CONFIG["arch"] + +$CFLAGS += " -I " + (make_expand CONFIG["archdir"]) + +#--------------------------------# + +DUAL = Object.new +DUAL.instance_eval { + def self.print x + LOG .puts x; LOG .flush + STDERR.print x; STDERR.flush + end + def self.puts x + self.print x+"\n" + end +} + +def try feature + if Or===feature.uses_so + k=1 + feature.uses_so.a.each {|i| + e=feature.dup; e.uses_so i; e.name(e.name+" (try \##{k})") + r=try e; return r if r + k+=1 + } + return false + end + if Or===feature.uses_h + feature.uses_h.a.each {|i| + e=feature.dup; e.uses_h i; e.name(e.name+" <#{e.uses_h}>") + r=try e; return r if r + } + return false + end + LOG.puts "", "-"*64 + DUAL.print "[#{feature.tag}] #{feature.name}: " + (feature.uses_feature||[]).find {|f| + if not ( + if Or===f then f.a.find {|x| $conf[:FEATURES][x] } else $conf[:FEATURES][f] end + ) then + DUAL.puts "disabled (would need #{f})" + return + end + } + if feature.status==:disabled then DUAL.puts "disabled (by author)"; return end + if not $features_h[feature.tag] then DUAL.puts "disabled (by user)"; return end + fu = feature.unless_feature || [] + fu = [fu] if not Array===fu + for f in fu || [] do + if $conf[:FEATURES][f] then + DUAL.puts "disabled (using #{f} instead)" + return + end + end + + if feature.test + begin + tresult = feature.test.call(feature) + rescue StandardError => e + end + if tresult + DUAL.puts "found "+(if tresult!=true + then " (#{tresult})" + else "" end) + if tresult == "static" + feature.uses_so.map! {|x| + "-Wl,--whole-archive #{x} -Wl,--no-whole-archive" + } if feature.uses_so + feature.uses_bridge_so.map! {|x| + "-Wl,--whole-archive #{x} -Wl,--no-whole-archive" + } if feature.uses_bridge_so + end + else + DUAL.puts "missing "+(if e + then (if $verbose + then "(#{e} @ #{e.backtrace.join', '})" + else "(#{e})" end) + else "(return false)" end) + if e + LOG.puts e.inspect + LOG.puts e.backtrace + end + return false + end + else + puts "enabled" + $conf[:FEATURES][feature.tag] = feature + feature.action.call if feature.action + end + feature.action.call if feature.action + $conf[:FEATURES][feature.tag] = feature + $conf[:LDSOFLAGS].concat(feature.uses_so||[]) + $conf[:BRIDGE_LDFLAGS].concat(feature.uses_bridge_so||[]) + $conf[:OBJS].concat(feature.uses_o||[]) + $conf[:OPTIONS].concat(feature.options||[]) + for k,v in feature.defines||{} do + $conf[:DEFINES][k]=(if Proc===v then v[] else v end) + end + true +end + +DUAL.puts "This is the GridFlow 0.8.0 configurator within Ruby version #{RUBY_VERSION}" + +begin + $features.each {|feature| try feature } +ensure + #!@#$ note: see END{} (duplication) + system "/bin/rm -f tmp/#{$$} tmp/#{$$}.c tmp/#{$$}.o tmp/#{$$}.asm" +end + +$conf[:LDSOFLAGS].uniq! +$conf[:BRIDGE_LDFLAGS].uniq! + +$CFLAGS += " -falign-functions=4" if $conf[:FEATURES][:gcc3] + +#if not $conf[:FEATURES][:gcc3] +# puts "You should install gcc 3.x; gcc 2.9.x is no longer supported" +# puts "(you might use --force-gcc3 to pretend at your own risk)" +# exit 1 +#end + +#--------------------------------# + +LOG.puts "-"*64 +for z in [:BRIDGE_LDFLAGS, :LDSOFLAGS, :OPTIONS, :DEFINES, :OBJS] do + LOG.puts "#{z}: #{$conf[z].inspect}" +end +LOG.puts "-"*64 +RUBY = "$(RUBY_INSTALL_NAME)" + +def my_install_files(f,base,entries,obase="$(sitelibdir)/gridflow/#{base}") + entries.each {|type,name,*rest| + if Array===name then name,oname=name else oname=name end + case type + when :ruby + f.puts "\t$(INSTALL_DATA) #{base+name} #{obase}/#{oname}" + when :directory + if oname[0,1]!="/" then oname="#{obase}/#{oname}" end + f.puts "\t$(INSTALL_DIR) #{oname}" + my_install_files(f,base+name,rest,oname) + end + } +end + +def my_uninstall_files(f,base,entries,obase="$(sitelibdir)/gridflow/#{base}") + entries.each {|type,name,*rest| + if Array===name then name,oname=name else oname=name end + case type + when :ruby + f.puts "\trm #{obase}/#{oname}" + when :directory + my_uninstall_files(f,base+name,rest) + end + } +end + +def make_makefile f + puts "" + f.puts "RUBY = #{RUBY}" + f.puts "ruby-all::", "" + f.puts "ruby-install::" + my_install_files(f,"",FILES) + f.puts "\tcp bin/jmax2pd $(gfbindir); chmod 755 $(gfbindir)/jmax2pd\n" + f.puts + f.puts "ruby-uninstall::" + my_uninstall_files(f,"",FILES) + f.puts +end + +puts "generating ./config.make" + +File.open("./config.make","w") {|f| f.puts " + +RUBYARCH=#{CONFIG['arch']} +" + +f.puts "BRIDGE_LDFLAGS = " + $conf[:BRIDGE_LDFLAGS].flatten.join(" ") + " " + $LDFLAGS + +if CONFIG["arch"] =~ /darwin/ then + f.puts "BRIDGE_LDFLAGS += -bundle -flat_namespace" +else + f.puts "BRIDGE_LDFLAGS += -rdynamic -shared" +end +$CFLAGS += " -mcpu=$(CPU)" if $conf[:DEFINES][:CPU] +$CFLAGS += " -march=$(CPU)" if $conf[:DEFINES][:CPU] +#$CFLAGS += " -fforce-addr" +#$CFLAGS += " -fprefetch-loop-arrays" +#$CFLAGS += " -falign-jumps=4" +#$CFLAGS += " -falign-loops=4" +f.puts "CFLAGS += " + $CFLAGS + +for k in $conf[:OPTIONS] do f.puts "#{k}=yes" end +for k,v in $conf[:DEFINES] do f.puts "#{k}=#{v}" end + +$sources = %w( +base/grid.c base/main.c base/number.c base/bitpacking.c +base/flow_objects.c +base/flow_objects_for_image.c +base/flow_objects_for_matrix.c +) + +#for o in $conf[:OBJS] do +# o=o.downcase.chomp(".o") +# x = o.downcase+".c" +# x = o.downcase+".m" if not File.exist?(x) +# #raise "woops, missing file #{o.downcase}.*" if not File.exist?(x) and +# # o!="cpu/mmx" +# $sources << x +#end + +f.puts "SOURCES = #{$sources.join(" ")} \\" +f.puts "" +} # end open config.make + +#--------------------------------# +puts "generating config.h" +File.open("config.h","w") {|f| f.puts " +\#ifndef __CONFIG_H +\#define __CONFIG_H +/* this file was auto-generated by gridflow/configure */ + +" +f.puts "#define STARTUP_LIST(PRE) \\" +f.puts $conf[:OBJS].map {|o| "PRE startup_#{File.basename(o,'.o')}();" }.join("\\\n") +for k in $conf[:OPTIONS] do f.puts "\#define #{k}" end +for k,v in $conf[:DEFINES] do f.puts "\#define #{k} "+v.inspect end +if $conf[:FEATURES][:mpeg3] +f.puts " +\#ifdef LIBMPEG_INCLUDE_HERE +\#include <#{$conf[:FEATURES][:mpeg3].uses_h}> +\#endif +" +end +f.puts " +\#define RUBY_BINDIR #{make_expand(CONFIG['bindir']).inspect} +\#endif /* __CONFIG_H */" +} + +#--------------------------------# +#puts "generating config.rb" +#File.open("config.rb","w") {|f| f.puts %{ +#\# this file was auto-generated by gridflow/configure +#}} +#----------------------------------------------------------------# +# Some fairly nontrivial abuse of black magic. + +$LOCAL_LIBS = $conf[:LDSOFLAGS].flatten.join(" ") + +$objs = $sources.collect{|i| i.sub(/.[cm]$/,".o") } +$objs[$objs.index("base/number.o"),1] = (1..3).map {|i| "base/number.#{i}.o" } +dir_config("gridflow") +create_makefile("gridflow") +mf = File.readlines("Makefile").join"" + +common_deps1 = "$(COMMON_DEPS)" +common_deps2 = common_deps1 + " base/grid.h.fcs" + +mf.sub!(/^.c.o:\s*\n\t(.*)\n/) { + comp=$1 + comp.sub!(/\(CC\)/,'(CXX)') + comp << " -o $@" if not comp =~ /-o\s*\$@/ + comp2 = comp.gsub /-c/,'-xobjective-c++ -c' + + "%.h.fcs: %.h #{common_deps1}\n\truby -w base/source_filter.rb $< $@\n\n"+ + "%.c.fcs: %.c #{common_deps2}\n\truby -w base/source_filter.rb $< $@\n\n"+ + "%.m.fcs: %.m #{common_deps2}\n\truby -w base/source_filter.rb $< $@\n\n"+ + "%.o: %.c.fcs #{common_deps2}\n\t#{comp}\n"+ + "%.1.o: %.c.fcs #{common_deps2}\n\t#{comp.gsub /-c/,'-DPASS1 -c'}\n"+ + "%.2.o: %.c.fcs #{common_deps2}\n\t#{comp.gsub /-c/,'-DPASS2 -c'}\n"+ + "%.3.o: %.c.fcs #{common_deps2}\n\t#{comp.gsub /-c/,'-DPASS3 -c'}\n"+ + "%.o: %.m.fcs #{common_deps2}\n\t#{comp2}\n" +} +mf.gsub!(/^.SUFFIXES:.*$/, ".SUFFIXES:\n\n") or mf<<".SUFFIXES:\n\n" +mf << ".PRECIOUS: %.h.fcs %.c.fcs %.m.fcs\n" +mf.gsub! /DESTDIR/, 'RUBYDESTDIR' +mf.gsub! /\*\.o/, "*.o */*.o" + +# GAAAH!!! +if RUBY_VERSION >= "1.8" then + mf.gsub!(/^((site-)?install:.*)/) {$1+" $(RUBYARCHDIR)/$(DLLIB) install2"} +else + mf.gsub!(/^((site-)?install:.*)/) {$1+" install2"} +end + +mf.gsub!(/^install:.*/) {"install:site-install"} # should i keep this line? +mf.sub!(/^all:(.*)$/) { "all: #{$1} all2" } +mf.sub! /^clean:/,"clean: clean2 " +mf.sub! /CC = gcc\n/, "CC = gcc\nCXX = #{$conf[:CC]}\n" +mf.sub! /^(OBJS = .*)$/, "\\1 #{$conf[:OBJS].join' '}" +mf[0,0] = "COMMON_DEPS = config.make Makefile Makefile.gf base/source_filter.rb\n"+ + "gfbindir = #{$conf[:BINDIR]}\n" +mf.sub!(/^site-install:\s*install/,"site-install: ") +mf.sub! /^prefix = .*$/, "prefix = " + make_expand($conf[:DEFINES][:RUBY_PREFIX]) +mf.sub! /^LDSHARED = g?cc/, "LDSHARED = $(CXX)" +# Adam Lindsay's Mac attempts. +mf.sub! /-no-precomp/, "-no-cpp-precomp" +# for proper operation on Cygwin +mf.sub! /--driver-name=gcc/, "--driver-name=#{$conf[:CC]}" +# remove gcc3.2 warning about -I/usr/include +mf.sub!(/^CPPFLAGS = (.*)$/) { + cpp = "CPPFLAGS = " + + make_expand($1).sub(%r"-I\s*/usr/include","") +} + +f = File.open("Makefile","w") +f.puts "include config.make" +f.puts mf +f.puts "include Makefile.gf" +make_makefile f +f.close + +#--------------------------------# + +puts "delegating to: devices4ruby/extconf.rb" +r=$conf[:DEFINES][:RUBY_PREFIX] +a=[] +a<<"--prefix"<<r if r +Dir.chdir "devices4ruby" +system "/usr/bin/env", "ruby", "extconf.rb", *a +Dir.chdir ".." +puts "(back)" + +#--------------------------------# + +puts "", +"\e[1mSee ./config.log if you want the details of the configuration tests.\e[0m", +"\e[1mIf you are satisfied with that configuration, you may go on,\e[0m", +"\e[1m and do \"make\" and then \"make install\".\e[0m", +"\e[1mIf you get stuck, you could contact the author about it,\e[0m", +"\e[1m but first make sure you read \"doc/install.html\". \e[0m", +"" + +#--------------------------------# + +END { + system "/bin/rm -f tmp/#{$$} tmp/#{$$}.c tmp/#{$$}.o tmp/#{$$}.asm" +} diff --git a/externals/gridflow/devices4ruby/ChangeLog b/externals/gridflow/devices4ruby/ChangeLog new file mode 100644 index 00000000..eb64908f --- /dev/null +++ b/externals/gridflow/devices4ruby/ChangeLog @@ -0,0 +1,12 @@ +/* $Id: ChangeLog,v 1.1 2005-10-04 02:12:44 matju Exp $ */ + +version 0.1.1 (2002.07.29): + * module Linux::SoundDSP renamed to Linux::SoundPCM (with alias) + * added installer (ruby extconf.rb && make install) + +version 0.1 (2001.06.28): + * added module IoctlClass, Ioctl + * added module Linux::SoundDSP (4 accessors) + * added module Linux::SoundMixer (25 accessors) + * added module Linux::ParallelPort (2 readers, 2 writers) + diff --git a/externals/gridflow/devices4ruby/README b/externals/gridflow/devices4ruby/README new file mode 100644 index 00000000..740b5165 --- /dev/null +++ b/externals/gridflow/devices4ruby/README @@ -0,0 +1,27 @@ +devices/linux + +AUTHOR + + Mathieu Bouchard <matju@sympatico.ca> + irc: irc.openprojects.net / #ruby-lang / matju + (note: I can't read Japanese; write in French or English please) + +OVERVIEW + +This is a collection of simple modules that you extend IO objects with, to +give them support for specific devices. For example: + + require "linux/SoundMixer" + f = File.open "/dev/mixer" + f.extend Linux::SoundMixer + + # f now has special accessors for driver variables, e.g: + + f.treble = left_speaker_percent + 256 * right_speaker_percent + +The modules are made of automatically generated methods, much like Ruby's +accessors. those generators are called ioctl_reader, ioctl_writer, +ioctl_accessor. Writing expects an integer in -2**31...2**31; reading will +return the same. You may browse the source to find out which accessors are +available, and it's easy to add support for more features. + diff --git a/externals/gridflow/doc/Makefile b/externals/gridflow/doc/Makefile new file mode 100644 index 00000000..9171db3f --- /dev/null +++ b/externals/gridflow/doc/Makefile @@ -0,0 +1,2 @@ +all:: + ruby moulinette.rb
\ No newline at end of file diff --git a/externals/gridflow/doc/gridflow.css b/externals/gridflow/doc/gridflow.css new file mode 100644 index 00000000..eae50bfa --- /dev/null +++ b/externals/gridflow/doc/gridflow.css @@ -0,0 +1,15 @@ +P {color:#000000; font-family: Arial, Helvetica, sans-serif; font-size:12px;} +B {color:#336699;} +A {color:#003366; font-family: Arial, Helvetica, sans-serif;} +A:link {color:#003366;} +A:active {color:#336699;} +A:visited {color:#336699;} +BODY {background-color:#FFFFFF;} +H1 {color:#336699; font-family: Arial, Helvetica, sans-serif;} +H2 {color:#336699; font-family: Arial, Helvetica, sans-serif;} +H3 {color:#336699; font-family: Arial, Helvetica, sans-serif;} +H4 {color:#004060; font-family: Arial, Helvetica, sans-serif;; font-size: 16px} +H5 {color:#004060; font-family: Arial, Helvetica, sans-serif;; font-size: 16px} +LI {font-family: Arial, Helvetica, sans-serif;} +.text {font-family: Arial, Helvetica, sans-serif; font-size:10px;; background-color: #FFFFFF}h5 { color:#336699; font-family: Arial, Helvetica, sans-serif; ; font-size: 14px} +dt { font-weight: bold; color: #006699} diff --git a/externals/gridflow/images/README b/externals/gridflow/images/README new file mode 100644 index 00000000..f5ff58d0 --- /dev/null +++ b/externals/gridflow/images/README @@ -0,0 +1,53 @@ +Here's the file to list the authors of the pictures, as +far as I (matju) know: + +b001.jpg, r001.jpg: + Eyewire Catalogue, 1999 or before. It should be checked + whether there still exists a copyright on this, because + the original provider has disappeared (bankruptcy??) + several years ago. + +g001.jpg: + by Alexandre Castonguay, 1999 (?). + +bluemarble.jpg: + NASA (?) + +lada.jpg: + hungarian newspaper ad. + +lena.jpg: + Lena Sjööblom Soderberg, centerfold of Playboy 1972.11. + Researchers in infographics have extensively used that + picture without necessarily asking for copyright, and + apparently Playboy doesn't mind. + +lucida-typewriter-12.grid.gz: + a grid(256,13,7) containing the Lucida Typewriter 12 + medium font. + +opensource.png: + modification of a World War Two poster. Both authors + (original's and spoof's) are unknown to me. Should check. + +rose.jpg: + unknown origin. + +ruby0216.jpg: + photo from a conference about the Ruby programming language, + held somewhere in Japan in 2003 or so. (?) + +teapot.png: + Researchers in infographics have also extensively used + that picture (actually the wireframe model). This is + (afaik) the original model, produced in the 1970's (?) + by one such researcher, and then was rendered in the + 1990's using the Povray raytracer, and then bundled as + teapot.ppm in Tcl/Tk, and finally in 2001 I grabbed + that picture + +test.mpeg: + unknown origin. Too small to be copyrightable. + +tux.tga.gz: + unknown origin. diff --git a/externals/gridflow/images/lucida-typewriter-12.grid.gz b/externals/gridflow/images/lucida-typewriter-12.grid.gz Binary files differnew file mode 100644 index 00000000..89064d1a --- /dev/null +++ b/externals/gridflow/images/lucida-typewriter-12.grid.gz diff --git a/externals/gridflow/images/test.mpeg b/externals/gridflow/images/test.mpeg Binary files differnew file mode 100644 index 00000000..bc10ef44 --- /dev/null +++ b/externals/gridflow/images/test.mpeg diff --git a/externals/gridflow/images/tux.tga.gz b/externals/gridflow/images/tux.tga.gz Binary files differnew file mode 100644 index 00000000..d520fc4e --- /dev/null +++ b/externals/gridflow/images/tux.tga.gz |