aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlluís gómez i bigordà <lluisbigorda@users.sourceforge.net>2007-10-24 20:37:21 +0000
committerlluís gómez i bigordà <lluisbigorda@users.sourceforge.net>2007-10-24 20:37:21 +0000
commit3c050000c6918b77a353583999e6e810aa675fda (patch)
treefc6aab7c92efb156966f5c926517f2f02e7b417e
This commit was generated by cvs2svn to compensate for changes in r8875,svn2git-root
which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/pdvjtools/; revision=8876
-rwxr-xr-xcolorgrid/CHANGES.LOG13
-rwxr-xr-xcolorgrid/INSTALL15
-rwxr-xr-xcolorgrid/Makefile83
-rwxr-xr-xcolorgrid/README20
-rw-r--r--colorgrid/base64.tcl29
-rwxr-xr-xcolorgrid/colorgrid.c1561
-rwxr-xr-xcolorgrid/colorgrid.tk88
-rwxr-xr-xcolorgrid/colorgrid.tk2c66
-rwxr-xr-xcolorgrid/g_colorgrid.h39
-rwxr-xr-xcolorgrid/help-colorgrid.pd47
-rwxr-xr-xcolorgrid/tk2c.bash24
-rwxr-xr-ximagegrid/INSTALL_imagegrid48
-rw-r--r--imagegrid/LICENSE674
-rwxr-xr-ximagegrid/Makefile38
-rwxr-xr-ximagegrid/cat-help-imagegrid.pd20
-rw-r--r--imagegrid/cua.c164
-rw-r--r--imagegrid/cua.h47
-rwxr-xr-ximagegrid/help-imagegrid.pd19
-rw-r--r--imagegrid/imagegrid.c823
-rw-r--r--imagegrid/imagegrid.tk146
-rw-r--r--imagegrid/imagegrid.tk2c115
-rw-r--r--imagegrid/imagegrid10x10.pd18
-rw-r--r--imagegrid/magickconverter.c52
-rw-r--r--imagegrid/magickconverter.h32
-rw-r--r--imagegrid/tk2c.sh25
-rwxr-xr-xpdp_freeframe/CHANGES.LOG6
-rw-r--r--pdp_freeframe/FreeFrame.h233
-rw-r--r--pdp_freeframe/INSTALL21
-rw-r--r--pdp_freeframe/Makefile16
-rw-r--r--pdp_freeframe/Makefile.config25
-rw-r--r--pdp_freeframe/help_pdp_freeframe.pd206
-rw-r--r--pdp_freeframe/pdp_freeframe.c461
-rwxr-xr-xpdp_frei0r/CHANGES.LOG2
-rw-r--r--pdp_frei0r/INSTALL20
-rw-r--r--pdp_frei0r/Makefile14
-rw-r--r--pdp_frei0r/Makefile.config22
-rw-r--r--pdp_frei0r/frei0r.h567
-rw-r--r--pdp_frei0r/help_pdp_frei0r.pd328
-rw-r--r--pdp_frei0r/pdp_frei0r.c637
-rw-r--r--pix_preview/.pix_2pnm.cpp.swpbin0 -> 81920 bytes
-rw-r--r--pix_preview/.pix_2pnm.h.swpbin0 -> 12288 bytes
-rw-r--r--pix_preview/.tm_project.cache0
-rw-r--r--pix_preview/Makefile37
-rwxr-xr-xpix_preview/Makefile.in37
-rwxr-xr-xpix_preview/configure4735
-rwxr-xr-xpix_preview/configure.ac83
-rw-r--r--pix_preview/help-pix_preview.pd77
-rw-r--r--pix_preview/help-pix_preview2.pd163
-rwxr-xr-xpix_preview/install18
-rwxr-xr-xpix_preview/install-sh251
-rw-r--r--pix_preview/pix_preview.cpp520
-rw-r--r--pix_preview/pix_preview.h144
-rwxr-xr-xpix_preview/pix_preview.tk2c66
-rwxr-xr-xvideogrid/INSTALL_videogrid48
-rw-r--r--videogrid/LICENSE674
-rwxr-xr-xvideogrid/Makefile38
-rwxr-xr-xvideogrid/cat-help-videogrid.pd20
-rw-r--r--videogrid/cua.c164
-rw-r--r--videogrid/cua.h47
-rwxr-xr-xvideogrid/help-videogrid.pd21
-rw-r--r--videogrid/qtconverter.c133
-rw-r--r--videogrid/qtconverter.h27
-rw-r--r--videogrid/tk2c.sh25
-rw-r--r--videogrid/videogrid.c827
-rw-r--r--videogrid/videogrid.tk146
-rw-r--r--videogrid/videogrid.tk2c115
66 files changed, 15180 insertions, 0 deletions
diff --git a/colorgrid/CHANGES.LOG b/colorgrid/CHANGES.LOG
new file mode 100755
index 0000000..ef94355
--- /dev/null
+++ b/colorgrid/CHANGES.LOG
@@ -0,0 +1,13 @@
+0.5
+ GOP working
+
+0.4
+ Added the colorpicker image inside the C code, so, there will not be more path problems.
+ Now colorgrid has one new requeriment :: libtk-img
+
+0.2
+ Better algorithm for extract RGB values
+ new spectrum image
+
+0.1
+ First version for pd 0.37
diff --git a/colorgrid/INSTALL b/colorgrid/INSTALL
new file mode 100755
index 0000000..983cac8
--- /dev/null
+++ b/colorgrid/INSTALL
@@ -0,0 +1,15 @@
+untar in /usr/local/lib/pd/externs
+
+cd /usr/local/lib/pd/externs/colorgrid
+
+make clean
+
+make
+
+make install
+
+open help-colorgrid.pd
+
+Thanx for getting here.
+Lluis/
+comments and bugs @ lluis@artefacte.org
diff --git a/colorgrid/Makefile b/colorgrid/Makefile
new file mode 100755
index 0000000..9131509
--- /dev/null
+++ b/colorgrid/Makefile
@@ -0,0 +1,83 @@
+NAME=colorgrid
+CSYM=colorgrid
+
+current: pd_linux
+
+# ----------------------- NT -----------------------
+
+pd_nt: $(NAME).dll
+
+.SUFFIXES: .dll
+
+PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
+VC="C:\Program Files\Microsoft Visual Studio\Vc98"
+
+PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include
+
+PDNTLDIR = $(VC)\lib
+PDNTLIB = $(PDNTLDIR)\libc.lib \
+ $(PDNTLDIR)\oldnames.lib \
+ $(PDNTLDIR)\kernel32.lib \
+ \ftp\pd\bin\pd.lib
+
+.c.dll:
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
+ link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
+
+# ----------------------- IRIX 5.x -----------------------
+
+pd_irix5: $(NAME).pd_irix5
+
+.SUFFIXES: .pd_irix5
+
+SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
+
+SGIINCLUDE = -I../../src
+
+.c.pd_irix5:
+ cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
+ rm $*.o
+
+# ----------------------- IRIX 6.x -----------------------
+
+pd_irix6: $(NAME).pd_irix6
+
+.SUFFIXES: .pd_irix6
+
+SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -Ofast=ip32
+
+.c.pd_irix6:
+ cc $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
+ rm $*.o
+
+# ----------------------- LINUX i386 -----------------------
+
+pd_linux: $(NAME).pd_linux
+
+.SUFFIXES: .pd_linux
+
+LINUXCFLAGS = -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wno-shadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch #-Werror
+
+LINUXINCLUDE = -I../../src -I/usr/src/pd-0.40-2/src
+
+.c.pd_linux:
+ ./tk2c.bash < $*.tk > $*.tk2c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+ strip --strip-unneeded $*.pd_linux
+ rm -f $*.o ../$*.pd_linux
+ ln -s $*/$*.pd_linux ..
+
+# ----------------------------------------------------------
+
+install:
+ cp help-*.pd ../../doc/5.reference
+
+clean:
+ rm -f *.o *.pd_* so_locations
diff --git a/colorgrid/README b/colorgrid/README
new file mode 100755
index 0000000..77a1fc2
--- /dev/null
+++ b/colorgrid/README
@@ -0,0 +1,20 @@
+Version 0.01
+copyright 2004 by Lluis Gomez
+inspired by the grid object written by Yves Degoyon
+tarballs and updates available @ http://pd.artefacte.org
+
+colorgrid : grid color picker
+
+To install grid, follow the steps from INSTALL
+
+This software is published under GPL terms.
+
+This is software with ABSOLUTELY NO WARRANTY.
+Use it at your OWN RISK. It's possible to damage e.g. hardware or your hearing
+due to a bug or for other reasons.
+We do not warrant that the program is free of infringement of any third-party
+patents.
+
+*****************************************************************************
+
+
diff --git a/colorgrid/base64.tcl b/colorgrid/base64.tcl
new file mode 100644
index 0000000..26ad408
--- /dev/null
+++ b/colorgrid/base64.tcl
@@ -0,0 +1,29 @@
+ package require base64
+
+ proc encode {} {
+ .txt delete 1.0 end
+ set fileID [open [tk_getOpenFile] RDONLY]
+ fconfigure $fileID -translation binary
+ set rawData [read $fileID]
+ close $fileID
+ set encodedData [base64::encode $rawData]
+ .txt insert 1.0 $encodedData
+ }
+
+ proc clipcopy {} {
+ clipboard clear
+ clipboard append [.txt get 1.0 end]
+ }
+
+ wm title . "Base64 Gif Encoder"
+ text .txt -wrap none -font "Courier 10"
+ menu .mbar
+ . configure -menu .mbar
+ .mbar add command -label "Encode File" -command encode
+ .mbar add command -label "Copy2Clipboard" -command clipcopy
+ .mbar add command -label "Exit" -command {destroy .; exit}
+
+ pack .txt -expand 1 -fill both
+
+ encode
+ ### End of Script
diff --git a/colorgrid/colorgrid.c b/colorgrid/colorgrid.c
new file mode 100755
index 0000000..99e7023
--- /dev/null
+++ b/colorgrid/colorgrid.c
@@ -0,0 +1,1561 @@
+/* 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. */
+
+/* g_colorgrid.c written by Yves Degoyon 2002 */
+/* colorgrid control object : two dimensionnal colorgrid */
+/* thanks to Thomas Musil, Miller Puckette, Guenther Geiger and Krzystof Czaja */
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include <ctype.h>
+#include "m_pd.h"
+#include "m_imp.h"
+#include "g_canvas.h"
+#include "t_tk.h"
+#include "g_colorgrid.h"
+
+#ifdef NT
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#define COLORGRID_IMG "/usr/local/lib/pd/externs/colorgrid/colorgrid.pnm"
+#define DEFAULT_COLORGRID_WIDTH 256
+#define DEFAULT_COLORGRID_HEIGHT 50
+#define DEFAULT_COLORGRID_NBLINES 10
+
+t_widgetbehavior colorgrid_widgetbehavior;
+static t_class *colorgrid_class;
+static int colorgridcount=0;
+
+static int guidebug=0;
+static int pointsize = 5;
+
+static char *colorgrid_version = "colorgrid: version 0.4, written by Yves Degoyon (ydegoyon@free.fr) & Lluis Gomez i Bigorda (lluis@artefacte.org)";
+
+#define COLORGRID_SYS_VGUI2(a,b) if (guidebug) \
+ post(a,b);\
+ sys_vgui(a,b)
+
+#define COLORGRID_SYS_VGUI3(a,b,c) if (guidebug) \
+ post(a,b,c);\
+ sys_vgui(a,b,c)
+
+#define COLORGRID_SYS_VGUI4(a,b,c,d) if (guidebug) \
+ post(a,b,c,d);\
+ sys_vgui(a,b,c,d)
+
+#define COLORGRID_SYS_VGUI5(a,b,c,d,e) if (guidebug) \
+ post(a,b,c,d,e);\
+ sys_vgui(a,b,c,d,e)
+
+#define COLORGRID_SYS_VGUI6(a,b,c,d,e,f) if (guidebug) \
+ post(a,b,c,d,e,f);\
+ sys_vgui(a,b,c,d,e,f)
+
+#define COLORGRID_SYS_VGUI7(a,b,c,d,e,f,g) if (guidebug) \
+ post(a,b,c,d,e,f,g );\
+ sys_vgui(a,b,c,d,e,f,g)
+
+#define COLORGRID_SYS_VGUI8(a,b,c,d,e,f,g,h) if (guidebug) \
+ post(a,b,c,d,e,f,g,h );\
+ sys_vgui(a,b,c,d,e,f,g,h)
+
+#define COLORGRID_SYS_VGUI9(a,b,c,d,e,f,g,h,i) if (guidebug) \
+ post(a,b,c,d,e,f,g,h,i );\
+ sys_vgui(a,b,c,d,e,f,g,h,i)
+
+/* drawing functions */
+static void colorgrid_draw_update(t_colorgrid *x, t_glist *glist)
+{
+ t_canvas *canvas=glist_getcanvas(glist);
+ t_int xpoint=x->x_current, ypoint=x->y_current;
+
+ // later : try to figure out what's this test for ??
+ // if (glist_isvisible(glist))
+ // {
+ // delete previous point if existing
+ if (x->x_point)
+ {
+ COLORGRID_SYS_VGUI3(".x%x.c delete %xPOINT\n", canvas, x);
+ }
+
+ if ( x->x_current < text_xpix(&x->x_obj, x->x_glist) ) xpoint = text_xpix(&x->x_obj, x->x_glist);
+ if ( x->x_current > text_xpix(&x->x_obj, x->x_glist) + x->x_width - pointsize )
+ xpoint = text_xpix(&x->x_obj, x->x_glist) + x->x_width - pointsize;
+ if ( x->y_current < text_ypix(&x->x_obj, x->x_glist) ) ypoint = text_ypix(&x->x_obj, x->x_glist);
+ if ( x->y_current > text_ypix(&x->x_obj, x->x_glist) + x->x_height - pointsize )
+ ypoint = text_ypix(&x->x_obj, x->x_glist) + x->x_height - pointsize;
+ // draw the selected point
+ COLORGRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline {} -fill #FF0000 -tags %xPOINT\n",
+ canvas, xpoint, ypoint, xpoint+5, ypoint+5, x);
+ x->x_point = 1;
+ // }
+ // else
+ // {
+ // post( "colorgrid : position updated in an invisible colorgrid" );
+ // }
+}
+
+static void colorgrid_draw_new(t_colorgrid *x, t_glist *glist)
+{
+ t_canvas *canvas=glist_getcanvas(glist);
+ char *tagRoot;
+ char fname[MAXPDSTRING]=COLORGRID_IMG;
+
+ char *fdata="UDYKIyBDUkVBVE9SOiBUaGUgR0lNUCdzIFBOTSBGaWx0ZXIgVmVyc2lvbiAx\
+LjAKMjU2IDUwCjI1NQpMBwdMCQdMCgdMDAdMDgdMDwdMEQdMEwdMFAdMFgdM\
+FwdMGQdMGwdMHAdMHgdMHwdMIQdMIwdMJAdMJgdMKAdMKQdMKwdMLAdMLgdM\
+MAdMMQdMMwdMNQdMNgdMOAdMOQdMOwdMPQdMPgdMQAdMQgdMQwdMRQdMRgdM\
+SAdMSgdMSwdMTAdKTAdJTAdHTAdFTAdETAdCTAdATAc/TAc9TAc8TAc6TAc4\
+TAc3TAc1TAczTAcyTAcwTAcvTActTAcrTAcqTAcoTAcnTAclTAcjTAciTAcg\
+TAceTAcdTAcbTAcaTAcY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ISK+ISI+ISF+ISE+IaE+IiE+IuE+I6E+JGE+JOE+JaE\
++JmE+JyE+J6E+KGE+KSE+KaE+KmE+KyE+K+E+LGE+LSE+LeE+LqE+LyE+L+E\
++MKE+MSE+MeE+MqE+M2E+M+E+NKE+NWE+NiE+NqE+N2E+OCE+OKE+OWE+OiE\
++OuE+O2E+PCE+POE+PaE+PiE9viE8/iE8PiE7fiE6/iE6PiE5fiE4viE4PiE\
+3fiE2viE2PiE1fiE0viEz/iEzfiEyviEx/iExPiEwviEv/iEvPiEuviEt/iE\
+tPiEsfiEr/iErPiEqfiEpviEpPiEofiEnviEnPiEmfiElviEk/iEkfiEjviE\
+i/iEiPiEhviFhPiIhPiKhPiNhPiQhPiShPiVhPiYhPibhPidhPighPijhPim\
+hPiohPirhPiuhPiwhPizhPi2hPi5hPi7hPi+hPjBhPjEhPjGhPjJhPjMhPjO\
+hPjRhPjUhPjXhPjZhPjchPjfhPjihPjkhPjnhPjqhPjthPjvhPjyhPj1hPj3\
+hPj4hPf4hPT4hPH4hO74hOz4hOn4hOb4hOP4hOH4hN74hNv4hNj4hNb4hNP4\
+hND4hM74hMv4hMj4hMX4hMP4hMD4hL34hLr4hLj4hLX4hLL4hLD4hK34hKr4\
+hKf4hKX4hKL4hJ/4hJz4hJr4hJf4hJT4hJL4hI/4hIz4hIn4hIf4jY34j434\
+ko34lI34l434mY34nI34no34oY34pI34po34qY34q434ro34sI34s434tY34\
+uI34uo34vY34v434wo34xI34x434yY34zI34zo340Y3404341o342I342434\
+3Y344I344o345Y346I346o347Y3474348o349I349433+I31+I3y+I3w+I3t\
++I3r+I3o+I3m+I3j+I3h+I3e+I3c+I3Z+I3X+I3U+I3S+I3P+I3N+I3K+I3I\
++I3F+I3D+I3A+I2++I27+I25+I22+I2z+I2x+I2u+I2s+I2p+I2n+I2k+I2i\
++I2f+I2d+I2a+I2Y+I2V+I2T+I2Q+I2O+I2N+I+N+JGN+JSN+JaN+JmN+JuN\
++J6N+KCN+KON+KWN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jV+OjV+OnV+OrV+OvV+OzV\
++O3V+O3V+O7V+O/V+PDV+PHV+PLV+PLV+PPV+PTV+PXV+PbV+PfV+PfV+PjV\
+9/jV9/jV9vjV9fjV9PjV8/jV8vjV8vjV8fjV8PjV7/jV7vjV7fjV7fjV7PjV\
+6/jV6vjV6fjV6PjV6PjV5/jV5vjV5fjV5PjV4/jV4vjV4vjV4fjV4PjV3/jV\
+3vjV3fjV3fjV3PjV2/jV2vjV2fjV2PjV2PjV1/jV1vjV1fjV1fjW1fjW1fjX\
+1fjY1fjZ1fja1fjb1fjb1fjc1fjd1fje1fjf1fjg1fjh1fjh1fji1fjj1fjk\
+1fjl1fjm1fjm1fjn1fjo1fjp1fjq1fjr1fjr1fjs1fjt1fju1fjv1fjw1fjw\
+1fjx1fjy1fjz1fj01fj11fj21fj21fj31fj41fj41fj41ff41fb41fX41fT4\
+1fT41fP41fL41fH41fD41e/41e/41e741e341ez41ev41er41en41en41ej4\
+1ef41eb41eX41eT41eT41eP41eL41eH41eD41d/41d/41d741d341dz41dv4\
+1dr41dr41dn41dj41df41db41dX43d343t34393439344N344d344d344t34\
+4t3449345N345N345d345t345t3459346N346N346d346d346t3469346934\
+7N347d347d347t347t3479348N348N348d348t348t3489349N349N349d34\
+9d349t3499349934+N34+N33+N33+N32+N32+N31+N30+N30+N3z+N3y+N3y\
++N3x+N3x+N3w+N3v+N3v+N3u+N3t+N3t+N3s+N3s+N3r+N3q+N3q+N3p+N3o\
++N3o+N3n+N3m+N3m+N3l+N3l+N3k+N3j+N3j+N3i+N3h+N3h+N3g+N3g+N3f\
++N3e+N3e+N3d+N7d+N/d+N/d+ODd+ODd+OHd+OLd+OLd+OPd+OTd+OTd+OXd\
++OXd+Obd+Ofd+Ofd+Ojd+Ond+Ond+Ord+Ord+Ovd+Ozd+Ozd+O3d+O7d+O7d\
++O/d+PDd+PDd+PHd+PHd+PLd+PPd+PPd+PTd+PXd+PXd+Pbd+Pbd+Pfd+Pjd\
++Pjd+Pjd9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9vjv9vjv9vjv9vjv\
+9vjv9fjv9fjv9fjv9fjv9fjv9Pjv9Pjv9Pjv9Pjv9Pjv8/jv8/jv8/jv8/jv\
+8vjv8vjv8vjv8vjv8vjv8fjv8fjv8fjv8fjv8fjv8Pjv8Pjv8Pjv8Pjv8Pjv\
+7/jw7/jw7/jw7/jw7/jw7/jx7/jx7/jx7/jx7/jy7/jy7/jy7/jy7/jy7/jz\
+7/jz7/jz7/jz7/jz7/j07/j07/j07/j07/j07/j17/j17/j17/j17/j27/j2\
+7/j27/j27/j27/j37/j37/j37/j37/j37/j47/j47/j47/j47/j47/j47/j4\
+7/j47/j47/f47/f47/f47/f47/f47/b47/b47/b47/b47/X47/X47/X47/X4\
+7/X47/T47/T47/T47/T47/T47/P47/P47/P47/P47/P47/L47/L47/L47/L4\
+7/H47/H47/H47/H47/H47/D47/D47/D47/D47/A=";
+
+
+ rtext_new(glist, (t_text *)x);
+ tagRoot = rtext_gettag(glist_findrtext(glist,(t_text *)x));
+
+ //post("%s",tagRoot);
+
+ COLORGRID_SYS_VGUI3("image create photo img%x -data {%s}\n",x,fdata);
+
+ COLORGRID_SYS_VGUI6(".x%x.c create image %d %d -image img%x -tags %sS\n", canvas,text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x,tagRoot);
+ COLORGRID_SYS_VGUI5(".x%x.c coords %sS %d %d \n",
+ canvas, tagRoot,
+ text_xpix(&x->x_obj, x->x_glist) + 128, text_ypix(&x->x_obj, x->x_glist) + 25);
+
+ COLORGRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so0\n",
+ canvas, text_xpix(&x->x_obj, x->x_glist), text_ypix(&x->x_obj, x->x_glist) + x->x_height+1,
+ text_xpix(&x->x_obj, x->x_glist)+7, text_ypix(&x->x_obj, x->x_glist) + x->x_height+2,
+ tagRoot);
+ COLORGRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so1\n",
+ canvas, text_xpix(&x->x_obj, x->x_glist)+x->x_width-7, text_ypix(&x->x_obj, x->x_glist) + x->x_height+1,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width, text_ypix(&x->x_obj, x->x_glist) + x->x_height+2,
+ tagRoot);
+ COLORGRID_SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -tags %so2\n",
+ canvas, text_xpix(&x->x_obj, x->x_glist)+x->x_width-131, text_ypix(&x->x_obj, x->x_glist) + x->x_height+1,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width-126, text_ypix(&x->x_obj, x->x_glist) + x->x_height+2,
+ tagRoot);
+
+ if ( x->x_colorgrid )
+ {
+ int xlpos = text_xpix(&x->x_obj, x->x_glist)+x->x_width/x->x_xlines;
+ int ylpos = text_ypix(&x->x_obj, x->x_glist)+x->x_height/x->x_ylines;
+ int xcount = 1;
+ int ycount = 1;
+ while ( xlpos < text_xpix(&x->x_obj, x->x_glist)+x->x_width )
+ {
+ COLORGRID_SYS_VGUI9(".x%x.c create line %d %d %d %d -fill #FFFFFF -tags %xLINE%d%d\n",
+ canvas, xlpos, text_ypix(&x->x_obj, x->x_glist),
+ xlpos, text_ypix(&x->x_obj, x->x_glist)+x->x_height,
+ x, xcount, 0 );
+ xlpos+=x->x_width/x->x_xlines;
+ xcount++;
+ }
+ while ( ylpos < text_ypix(&x->x_obj, x->x_glist)+x->x_height )
+ {
+ COLORGRID_SYS_VGUI9(".x%x.c create line %d %d %d %d -fill #FFFFFF -tags %xLINE%d%d\n",
+ canvas, text_xpix(&x->x_obj, x->x_glist), ylpos,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width, ylpos,
+ x, 0, ycount);
+ ylpos+=x->x_height/x->x_ylines;
+ ycount++;
+ }
+ }
+ canvas_fixlinesfor( canvas, (t_text*)x );
+}
+
+static void colorgrid_draw_move(t_colorgrid *x, t_glist *glist)
+{
+ t_canvas *canvas=glist_getcanvas(glist);
+ char *tagRoot;
+
+ tagRoot = rtext_gettag(glist_findrtext(glist,(t_text *)x));
+ COLORGRID_SYS_VGUI7(".x%x.c coords %xCOLORGRID %d %d %d %d\n",
+ canvas, x,
+ text_xpix(&x->x_obj, x->x_glist), text_ypix(&x->x_obj, x->x_glist),
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width, text_ypix(&x->x_obj, x->x_glist)+x->x_height);
+ COLORGRID_SYS_VGUI5(".x%x.c coords %sS %d %d \n",
+ canvas, tagRoot,
+ text_xpix(&x->x_obj, x->x_glist) + 128, text_ypix(&x->x_obj, x->x_glist) + 25);
+ COLORGRID_SYS_VGUI7(".x%x.c coords %so0 %d %d %d %d\n",
+ canvas, tagRoot,
+ text_xpix(&x->x_obj, x->x_glist), text_ypix(&x->x_obj, x->x_glist) + x->x_height+1,
+ text_xpix(&x->x_obj, x->x_glist)+7, text_ypix(&x->x_obj, x->x_glist) + x->x_height+2 );
+ COLORGRID_SYS_VGUI7(".x%x.c coords %so1 %d %d %d %d\n",
+ canvas, tagRoot,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width-7, text_ypix(&x->x_obj, x->x_glist) + x->x_height+1,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width, text_ypix(&x->x_obj, x->x_glist) + x->x_height+2 );
+ COLORGRID_SYS_VGUI7(".x%x.c coords %so2 %d %d %d %d\n",
+ canvas, tagRoot,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width-131, text_ypix(&x->x_obj, x->x_glist) + x->x_height+1,
+ text_xpix(&x->x_obj, x->x_glist)+x->x_width-126, text_ypix(&x->x_obj, x->x_glist) + x->x_height+2 );
+ if ( x->x_point )
+ {
+ colorgrid_draw_update(x, glist);
+ }
+ if ( x->x_colorgrid )
+ {
+ int xlpos = text_xpix(&x->x_obj, x->x_glist)+x->x_width/x->x_xlines;
+ int ylpos = text_ypix(&x->x_obj, x->x_glist)+x->x_height/x->x_ylines;
+ int xcount = 1;
+ int ycount = 1;
+ while ( xlpos < text_xpix(&x->x_obj, x->x_glist)+x->x_width )
+ {
+ COLORGRID_SYS_VGUI9(".x%x.c coords %xLINE%d%d %d %d %d %d\n",
+ canvas, x, xcount, 0, xlpos, text_ypix(&x->x_obj, x->x_glist),
+ xlpos, text_ypix(&x->x_obj, x->x_glist) + x->x_height);
+ xlpos+=x->x_width/x->x_xlines;
+ xcount++;
+ }
+ while ( ylpos < text_ypix(&x->x_obj, x->x_glist)+x->x_height )
+ {
+ COLORGRID_SYS_VGUI9(".x%x.c coords %xLINE%d%d %d %d %d %d\n",
+ canvas, x, 0, ycount, text_xpix(&x->x_obj, x->x_glist), ylpos,
+ text_xpix(&x->x_obj, x->x_glist) + x->x_width, ylpos);
+ ylpos+=x->x_height/x->x_ylines;
+ ycount++;
+ }
+ }
+ canvas_fixlinesfor( canvas, (t_text*)x );
+}
+
+static void colorgrid_draw_erase(t_colorgrid* x,t_glist* glist)
+{
+ t_canvas *canvas=glist_getcanvas(glist);
+ int i;
+ char *tagRoot;
+
+ tagRoot = rtext_gettag(glist_findrtext(glist,(t_text *)x));
+ COLORGRID_SYS_VGUI3(".x%x.c delete %xCOLORGRID\n", canvas, x);
+ COLORGRID_SYS_VGUI3(".x%x.c delete %sS\n", canvas, tagRoot);
+ COLORGRID_SYS_VGUI3(".x%x.c delete %so0\n", canvas, tagRoot);
+ COLORGRID_SYS_VGUI3(".x%x.c delete %so1\n", canvas, tagRoot);
+ COLORGRID_SYS_VGUI3(".x%x.c delete %so2\n", canvas, tagRoot);
+ if (x->x_colorgrid)
+ {
+ for (i=1; i<x->x_xlines; i++ )
+ {
+ COLORGRID_SYS_VGUI4(".x%x.c delete %xLINE%d0\n", canvas, x, i);
+ }
+ for (i=1; i<x->x_ylines; i++ )
+ {
+ COLORGRID_SYS_VGUI4(".x%x.c delete %xLINE0%d\n", canvas, x, i);
+ }
+ }
+ if (x->x_point)
+ {
+ COLORGRID_SYS_VGUI3(".x%x.c delete %xPOINT\n", canvas, x);
+ x->x_point = 0;
+ }
+ rtext_free(glist_findrtext(glist, (t_text *)x));
+}
+
+static void colorgrid_draw_select(t_colorgrid* x,t_glist* glist)
+{
+ t_canvas *canvas=glist_getcanvas(glist);
+
+ if(x->x_selected)
+ {
+ pd_bind(&x->x_obj.ob_pd, x->x_name);
+ /* sets the item in blue */
+ COLORGRID_SYS_VGUI3(".x%x.c itemconfigure %xCOLORGRID -outline #0000FF\n", canvas, x);
+ }
+ else
+ {
+ pd_unbind(&x->x_obj.ob_pd, x->x_name);
+ COLORGRID_SYS_VGUI3(".x%x.c itemconfigure %xCOLORGRID -outline #000000\n", canvas, x);
+ }
+}
+
+static void colorgrid_hsv2rgb(t_float hue, t_float saturation, t_float value, t_float *red, t_float *green, t_float *blue)
+{
+ t_float i=0, f=0, p=0, q=0, t=0;
+
+ if (saturation == 0) {
+ *red = value;
+ *green = value;
+ *blue = value;
+ } else {
+ if (hue == 6) hue = 0;
+ i = (int)hue ; /* the integer part of hue */
+ f = hue - i;
+ p = value * (1 - saturation);
+ q = value * (1 - (saturation * f));
+ t = value * (1 - (saturation * (1 - f)));
+ switch ((int)i) {
+ case 0:
+ *red = value;
+ *green = t;
+ *blue = p;
+ break;
+ case 1:
+ *red = q;
+ *green = value;
+ *blue = p;
+ break;
+ case 2:
+ *red = p;
+ *green = value;
+ *blue = t;
+ break;
+ case 3:
+ *red = p;
+ *green = q;
+ *blue = value;
+ break;
+ case 4:
+ *red = t;
+ *green = p;
+ *blue = value;
+ break;
+ case 5:
+ *red = value;
+ *green = p;
+ *blue = q;
+ break;
+ }
+ }
+}
+
+static void colorgrid_output_current(t_colorgrid* x)
+{
+ t_float ox=0, oy=0, hue, saturation, value, red=0, green=0, blue=0;
+
+/* These values need to be the same as those that produced the spectrum image:*/
+
+ t_float box_x = 256;
+ t_float box_y = 25;
+
+ t_float min_value = 0.3;
+ t_float max_value = 1.0;
+ t_float value_inc = (max_value - min_value) / box_y;
+
+ t_float min_hue = 0;
+ t_float max_hue = 6;
+ t_float hue_inc = (max_hue - min_hue) / box_x;
+
+ t_float max_saturation = 0.9;
+ t_float min_saturation = 0.0;
+ t_float saturation_inc = (max_saturation - min_saturation) / box_y;
+
+ t_float xvalue, yvalue, rvalue, gvalue, bvalue;
+ t_float xmodstep, ymodstep;
+
+ xvalue = x->x_min + (x->x_current - text_xpix(&x->x_obj, x->x_glist)) * (x->x_max-x->x_min) / x->x_width ;
+ if (xvalue < x->x_min ) xvalue = x->x_min;
+ if (xvalue > x->x_max ) xvalue = x->x_max;
+ xmodstep = ((float)((int)(xvalue*10000) % (int)(x->x_xstep*10000))/10000.);
+ xvalue = xvalue - xmodstep;
+ yvalue = x->y_max - (x->y_current - text_ypix(&x->x_obj, x->x_glist) ) * (x->y_max-x->y_min) / x->x_height ;
+ if (yvalue < x->y_min ) yvalue = x->y_min;
+ if (yvalue > x->y_max ) yvalue = x->y_max;
+ ymodstep = ((float)((int)(yvalue*10000) % (int)(x->x_ystep*10000))/10000.);
+ yvalue = yvalue - ymodstep;
+ yvalue = 50 - yvalue;
+
+ /* Use the coordinates only if they are non-zero: */
+
+ if ((xvalue >= 0) && (yvalue >= 0)) {
+ ox = xvalue;
+ oy = yvalue;
+ } else {
+ xvalue = ox;
+ yvalue = oy;
+ }
+
+ if ((yvalue != 0)&&(yvalue!=50))
+ {
+ /* Calculate HSV based on given coordinates and convert to RGB: */
+ hue = hue_inc * xvalue;
+ if (yvalue <= box_y) {
+ saturation = max_saturation;
+ value = min_value + (value_inc * yvalue);
+ } else {
+ value = max_value - value_inc;
+ saturation = max_saturation - (saturation_inc * (yvalue - box_y));
+ }
+
+ colorgrid_hsv2rgb(hue, saturation, value, &red, &green, &blue);
+ } else {
+ if (yvalue == 0) {
+ red = 0;
+ green = 0;
+ blue = 0;
+ } else {
+ red = 1;
+ green = 1;
+ blue = 1;
+ }
+ }
+
+ /* The RGB values are returned in the interval [0..1] so we
+ need to multiply by 256 to get "normal" color values.*/
+
+ red = red * 256;
+ green = green * 256;
+ blue = blue * 256;
+
+ outlet_float( x->x_xoutlet, red );
+ outlet_float( x->x_youtlet, green );
+ outlet_float( x->x_zoutlet, blue );
+}
+
+/* ------------------------ colorgrid widgetbehaviour----------------------------- */
+
+
+static void colorgrid_getrect(t_gobj *z, t_glist *owner,
+ int *xp1, int *yp1, int *xp2, int *yp2)
+{
+ t_colorgrid* x = (t_colorgrid*)z;
+
+ *xp1 = text_xpix(&x->x_obj, x->x_glist);
+ *yp1 = text_ypix(&x->x_obj, x->x_glist);
+ *xp2 = text_xpix(&x->x_obj, x->x_glist)+x->x_width;
+ *yp2 = text_ypix(&x->x_obj, x->x_glist)+x->x_height;
+}
+
+static void colorgrid_save(t_gobj *z, t_binbuf *b)
+{
+ t_colorgrid *x = (t_colorgrid *)z;
+
+ // post( "saving colorgrid : %s", x->x_name->s_name );
+ binbuf_addv(b, "ssiissiffiffiffiiff", gensym("#X"),gensym("obj"),
+ (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix,
+ gensym("colorgrid"), x->x_name, x->x_width, x->x_min,
+ x->x_max, x->x_height,
+ x->y_min, x->y_max,
+ x->x_colorgrid, x->x_xstep,
+ x->x_ystep, x->x_xlines, x->x_ylines,
+ x->x_current, x->y_current );
+ binbuf_addv(b, ";");
+}
+
+static void colorgrid_properties(t_gobj *z, t_glist *owner)
+{
+ char buf[800];
+ t_colorgrid *x=(t_colorgrid *)z;
+
+ sprintf(buf, "pdtk_colorgrid_dialog %%s %d %d %d\n",
+ x->x_xlines, x->x_ylines, x->x_colorgrid );
+ // post("colorgrid_properties : %s", buf );
+ gfxstub_new(&x->x_obj.ob_pd, x, buf);
+}
+
+static void colorgrid_select(t_gobj *z, t_glist *glist, int selected)
+{
+ t_colorgrid *x = (t_colorgrid *)z;
+
+ x->x_selected = selected;
+ colorgrid_draw_select( x, glist );
+}
+
+static void colorgrid_vis(t_gobj *z, t_glist *glist, int vis)
+{
+ t_colorgrid *x = (t_colorgrid *)z;
+
+ if (vis)
+ {
+ colorgrid_draw_new( x, glist );
+ colorgrid_draw_update( x, glist );
+ colorgrid_output_current(x);
+ }
+ else
+ {
+ colorgrid_draw_erase( x, glist );
+ }
+}
+
+static void colorgrid_dialog(t_colorgrid *x, t_symbol *s, int argc, t_atom *argv)
+{
+ if ( !x ) {
+ post( "colorgrid : error :tried to set properties on an unexisting object" );
+ }
+ if ( argv[0].a_type != A_FLOAT || argv[1].a_type != A_FLOAT ||
+ argv[2].a_type != A_FLOAT )
+ {
+ post( "colorgrid : wrong arguments" );
+ return;
+ }
+ x->x_xlines = argv[0].a_w.w_float;
+ x->x_ylines = argv[1].a_w.w_float;
+ x->x_colorgrid = argv[2].a_w.w_float;
+ colorgrid_draw_erase(x, x->x_glist);
+ colorgrid_draw_new(x, x->x_glist);
+}
+
+static void colorgrid_delete(t_gobj *z, t_glist *glist)
+{
+ canvas_deletelinesfor( glist_getcanvas(glist), (t_text *)z);
+}
+
+static void colorgrid_displace(t_gobj *z, t_glist *glist, int dx, int dy)
+{
+ t_colorgrid *x = (t_colorgrid *)z;
+ int xold = text_xpix(&x->x_obj, x->x_glist);
+ int yold = text_ypix(&x->x_obj, x->x_glist);
+
+ // post( "colorgrid_displace dx=%d dy=%d", dx, dy );
+
+ x->x_obj.te_xpix += dx;
+ x->x_current += dx;
+ x->x_obj.te_ypix += dy;
+ x->y_current += dy;
+ if(xold != text_xpix(&x->x_obj, x->x_glist) || yold != text_ypix(&x->x_obj, x->x_glist))
+ {
+ colorgrid_draw_move(x, x->x_glist);
+ }
+}
+
+static void colorgrid_motion(t_colorgrid *x, t_floatarg dx, t_floatarg dy)
+{
+ int xold = x->x_current;
+ int yold = x->y_current;
+
+ // post( "colorgrid_motion dx=%f dy=%f", dx, dy );
+
+ x->x_current += dx;
+ x->y_current += dy;
+ if(xold != x->x_current || yold != x->y_current)
+ {
+ colorgrid_output_current(x);
+ colorgrid_draw_update(x, x->x_glist);
+ }
+}
+
+static int colorgrid_click(t_gobj *z, struct _glist *glist,
+ int xpix, int ypix, int shift, int alt, int dbl, int doit)
+{
+ t_colorgrid* x = (t_colorgrid *)z;
+
+ // post( "colorgrid_click doit=%d x=%d y=%d", doit, xpix, ypix );
+ if ( doit)
+ {
+ x->x_current = xpix;
+ x->y_current = ypix;
+ colorgrid_output_current(x);
+ colorgrid_draw_update(x, glist);
+ glist_grab(glist, &x->x_obj.te_g, (t_glistmotionfn)colorgrid_motion,
+ 0, xpix, ypix);
+ }
+ return (1);
+}
+
+static void colorgrid_goto(t_colorgrid *x, t_floatarg newx, t_floatarg newy)
+{
+ int xold = x->x_current;
+ int yold = x->y_current;
+
+ if ( newx > x->x_width-1 ) newx = x->x_width-1;
+ if ( newx < 0 ) newx = 0;
+ if ( newy > x->x_height-1 ) newy = x->x_height-1;
+ if ( newy < 0 ) newy = 0;
+
+ // post( "colorgrid_set x=%f y=%f", newx, newy );
+
+ x->x_current = newx + text_xpix(&x->x_obj, x->x_glist);
+ x->y_current = newy + text_ypix(&x->x_obj, x->x_glist);
+ if(xold != x->x_current || yold != x->y_current)
+ {
+ colorgrid_output_current(x);
+ colorgrid_draw_update(x, x->x_glist);
+ }
+}
+
+static void colorgrid_xgoto(t_colorgrid *x, t_floatarg newx, t_floatarg newy)
+{
+ int xold = x->x_current;
+ int yold = x->y_current;
+
+ if ( newx > x->x_width-1 ) newx = x->x_width-1;
+ if ( newx < 0 ) newx = 0;
+ if ( newy > x->x_height-1 ) newy = x->x_height-1;
+ if ( newy < 0 ) newy = 0;
+
+ // post( "colorgrid_set x=%f y=%f", newx, newy );
+
+ x->x_current = newx + text_xpix(&x->x_obj, x->x_glist);
+ x->y_current = newy + text_ypix(&x->x_obj, x->x_glist);
+ if(xold != x->x_current || yold != x->y_current)
+ {
+ colorgrid_draw_update(x, x->x_glist);
+ }
+}
+
+static void colorgrid_bang(t_colorgrid *x) {
+ colorgrid_output_current(x);
+}
+
+static t_colorgrid *colorgrid_new(t_symbol *s, int argc, t_atom *argv)
+{
+ int i, zz;
+ t_colorgrid *x;
+ t_pd *x2;
+ char *str;
+
+ // post( "colorgrid_new : create : %s argc =%d", s->s_name, argc );
+
+ x = (t_colorgrid *)pd_new(colorgrid_class);
+ // new colorgrid created from the gui
+ if ( argc != 0 )
+ {
+ if ( argc != 14 )
+ {
+ post( "colorgrid : error in the number of arguments ( %d instead of 14 )", argc );
+ return NULL;
+ }
+ if ( argv[0].a_type != A_SYMBOL || argv[1].a_type != A_FLOAT ||
+ argv[2].a_type != A_FLOAT || argv[3].a_type != A_FLOAT ||
+ argv[4].a_type != A_FLOAT || argv[5].a_type != A_FLOAT ||
+ argv[6].a_type != A_FLOAT || argv[7].a_type != A_FLOAT ||
+ argv[8].a_type != A_FLOAT || argv[9].a_type != A_FLOAT ||
+ argv[10].a_type != A_FLOAT || argv[11].a_type != A_FLOAT ||
+ argv[12].a_type != A_FLOAT || argv[13].a_type != A_FLOAT ) {
+ post( "colorgrid : wrong arguments" );
+ return NULL;
+ }
+
+ // update colorgrid count
+ if (!strncmp((str = argv[0].a_w.w_symbol->s_name), "colorgrid", 5)
+ && (zz = atoi(str + 5)) > colorgridcount)
+ {
+ colorgridcount = zz;
+ }
+ x->x_name = argv[0].a_w.w_symbol;
+ pd_bind(&x->x_obj.ob_pd, x->x_name);
+ x->x_width = argv[1].a_w.w_float;
+ x->x_min = argv[2].a_w.w_float;
+ x->x_max = argv[3].a_w.w_float;
+ x->x_height = argv[4].a_w.w_float;
+ x->y_min = argv[5].a_w.w_float;
+ x->y_max = argv[6].a_w.w_float;
+ x->x_colorgrid = argv[7].a_w.w_float;
+ x->x_xstep = argv[8].a_w.w_float;
+ x->x_ystep = argv[9].a_w.w_float;
+ x->x_xlines = argv[10].a_w.w_float;
+ x->x_ylines = argv[11].a_w.w_float;
+ x->x_current = argv[12].a_w.w_float;
+ x->y_current = argv[13].a_w.w_float;
+ x->x_point = 1;
+ }
+ else
+ {
+ char buf[40];
+
+ sprintf(buf, "colorgrid%d", ++colorgridcount);
+ s = gensym(buf);
+
+ x->x_name = s;
+ pd_bind(&x->x_obj.ob_pd, x->x_name);
+
+ x->x_width = DEFAULT_COLORGRID_WIDTH;
+ x->x_min = 0;
+ x->x_max = DEFAULT_COLORGRID_WIDTH;
+ x->x_height = DEFAULT_COLORGRID_HEIGHT;
+ x->y_min = 0;
+ x->y_max = DEFAULT_COLORGRID_HEIGHT;
+ x->x_colorgrid = 0;
+ x->x_xstep = 1.0;
+ x->x_ystep = 1.0;
+ x->x_xlines = DEFAULT_COLORGRID_NBLINES;
+ x->x_ylines = DEFAULT_COLORGRID_NBLINES;
+ x->x_current = 0;
+ x->y_current = 0;
+
+ }
+
+ // common fields for new and restored colorgrids
+ x->x_point = 0;
+ x->x_selected = 0;
+ x->x_glist = (t_glist *) canvas_getcurrent();
+ x->x_xoutlet = outlet_new(&x->x_obj, &s_float );
+ x->x_youtlet = outlet_new(&x->x_obj, &s_float );
+ x->x_zoutlet = outlet_new(&x->x_obj, &s_float );
+
+ // post( "colorgrid_new name : %s width: %d height : %d", x->x_name->s_name, x->x_width, x->x_height );
+
+ return (x);
+}
+
+static void colorgrid_free(t_colorgrid *x)
+{
+ post( "colorgrid~: freeing ressources [NULL]" );
+}
+
+void colorgrid_setup(void)
+{
+#include "colorgrid.tk2c"
+ post ( colorgrid_version );
+ colorgrid_class = class_new(gensym("colorgrid"), (t_newmethod)colorgrid_new,
+ (t_method)colorgrid_free, sizeof(t_colorgrid), 0, A_GIMME, 0);
+ class_addmethod(colorgrid_class, (t_method)colorgrid_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
+ class_addmethod(colorgrid_class, (t_method)colorgrid_motion, gensym("motion"), A_FLOAT, A_FLOAT, 0);
+ class_addmethod(colorgrid_class, (t_method)colorgrid_bang, gensym("bang"), 0);
+ class_addmethod(colorgrid_class, (t_method)colorgrid_goto, gensym("goto"), A_FLOAT, A_FLOAT, 0);
+ class_addmethod(colorgrid_class, (t_method)colorgrid_xgoto, gensym("xgoto"), A_FLOAT, A_FLOAT, 0);
+ class_addmethod(colorgrid_class, (t_method)colorgrid_dialog, gensym("dialog"), A_GIMME, 0);
+ colorgrid_widgetbehavior.w_getrectfn = colorgrid_getrect;
+ colorgrid_widgetbehavior.w_displacefn = colorgrid_displace;
+ colorgrid_widgetbehavior.w_selectfn = colorgrid_select;
+ colorgrid_widgetbehavior.w_activatefn = NULL;
+ colorgrid_widgetbehavior.w_deletefn = colorgrid_delete;
+ colorgrid_widgetbehavior.w_visfn = colorgrid_vis;
+ colorgrid_widgetbehavior.w_clickfn = colorgrid_click;
+ class_setwidget(colorgrid_class, &colorgrid_widgetbehavior);
+ class_setpropertiesfn(colorgrid_class, colorgrid_properties);
+ class_setsavefn(colorgrid_class, colorgrid_save);
+ class_sethelpsymbol(colorgrid_class, gensym("help-colorgrid.pd"));
+}
diff --git a/colorgrid/colorgrid.tk b/colorgrid/colorgrid.tk
new file mode 100755
index 0000000..b5bb173
--- /dev/null
+++ b/colorgrid/colorgrid.tk
@@ -0,0 +1,88 @@
+############ colorgrid procedures -- ydegoyon@free.fr #########
+package require Img
+
+proc colorgrid_apply {id} {
+# strip "." from the TK id to make a variable name suffix
+ set vid [string trimleft $id .]
+# for each variable, make a local variable to hold its name...
+ set var_graph_colorgrid [concat graph_colorgrid_$vid]
+ global $var_graph_colorgrid
+ set var_graph_xlines [concat graph_xlines_$vid]
+ global $var_graph_xlines
+ set var_graph_ylines [concat graph_ylines_$vid]
+ global $var_graph_ylines
+
+ set cmd [concat $id dialog \
+ [eval concat $$var_graph_xlines] \
+ [eval concat $$var_graph_ylines] \
+ [eval concat $$var_graph_colorgrid] \
+ \;]
+ #puts stderr $cmd
+ pd $cmd
+}
+
+proc colorgrid_cancel {id} {
+ set cmd [concat $id cancel \;]
+ #puts stderr $cmd
+ pd $cmd
+}
+
+proc colorgrid_ok {id} {
+ colorgrid_apply $id
+ colorgrid_cancel $id
+}
+
+proc pdtk_colorgrid_dialog {id xlines ylines colorgrid} {
+ set vid [string trimleft $id .]
+ set var_graph_colorgrid [concat graph_colorgrid_$vid]
+ global $var_graph_colorgrid
+ set var_graph_xlines [concat graph_xlines_$vid]
+ global $var_graph_xlines
+ set var_graph_ylines [concat graph_ylines_$vid]
+ global $var_graph_ylines
+
+ set $var_graph_colorgrid $colorgrid
+ set $var_graph_xlines $xlines
+ set $var_graph_ylines $ylines
+
+ toplevel $id
+ wm title $id {colorgrid}
+ wm protocol $id WM_DELETE_WINDOW [concat colorgrid_cancel $id]
+
+ label $id.label -text {COLORGRID PROPERTIES}
+ pack $id.label -side top
+
+ frame $id.buttonframe
+ pack $id.buttonframe -side bottom -fill x -pady 2m
+ button $id.buttonframe.cancel -text {Cancel}\
+ -command "colorgrid_cancel $id"
+ button $id.buttonframe.apply -text {Apply}\
+ -command "colorgrid_apply $id"
+ button $id.buttonframe.ok -text {OK}\
+ -command "colorgrid_ok $id"
+ pack $id.buttonframe.cancel -side left -expand 1
+ pack $id.buttonframe.apply -side left -expand 1
+ pack $id.buttonframe.ok -side left -expand 1
+
+ frame $id.42rangef
+ pack $id.42rangef -side top
+ label $id.42rangef.lxlines -text "X sections :"
+ entry $id.42rangef.xlines -textvariable $var_graph_xlines -width 7
+ pack $id.42rangef.lxlines $id.42rangef.xlines -side left
+
+ frame $id.72rangef
+ pack $id.72rangef -side top
+ label $id.72rangef.lylines -text "Y sections :"
+ entry $id.72rangef.ylines -textvariable $var_graph_ylines -width 7
+ pack $id.72rangef.lylines $id.72rangef.ylines -side left
+
+ checkbutton $id.showcolorgrid -text {Show Grid} -variable $var_graph_colorgrid \
+ -anchor w
+ pack $id.showcolorgrid -side top
+
+ bind $id.42rangef.xlines <KeyPress-Return> [concat colorgrid_ok $id]
+ bind $id.72rangef.ylines <KeyPress-Return> [concat colorgrid_ok $id]
+ focus $id.42rangef.xlines
+}
+
+############ colorgrid procedures END -- lluis@artefacte.org #########
diff --git a/colorgrid/colorgrid.tk2c b/colorgrid/colorgrid.tk2c
new file mode 100755
index 0000000..6e6abec
--- /dev/null
+++ b/colorgrid/colorgrid.tk2c
@@ -0,0 +1,66 @@
+// ########### colorgrid procedures -- ydegoyon@free.fr #########
+sys_gui("package require Img\n");
+sys_gui("proc colorgrid_apply {id} {\n");
+// strip "." from the TK id to make a variable name suffix
+sys_gui("set vid [string trimleft $id .]\n");
+// for each variable, make a local variable to hold its name...
+sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n");
+sys_gui("global $var_graph_colorgrid\n");
+sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n");
+sys_gui("global $var_graph_xlines\n");
+sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n");
+sys_gui("global $var_graph_ylines\n");
+sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_xlines] [eval concat $$var_graph_ylines] [eval concat $$var_graph_colorgrid] \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc colorgrid_cancel {id} {\n");
+sys_gui("set cmd [concat $id cancel \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc colorgrid_ok {id} {\n");
+sys_gui("colorgrid_apply $id\n");
+sys_gui("colorgrid_cancel $id\n");
+sys_gui("}\n");
+sys_gui("proc pdtk_colorgrid_dialog {id xlines ylines colorgrid} {\n");
+sys_gui("set vid [string trimleft $id .]\n");
+sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n");
+sys_gui("global $var_graph_colorgrid\n");
+sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n");
+sys_gui("global $var_graph_xlines\n");
+sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n");
+sys_gui("global $var_graph_ylines\n");
+sys_gui("set $var_graph_colorgrid $colorgrid\n");
+sys_gui("set $var_graph_xlines $xlines\n");
+sys_gui("set $var_graph_ylines $ylines\n");
+sys_gui("toplevel $id\n");
+sys_gui("wm title $id {colorgrid}\n");
+sys_gui("wm protocol $id WM_DELETE_WINDOW [concat colorgrid_cancel $id]\n");
+sys_gui("label $id.label -text {COLORGRID PROPERTIES}\n");
+sys_gui("pack $id.label -side top\n");
+sys_gui("frame $id.buttonframe\n");
+sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n");
+sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"colorgrid_cancel $id\"\n");
+sys_gui("button $id.buttonframe.apply -text {Apply} -command \"colorgrid_apply $id\"\n");
+sys_gui("button $id.buttonframe.ok -text {OK} -command \"colorgrid_ok $id\"\n");
+sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.apply -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.ok -side left -expand 1\n");
+sys_gui("frame $id.42rangef\n");
+sys_gui("pack $id.42rangef -side top\n");
+sys_gui("label $id.42rangef.lxlines -text \"X sections :\"\n");
+sys_gui("entry $id.42rangef.xlines -textvariable $var_graph_xlines -width 7\n");
+sys_gui("pack $id.42rangef.lxlines $id.42rangef.xlines -side left\n");
+sys_gui("frame $id.72rangef\n");
+sys_gui("pack $id.72rangef -side top\n");
+sys_gui("label $id.72rangef.lylines -text \"Y sections :\"\n");
+sys_gui("entry $id.72rangef.ylines -textvariable $var_graph_ylines -width 7\n");
+sys_gui("pack $id.72rangef.lylines $id.72rangef.ylines -side left\n");
+sys_gui("checkbutton $id.showcolorgrid -text {Show Grid} -variable $var_graph_colorgrid -anchor w\n");
+sys_gui("pack $id.showcolorgrid -side top\n");
+sys_gui("bind $id.42rangef.xlines <KeyPress-Return> [concat colorgrid_ok $id]\n");
+sys_gui("bind $id.72rangef.ylines <KeyPress-Return> [concat colorgrid_ok $id]\n");
+sys_gui("focus $id.42rangef.xlines\n");
+sys_gui("}\n");
+// ########### colorgrid procedures END -- lluis@artefacte.org #########
diff --git a/colorgrid/g_colorgrid.h b/colorgrid/g_colorgrid.h
new file mode 100755
index 0000000..27694ef
--- /dev/null
+++ b/colorgrid/g_colorgrid.h
@@ -0,0 +1,39 @@
+/* Copyright (c) 2002 Yves Degoyon
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* a header for colorgrid which enables to control
+* 2 parameters with the mouse cursor
+*/
+
+#ifndef __G_COLORGRID_H
+#define __G_COLORGRID_H
+
+typedef struct _colorgrid
+{
+ t_object x_obj;
+ t_glist *x_glist;
+ t_symbol *x_name;
+ t_outlet *x_xoutlet;
+ t_outlet *x_youtlet;
+ t_outlet *x_zoutlet;
+ int x_null; /* To dissable resize */
+ int x_height; /* height of the colorgrid */
+ t_float x_min; /* minimum value of x */
+ t_float x_max; /* max value of x */
+ int x_width; /* width of the colorgrid */
+ t_float y_min; /* minimum value of y */
+ t_float y_max; /* max value of y */
+ t_float x_current; /* x coordinate of current position */
+ t_float y_current; /* y coordinate of current position */
+ int x_selected; /* stores selected state */
+ int x_point; /* indicates if a point is plotted */
+ int x_colorgrid; /* indicates if a colorgrid is requested */
+ t_float x_xstep; /* sets the step ( grain ) for x */
+ t_float x_ystep; /* sets the step ( grain ) for y */
+ int x_xlines; /* number of vertical lines */
+ int x_ylines; /* number of horizontal lines */
+ t_symbol* x_fname;
+} t_colorgrid;
+
+#endif
diff --git a/colorgrid/help-colorgrid.pd b/colorgrid/help-colorgrid.pd
new file mode 100755
index 0000000..77af92b
--- /dev/null
+++ b/colorgrid/help-colorgrid.pd
@@ -0,0 +1,47 @@
+#N canvas 26 1 762 514 10;
+#X floatatom 93 434 5 0 0 0 - - -;
+#X floatatom 217 434 5 0 0 0 - - -;
+#X floatatom 430 220 5 0 0 0 - - -;
+#X floatatom 496 220 5 0 0 0 - - -;
+#X obj 430 245 pack f f;
+#X text 471 221 X;
+#X text 537 220 Y;
+#X msg 93 131 bang;
+#X floatatom 342 431 5 0 0 0 - - -;
+#X text 93 451 R;
+#X text 217 450 G;
+#X text 342 445 B;
+#X text 39 12 Grid is a 2-dimensional color picker;
+#X text 39 25 Written by Lluis Gomez i Bigorda ( lluis@artefacte.org
+);
+#X text 39 39 ( inspired by the grid object written by Yves Degoyon
+);
+#X msg 339 246 xgoto \$1 \$2;
+#X text 330 195 Set position without changing output:;
+#X obj 496 246 t b f;
+#X floatatom 430 133 5 0 0 0 - - -;
+#X floatatom 496 133 5 0 0 0 - - -;
+#X obj 430 158 pack f f;
+#X text 471 134 X;
+#X text 537 133 Y;
+#X obj 496 159 t b f;
+#X text 330 108 Set position :;
+#X msg 339 159 goto \$1 \$2;
+#X obj 90 376 colorgrid colorgrid1 256 0 256 50 0 50 0 1 1 10 10 147
+392.06;
+#X connect 2 0 4 0;
+#X connect 3 0 17 0;
+#X connect 4 0 15 0;
+#X connect 7 0 26 0;
+#X connect 15 0 26 0;
+#X connect 17 0 4 0;
+#X connect 17 1 4 1;
+#X connect 18 0 20 0;
+#X connect 19 0 23 0;
+#X connect 20 0 25 0;
+#X connect 23 0 20 0;
+#X connect 23 1 20 1;
+#X connect 25 0 26 0;
+#X connect 26 0 0 0;
+#X connect 26 1 1 0;
+#X connect 26 2 8 0;
diff --git a/colorgrid/tk2c.bash b/colorgrid/tk2c.bash
new file mode 100755
index 0000000..9dfeb03
--- /dev/null
+++ b/colorgrid/tk2c.bash
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+#set -x
+
+while read line
+do
+ for word in $line
+ do
+ if [ "X"$word != "X"${word#\#} ]
+ then
+ echo // ${line#\#}
+ break
+ else
+ line=${line//\'/\\\'}
+#useless, slashes never gets in
+ line=${line//\\/\\\\}
+#this one's dirty, i know
+ line=${line//;/\\\\;}
+ line=${line//\"/\\\"}
+ echo 'sys_gui("'$line'\n");'
+ break
+ fi
+ done
+done
diff --git a/imagegrid/INSTALL_imagegrid b/imagegrid/INSTALL_imagegrid
new file mode 100755
index 0000000..cf0b94d
--- /dev/null
+++ b/imagegrid/INSTALL_imagegrid
@@ -0,0 +1,48 @@
+
+IMAGEGRID INSTALL
+
+[ENG]
+
+In order to compile this source code it must have the library ImageMagick and the source code of Puredata.
+
+tar xzvf imagegrid[-version].tar.gz in folder pd/extra/ or edit file Makefile modifying the value of variable PD_SRC with the correct path location of the pd/src/. If you don't have it, download and copy the src/ folder into pd/ folder.
+
+$ cd imagegrid[-version]
+
+# make clean
+
+# make
+
+# make install
+
+now you can open example: help-imagegrid.pd
+
+$ pd help-imagegrid
+
+Thanks.
+
+Sergi Lario
+slario(at)gmail.com
+
+[CAT]
+
+Per compilar el codi font cal disposar de la biblioteca ImageMagick i el codi font de Puredata.
+
+tar xzvf imagegrid[-versio].tar.gz en el directori pd/extra/ o bé edita el fitxer Makefile modificant el valor de la variable PD_SRC amb el path correcte del codi font de pd/src/. Sinó el tens el pots descarregar i copiar la carpeta src/ dins el directori pd/
+
+$ cd imagegrid[-versio]
+
+# make clean
+
+# make
+
+# make install
+
+ara ja pots obrir l'exemple help-imagegrid.pd
+
+$ pd help-imagegrid
+
+Gràcies.
+
+Sergi Lario
+slario(at)gmail.com
diff --git a/imagegrid/LICENSE b/imagegrid/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/imagegrid/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. 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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. 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.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ 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.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ 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
+state 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) <year> <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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU 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 Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/imagegrid/Makefile b/imagegrid/Makefile
new file mode 100755
index 0000000..ccfe750
--- /dev/null
+++ b/imagegrid/Makefile
@@ -0,0 +1,38 @@
+PD_SRC=../../src
+
+NAME=imagegrid
+CSYM=imagegrid
+
+current: pd_linux
+
+# ----------------------- LINUX -----------------------
+
+pd_linux: $(NAME).pd_linux
+
+.SUFFIXES: .pd_linux
+
+LINUXCFLAGS = -fPIC -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wno-shadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch
+
+
+LINUXINCLUDE = -I$(PD_SRC) -I/usr/include/
+
+.c.pd_linux:
+ cc -fPIC -c -ansi -O -Wall -Wmissing-prototypes cua.c
+ cc -fPIC -c -ansi -O -Wall -Wmissing-prototypes magickconverter.c
+# ./tk2c.bash < $*.tk > $*.tk2c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o cua.o magickconverter.o -lc -lm -lMagick `Wand-config --ldflags --libs`
+ strip --strip-unneeded $*.pd_linux
+ rm -f $*.o ../$*.pd_linux
+ ln -s $*/$*.pd_linux ..
+
+# ----------------------------------------------------------
+
+install:
+ cp help-*.pd ../../doc/5.reference
+
+clean:
+ rm -f *.o *.pd_* so_locations
+
diff --git a/imagegrid/cat-help-imagegrid.pd b/imagegrid/cat-help-imagegrid.pd
new file mode 100755
index 0000000..2d32bb4
--- /dev/null
+++ b/imagegrid/cat-help-imagegrid.pd
@@ -0,0 +1,20 @@
+#N canvas 258 588 984 601 10;
+#X text 24 13 IMAGEGRID;
+#X text 24 93 LLISTA STDOUT;
+#X text 154 63 AFEGIR IMATGE;
+#X text 154 113 AFEGIR IMATGES D'UN DIRECTORI;
+#X symbolatom 72 324 60 0 0 0 - - -;
+#X text 74 344 PATH DE LA IMATGE CLICADA;
+#X obj 26 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X text 25 29 Objecte per seleccionar amb un sol clic la ubicacio d'una
+imatge afegida al tauler.;
+#X obj 72 183 imagegrid imagegrid2 3 5 #F0F0F0 #0F0F0F /usr/local/lib/pd/extra/imagegrid/images/logo100.gif|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.ppm|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.gif|/usr/local/lib/pd/extra/imagegrid/images/3160x120.gif|/usr/local/lib/pd/extra/imagegrid/images/logo100.gif|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.ppm|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.gif|/usr/local/lib/pd/extra/imagegrid/images/3160x120.gif|/usr/local/lib/pd/extra/imagegrid/images/logo100.gif|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.ppm|/usr/local/lib/pd/extra/imagegrid/images/3160x120.gif|/usr/local/lib/pd/extra/imagegrid/images/logo100.gif|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.ppm|/usr/local/lib/pd/extra/imagegrid/images/sll80x60.gif|/usr/local/lib/pd/extra/imagegrid/images/3160x120.gif|
+;
+#X msg 156 77 putimg /usr/local/lib/pd/extra/imagegrid/images/logo100.gif
+;
+#X msg 156 127 putimgdir /usr/local/lib/pd/extra/imagegrid/images;
+#X connect 6 0 8 0;
+#X connect 8 0 4 0;
+#X connect 9 0 8 0;
+#X connect 10 0 8 0;
diff --git a/imagegrid/cua.c b/imagegrid/cua.c
new file mode 100644
index 0000000..d37b0e2
--- /dev/null
+++ b/imagegrid/cua.c
@@ -0,0 +1,164 @@
+/*
+cue for imagegrid external
+Copyright (C) 2007 Sergi Lario
+
+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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "cua.h"
+
+/*
+- compilació:
+ $ gcc -c -ansi -O -Wall -Wmissing-prototypes cua.c
+- muntatge:
+ $ gcc cua.o -o cua
+- execució:
+ $ ./cua
+*/
+/* programa principal de prova */
+/*
+int main()
+{
+
+ int opc=8;
+ char path[BYTESNOMFITXER];
+ int ok;
+ Cua cua;
+ crearCua(&cua);
+
+ while(opc!=5)
+ {
+ printf("\t\t\tMENU PRINCIPAL\n\n\n");
+ printf("\t 1. Encuar\n");
+ printf("\t 2. Desencuar\n");
+ printf("\t 3. Nombre de nodes\n");
+ printf("\t 4. Contingut de la cua\n");
+ printf("\t 5. Sortir\n");
+
+ scanf("%d", &opc);
+
+ switch(opc)
+ {
+ case 1:
+ printf("path a introduir:\n");
+ scanf("%s", path);
+ encuar(&cua, path);
+ break;
+
+ case 2:
+ ok = desencuar(&cua);
+ if(ok) printf("node eliminat de la cua\n");
+ break;
+
+ case 3:
+ printf("nombre de nodes de la cua %d\n", numNodes(&cua));
+ break;
+ case 4:
+ escriuCua(&cua);
+ break;
+ case 5:
+ eliminarCua(&cua);
+ break;
+ }
+ }
+ getchar();
+ return 0;
+}
+*/
+/* implementació de les funcions */
+void crearCua(Cua *cua)
+{
+ cua->davanter=cua->final=NULL;
+}
+
+/* funció que encua el node al final de la cua */
+void encuar (Cua *cua, path x)
+{
+ Node *nou;
+ nou=(Node*)malloc(sizeof(Node));
+ strcpy(nou->pathFitxer,x);
+ nou->seguent=NULL;
+ if(cuaBuida(cua))
+ {
+ cua->davanter=nou;
+ }
+ else
+ cua->final->seguent=nou;
+ cua->final=nou;
+}
+
+/* elimina l'element del principi de la cua */
+int desencuar (Cua *cua)
+{
+ if(!cuaBuida(cua))
+ {
+ Node *nou;
+ nou=cua->davanter;
+ cua->davanter=cua->davanter->seguent;
+ free(nou);
+ return 1;
+ }
+ else
+ {
+ /* printf("Cua buida\a\n"); */
+ return 0;
+ }
+
+}
+
+/* funció que retorna si la cua és buida */
+int cuaBuida(Cua *cua)
+{
+ return (cua->davanter==NULL);
+}
+
+/* elimina el contingut de la cua */
+void eliminarCua(Cua *cua)
+{
+ while (!cuaBuida(cua)) desencuar(cua);
+ printf("Cua eliminada\a\n");
+}
+
+/* funció que retorna el nombre de nodes de la cua */
+int numNodes(Cua *cua)
+{
+ int contador=0;
+ Node *actual;
+ actual=cua->davanter;
+ if(actual) contador=1;
+ while((actual)&&(actual != cua->final)){
+ contador ++;
+ actual = actual->seguent;
+ }
+ return (contador);
+}
+
+/* funció que escriu la cua de nodes per la sortida estàndard */
+void escriuCua(Cua *cua)
+{
+ if(!cuaBuida(cua))
+ {
+ Node *actual;
+ actual=cua->davanter;
+ printf("CUA DE NODES\n[");
+ do{
+ printf("#%s#",actual->pathFitxer);
+ actual = actual->seguent;
+ }while(actual);
+ printf("]\n");
+
+ }
+ else
+ printf("Cua buida\a\n");
+}
diff --git a/imagegrid/cua.h b/imagegrid/cua.h
new file mode 100644
index 0000000..4144770
--- /dev/null
+++ b/imagegrid/cua.h
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* nombre de caracters per el nom del path del fitxer */
+#define BYTESNOMFITXER 512
+
+typedef char path[BYTESNOMFITXER];
+
+/* estructures i tipus de dades de la cua */
+
+/* estructura de dades: un node de la cua */
+struct node
+{
+ /* nom del path de la imatge */
+ path pathFitxer;
+ /* apuntador al següent node en cua */
+ struct node *seguent;
+};
+
+/* definició del tipus node */
+typedef struct node Node;
+
+/* definició del tipus de cua */
+typedef struct
+{
+ Node *davanter;
+ Node *final;
+}Cua;
+
+
+/* declaracions de les funcions */
+
+/* crea una cua */
+void crearCua(Cua *cua);
+/* encuara un element al final de la cua */
+void encuar (Cua *cua, path x);
+/* elimina un element de la cua */
+int desencuar (Cua *cua);
+/* retorna si la cua és buida */
+int cuaBuida(Cua *cua);
+/* elimina el contingut de la cua */
+void eliminarCua(Cua *cua);
+/* retorna el nombre de nodes de la cua */
+int numNodes(Cua *cua);
+/* escriu el contingut de la cua */
+void escriuCua(Cua *cua);
diff --git a/imagegrid/help-imagegrid.pd b/imagegrid/help-imagegrid.pd
new file mode 100755
index 0000000..7d39a8b
--- /dev/null
+++ b/imagegrid/help-imagegrid.pd
@@ -0,0 +1,19 @@
+#N canvas 296 99 580 404 10;
+#X text 24 13 IMAGEGRID;
+#X symbolatom 72 324 60 0 0 0 - - -;
+#X obj 26 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X obj 72 183 imagegrid imagegrid1 3 5 #F0F0F0 #0F0F0F ;
+#X text 154 113 ADD IMAGES FROM FOLDER;
+#X text 154 63 ADD A IMAGE;
+#X text 24 93 LIST STDOUT;
+#X text 74 344 LOCATION OF THE SELECTED IMAGE;
+#X text 25 29 Object to select the path location of an image added
+in the grid.;
+#X msg 155 127 putimgdir /usr/local/lib/pd/extra/imagegrid/images;
+#X msg 156 77 putimg /usr/local/lib/pd/extra/imagegrid/images/logo100.gif
+;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 9 0 3 0;
+#X connect 10 0 3 0;
diff --git a/imagegrid/imagegrid.c b/imagegrid/imagegrid.c
new file mode 100644
index 0000000..8d1c213
--- /dev/null
+++ b/imagegrid/imagegrid.c
@@ -0,0 +1,823 @@
+/*
+imagegrid external for Puredata
+Copyright (C) 2007 Sergi Lario
+sll :: slario-at-gmail.com
+
+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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+#include <dirent.h>
+#include <string.h>
+#include <unistd.h>
+#include <math.h>
+
+/* incloure les definicions de variables i
+ prototipus de dades i de funcions de puredata */
+#include "m_pd.h"
+/* incloure estructures de dades i capceleres de funcions gàfiques bàsiques de pd */
+#include "g_canvas.h"
+/* incloure estructures de dades i capceleres de funcions per a gestionar una cua */
+#include "cua.h"
+/* incloure estructures de dades i capceleres de funcions per convertir imatges a diferents formats */
+#include "magickconverter.h"
+/* incloure estructures de dades i capceleres de funcions per traballar amb threads */
+#include "pthread.h"
+
+/* &&&&&&&&&&&&&&&&&&&&&&&&&&&&& IMAGEGRID &&&&&&&&&&&&&&&&&&&&&&&&&&&&& */
+
+/* definició de l'amplada i l'alçada d'una casella */
+#define W_CELL 60
+#define H_CELL 40
+
+/* crear un apuntador al nou objecte */
+static t_class *imagegrid_class;
+/* indica el nombre de imagegrid creats - utilitzat per diferenciar el nom d'instàncies d'objectes del mateix tipus */
+static int imagegridcount = 0;
+
+/* definició de la classe i la seva estructura de dades */
+
+typedef struct _imagegrid {
+ t_object x_obj;
+ /* declaració de la sortida de l'objecte */
+ t_outlet *x_sortida;
+ /* llista d'objectes gràfics */
+ t_glist *x_glist;
+ /* nombre de files */
+ int x_num_fil;
+ /* nombre de columnes */
+ int x_num_col;
+ /* posició de la última imatge en el tauler */
+ int x_ultima_img;
+ /* path del directori actual */
+ path x_dir_actual;
+ /* path del directori a canviar */
+ path x_dir_canvi;
+ /* posicio ultim al directori actual */
+ int x_dir_pos;
+ /* apuntador al primer element posicionat al tauler */
+ Node *x_tauler_primer;
+ /* cua d'imatges */
+ Cua x_cua;
+ /* nom de l'objecte */
+ t_symbol *x_name;
+ /* color de fons */
+ t_symbol *x_color_fons;
+ /* color del marge */
+ t_symbol *x_color_marc;
+ /* mutex per evitar concurrencia sobre la cua al accedir diferents threads*/
+ pthread_mutex_t x_lock;
+
+} t_imagegrid;
+
+
+/* calcula la posició x del tauler a partir de la posició de l'element de la cua (d'esquerra a dreta) */
+int getX(t_imagegrid* x, int posCua){
+ int c = x->x_num_col;
+ int xpos = (posCua % c) * W_CELL;
+ return(xpos + 1);
+}
+
+/* calcula la posició y del tauler a partir de la posició de l'element de la cua (de dalt a baix) */
+int getY(t_imagegrid* x, int posCua){
+ int c = x->x_num_col;
+ int ypos = (posCua / c) * H_CELL;
+ return(ypos + 1);
+}
+
+/* elimina les imatges temporals */
+void eliminar_imatges_temporals(int maxim){
+ FILE *fitxer;
+ path path_total;
+ int contador = 0;
+ char contador_str[BYTES_NUM_TEMP];
+ while(contador < maxim){
+ strcpy(path_total,PATH_TEMPORAL);
+ sprintf(contador_str,"%d", contador);
+ strcat(path_total,contador_str);
+ strcat(path_total,".");
+ strcat(path_total,FORMAT_MINIATURA);
+ /* elimina el fitxer si no hi ha cap problema */
+ if(unlink(path_total)){
+ /* post("Imatge temporal %s eliminada\n",path_total); */
+ }
+ contador++;
+ }
+ post("Imagegrid: Imatges temporals eliminades\n",path_total);
+}
+
+int format_adequat(path nomF){
+ int retorn = 0;
+ path ig_path = "";
+ strcat(ig_path,nomF);
+ char *t1;
+ path extensio = "";
+ for ( t1 = strtok(ig_path,".");
+ t1 != NULL;
+ t1 = strtok(NULL,".") )
+ strcpy(extensio,t1);
+ if(strcmp(extensio,"bmp")==0) retorn = 1;
+ if(strcmp(extensio,"eps")==0) retorn = 1;
+ if(strcmp(extensio,"gif")==0) retorn = 1;
+ if(strcmp(extensio,"jpg")==0) retorn = 1;
+ if(strcmp(extensio,"jpeg")==0) retorn = 1;
+ if(strcmp(extensio,"png")==0) retorn = 1;
+ if(strcmp(extensio,"ppm")==0) retorn = 1;
+ if(strcmp(extensio,"tif")==0) retorn = 1;
+ if(strcmp(extensio,"tiff")==0) retorn = 1;
+
+ return (retorn);
+}
+
+/* afegir una imatge al grid */
+void imagegrid_afegir_imatge(t_imagegrid *x, path entrada)
+{
+ int maxim;
+ char nNstr[BYTES_NUM_TEMP];
+ int pos = 0;
+ /* escriu l'argument entrat */
+ if (format_adequat(entrada) == 1){
+ /* post("Afegint la imatge %s ...",entrada); */
+ maxim = x->x_num_fil * x->x_num_col;
+ path ig_path = PATH_TEMPORAL;
+
+ /* si hi ha tants nodes a la cua com el maxim */
+ if((numNodes(&x->x_cua)) >= maxim){
+ /* desencua */
+ int extret;
+ extret = desencuar(&x->x_cua);
+ /* obtenir la posició en la cua del nou node */
+ if(x->x_ultima_img == maxim-1) {
+ pos = 0;
+ }else{
+ pos = x->x_ultima_img+1;
+ }
+ sys_vgui(".x%x.c delete %xS%d\n", glist_getcanvas(x->x_glist), x, pos);
+ }
+ /* encua el nou node */
+ encuar(&x->x_cua, entrada);
+ /* si no és el primer element a encuar incrementem la posicio de la última imatge insertada */
+ if(numNodes(&x->x_cua) != 1) x->x_ultima_img ++;
+ /* si assoleix el maxim torna a començar, inicialitzant la posició en el tauler de la última imatge insertada */
+ if(x->x_ultima_img == maxim) x->x_ultima_img = 0;
+
+ /*
+ ImageMagick per les conversions
+ */
+ int nN = x->x_ultima_img;
+ convertir(entrada,FORMAT_MINIATURA, W_CELL, H_CELL, nN);
+ sprintf(nNstr, "%d", nN);
+ strcat(ig_path,nNstr);
+ strcat(ig_path,".");
+ strcat(ig_path,FORMAT_MINIATURA);
+ /*printf("Creacio de la imatge %s ...",ig_path);*/
+ sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path);
+ /* printf("1. Creacio de la imatge %s ...",ig_path); */
+ sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n",
+ glist_getcanvas(x->x_glist),
+ text_xpix(&x->x_obj, x->x_glist) + getX(x,nN) + (W_CELL/2),
+ text_ypix(&x->x_obj, x->x_glist) + getY(x,nN) + (H_CELL/2),
+ x,nN,x,nN);
+ /* printf("2. Creacio de la imatge %s ...",ig_path); */
+ if(nN == 0){
+ x->x_tauler_primer = x->x_cua.final;
+ /* post("Ara el primer del tauler es %s\n",x->x_tauler_primer->pathFitxer); */
+ }
+ /* printf("SURT de la creacio de la imatge %s ...",ig_path); */
+ }else{
+ post("Imagegrid: El format del fitxer %s és incompatible.",entrada);
+ }
+ /*
+ sys_vgui("image create photo img%x -file %s\n",x,entrada);
+ sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n",
+ glist_getcanvas(glist),text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x,x);
+ */
+}
+
+/* dibuixa imagegrid */
+void imagegrid_drawme(t_imagegrid *x, t_glist *glist, int firsttime)
+{
+ /* post("Entra a drawme amb firsttime: %d", firsttime); */
+ if (firsttime) {
+ char name[MAXPDSTRING];
+ canvas_makefilename(glist_getcanvas(x->x_glist), x->x_name->s_name, name, MAXPDSTRING);
+ sys_vgui(".x%x.c create rectangle %d %d %d %d -fill %s -tags %xGRID -outline %s\n",
+ glist_getcanvas(glist),
+ text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
+ text_xpix(&x->x_obj, glist) + (x->x_num_col * W_CELL) + 1, text_ypix(&x->x_obj, glist) + (x->x_num_fil * H_CELL) + 1,
+ x->x_color_fons->s_name, x,x->x_color_marc->s_name);
+
+ canvas_fixlinesfor(glist_getcanvas(glist), (t_text*)x);
+ /* si hi elements a la cua els afegeix (redimensió) */
+ if(!cuaBuida(&x->x_cua))
+ {
+ path ig_path;
+ int nN = 0;
+ char nNstr[BYTES_NUM_TEMP];
+ Node *actual;
+ actual=x->x_cua.davanter;
+ do{
+ strcpy(ig_path,PATH_TEMPORAL);
+ sprintf(nNstr, "%d", nN);
+ strcat(ig_path,nNstr);
+ strcat(ig_path,".");
+ strcat(ig_path,FORMAT_MINIATURA);
+ /* post("reestablint la imatge %s", actual->pathFitxer); */
+ // imagegrid_afegir_imatge(x,actual->pathFitxer);
+ convertir(actual->pathFitxer,FORMAT_MINIATURA, W_CELL, H_CELL, nN);
+ sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path);
+ sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n",
+ glist_getcanvas(x->x_glist),text_xpix(&x->x_obj, x->x_glist) + getX(x,nN) + (W_CELL/2), text_ypix(&x->x_obj, x->x_glist) + getY(x,nN) + (H_CELL/2),x,nN,x,nN);
+ actual = actual->seguent;
+ nN++;
+ }while(actual);
+ }
+ }
+ else {
+ sys_vgui(".x%x.c coords %xGRID %d %d %d %d\n", glist_getcanvas(glist), x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),text_xpix(&x->x_obj, glist) + (x->x_num_col*W_CELL) + 1, text_ypix(&x->x_obj, glist) + (x->x_num_fil*H_CELL) + 1);
+ if(!cuaBuida(&x->x_cua))
+ {
+ int contador = 0;
+ while(contador < numNodes(&x->x_cua)){
+ sys_vgui(".x%x.c coords %xS%d \
+ %d %d\n",
+ glist_getcanvas(glist), x, contador,
+ text_xpix(&x->x_obj, x->x_glist) + getX(x,contador) + (W_CELL/2), text_ypix(&x->x_obj, x->x_glist) + getY(x,contador) + (H_CELL/2));
+ contador++;
+ }
+
+ /* char buf[800];
+ sprintf(buf, "pdtk_imagegrid_table %%s %s %d %d\n", x->x_name->s_name, x->x_num_fil, x->x_num_col);
+ gfxstub_new(&x->x_obj.ob_pd, x, buf); */
+ }
+ }
+}
+
+/* borra imagegrid */
+void imagegrid_erase(t_imagegrid* x,t_glist* glist)
+{
+ int maxim = x->x_num_fil * x->x_num_col;
+ path path_total;
+ char contador_str[2];
+ /* post("Entra a erase"); */
+ /* elimina les imatges */
+ int contador = 0;
+ while(contador < numNodes(&x->x_cua)){
+ sys_vgui(".x%x.c delete %xS%d\n", glist_getcanvas(x->x_glist), x, contador);
+ strcpy(path_total,PATH_TEMPORAL);
+ sprintf(contador_str,"%d", contador);
+ strcat(path_total,contador_str);
+ strcat(path_total,".");
+ strcat(path_total,FORMAT_MINIATURA);
+ if(unlink(path_total)){
+ /* post("Imatge temporal %s eliminada\n",path_total); */
+ }
+ contador++;
+ }
+
+ /* elimina el grid */
+ sys_vgui(".x%x.c delete %xGRID\n", glist_getcanvas(glist), x);
+ eliminar_imatges_temporals(maxim);
+}
+
+/* mètode de la clase que escriu un missatge al rebre un bang */
+void imagegrid_bang(t_imagegrid *x)
+{
+ /* post("Hello imagegrid !!"); */
+ escriuCua(&x->x_cua);
+}
+
+/* mètode de la classe que es dispara al rebre una entrada de missatge amb [putimg +string( com a paràmetre */
+void imagegrid_putimg(t_imagegrid *x, t_symbol *entrada)
+{
+ /* comprova que existeixi el fitxer */
+ FILE *fitxer;
+ path e;
+ strcpy(e,entrada->s_name);
+ /* post("putimg de %s\n", e); */
+
+ fitxer = fopen(e,"r");
+ if (!fitxer) {
+ post("Imagegrid: Problema amb l'obertura del fitxer %s\n",e);
+ }
+ else {
+ /* post("s'encua la imatge %s\n", e); */
+ imagegrid_afegir_imatge(x,e);
+ /*outlet_symbol(x->x_sortida, entrada);*/
+ }
+ /* post("putimg amb img = %s\n", e); */
+}
+
+/* mètode de la classe que es dispara al rebre una entrada de missatge amb [putimgdir +string( com a paràmetre */
+void *imagegrid_putimgdir_thread(t_imagegrid *x)
+{
+ DIR *dirp;
+ struct dirent * direntp;
+ path nomImatge, directoriAnterior, pathActual;
+ int numEncuats = 0, numPosDir = 0;
+ int maxim;
+ if ((dirp = opendir(x->x_dir_canvi)) == NULL)
+ {
+ post("Imagegrid: No es pot obrir el directori %s\n", x->x_dir_canvi);
+ }else{
+ maxim = x->x_num_fil * x->x_num_col;
+ strcpy(directoriAnterior, x->x_dir_actual);
+ strcpy(x->x_dir_actual, x->x_dir_canvi);
+ /* si es el mateix directori entrat l'ultim busca la ultima imatge afegida per a seguir a encuant a partir d'ella en endavant */
+ if(strcmp(directoriAnterior, x->x_dir_actual) == 0){
+ post("Imagegrid: Repeteix directori %s\n", x->x_dir_actual);
+ while ( (direntp = readdir( dirp )) != NULL ){
+ /* es descarta el mateix directori, el directori anterior i tot el que no sigui un fitxer regular */
+ if((strcmp(direntp->d_name,"..") != 0)&&(strcmp(direntp->d_name,".") != 0)&&(direntp->d_type == DT_REG)){
+ /* incrementa la posició en el directori */
+ numPosDir++;
+ /* assolir la posició anterior en el directori */
+ if(numPosDir > x->x_dir_pos){
+ /* si el nombre de nodes encuats per aquest directori no supera el màxim encua el nou node */
+ if(numEncuats < maxim){
+ /* post("s'encua la imatge %s\n", direntp->d_name); */
+ /* concatena el path i el nom de la imatge */
+ strcpy(nomImatge,direntp->d_name);
+ strcpy(pathActual,x->x_dir_actual);
+ strcat(pathActual,"/");
+ strcat(pathActual,nomImatge);
+ pthread_mutex_lock(&x->x_lock);
+ imagegrid_afegir_imatge(x, pathActual);
+ pthread_mutex_unlock(&x->x_lock);
+ /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */
+ numEncuats++;
+ /* es desa la posició en el directori de l'últim node encuat */
+ x->x_dir_pos = numPosDir;
+ }
+ }
+ }
+ }
+ }else{
+ /* directori diferent omple la cua començant pel primer fitxer */
+ post("Imagegrid: Nou directori %s \n", x->x_dir_actual);
+ while ( (direntp = readdir( dirp )) != NULL ){
+ /* es descarta el mateix directori, el directori anterior i tot el que no sigui un fitxer regular */
+ if((strcmp(direntp->d_name,"..") != 0)&&(strcmp(direntp->d_name,".") != 0)&&(direntp->d_type == DT_REG)){
+ /* incrementa la posició en el directori */
+ numPosDir++;
+ /* si el nombre de nodes encuats per aquest directori no supera el màxim enca el nou node */
+ if(numEncuats < maxim){
+ /* post("s'encua la imatge %s\n", direntp->d_name); */
+ /* concatena el path i el nom de la imatge */
+ strcpy(nomImatge,direntp->d_name);
+ strcpy(pathActual,x->x_dir_actual);
+ strcat(pathActual,"/");
+ strcat(pathActual,nomImatge);
+ pthread_mutex_lock(&x->x_lock);
+ imagegrid_afegir_imatge(x, pathActual);
+ pthread_mutex_unlock(&x->x_lock);
+ /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */
+ numEncuats++;
+ /* es desa la posició en el directori de l'últim node encuat */
+ x->x_dir_pos = numPosDir;
+ }
+ }
+ }
+ }
+ /* si la posicio de l'actual es la de l'utim fitxer del directori, inicialitza la posició */
+ if(x->x_dir_pos >= numPosDir) x->x_dir_pos = 0;
+ closedir(dirp);
+ }
+ /* escriu l'argument entrat */
+ /* post("Obtenint imatges del directori: %s ...",x->x_dir_canvi); */
+ /* envia a la sorida l'argument entrat */
+ /* outlet_symbol(x->x_sortida, entrada); */
+ pthread_exit(NULL);
+}
+
+void imagegrid_putimgdir(t_imagegrid *x, t_symbol *entrada)
+{
+
+ pthread_t unthread;
+ pthread_attr_t unatribut;
+ pthread_attr_init( &unatribut );
+
+ strcpy(x->x_dir_canvi,entrada->s_name);
+
+ // ---------------- THREAD CREAT -------------------------
+ pthread_mutex_init(&x->x_lock, NULL);
+ pthread_create(&unthread,&unatribut,(void *)imagegrid_putimgdir_thread, x);
+ pthread_mutex_destroy(&x->x_lock);
+}
+
+static int imagegrid_click(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
+{
+ t_imagegrid* x = (t_imagegrid *)z;
+ int x_pos = xpix - text_xpix(&x->x_obj, x->x_glist);
+ int y_pos = ypix - text_ypix(&x->x_obj, x->x_glist);
+ int xa, ya, postauler, contador, maxim;
+ path pathSortida;
+ Node *actual;
+ if (doit)
+ {
+ /* obtenir la posicio en el tauler */
+ xa = x_pos / W_CELL;
+ ya = (y_pos / H_CELL) * x->x_num_col;
+ postauler = ya + xa;
+ /* obtenir el path per enviar a la sortida */
+ if((!cuaBuida(&x->x_cua))&&(postauler < numNodes(&x->x_cua))){
+ contador = 0;
+ maxim = x->x_num_fil * x->x_num_col;
+ if(x->x_tauler_primer){
+ actual = x->x_tauler_primer;
+ while(contador <= postauler){
+ if(contador == postauler){
+ strcpy(pathSortida,actual->pathFitxer);
+ }
+ if(actual->seguent == NULL){
+ actual = x->x_cua.davanter;
+ }else{
+ actual = actual->seguent;
+ }
+ contador++;
+ }
+ outlet_symbol(x->x_sortida, gensym(pathSortida));
+ }
+ }
+ }
+ return (1);
+}
+
+static void imagegrid_getrect(t_gobj *z, t_glist *glist,int *xp1, int *yp1, int *xp2, int *yp2)
+{
+ int cols, fils;
+ t_imagegrid* x = (t_imagegrid*)z;
+ cols = x->x_num_col;
+ fils = x->x_num_fil;
+ *xp1 = text_xpix(&x->x_obj, glist);
+ *yp1 = text_ypix(&x->x_obj, glist);
+ *xp2 = text_xpix(&x->x_obj, glist) + (cols*W_CELL);
+ *yp2 = text_ypix(&x->x_obj, glist) + (fils*H_CELL);
+ /* post("Esta amb el ratoli en el punt %d %d %d %d o son els vetexs de la caixa... es/bd", xp1, yp1, xp2, yp2); */
+}
+
+static void imagegrid_displace(t_gobj *z, t_glist *glist,int dx, int dy)
+{
+ /* post("Entra a displace amb dx %d i dy %d", dx, dy); */
+ t_imagegrid *x = (t_imagegrid *)z;
+ x->x_obj.te_xpix += dx;
+ x->x_obj.te_ypix += dy;
+ sys_vgui(".x%x.c coords %xGRID %d %d %d %d\n",
+ glist_getcanvas(glist), x,
+ text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
+ text_xpix(&x->x_obj, glist) + (x->x_num_col*W_CELL), text_ypix(&x->x_obj, glist) + (x->x_num_fil*H_CELL));
+ imagegrid_drawme(x, glist, 0);
+ canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x);
+}
+
+static void imagegrid_select(t_gobj *z, t_glist *glist, int state)
+{
+ /* post("Entra select amb state %d", state); */
+ t_imagegrid *x = (t_imagegrid *)z;
+ if (state) {
+ /* post("Imagegrid seleccionat"); */
+ sys_vgui(".x%x.c itemconfigure %xGRID -outline #0000FF\n", glist_getcanvas(glist), x);
+ }
+ else {
+ /* post("Imagegrid deseleccionat"); */
+ sys_vgui(".x%x.c itemconfigure %xGRID -outline %s\n", glist_getcanvas(glist), x, x->x_color_marc->s_name);
+ }
+}
+
+static void imagegrid_delete(t_gobj *z, t_glist *glist)
+{
+ /* post("Entra a delete"); */
+ t_text *x = (t_text *)z;
+ canvas_deletelinesfor(glist_getcanvas(glist), x);
+}
+
+static void imagegrid_vis(t_gobj *z, t_glist *glist, int vis)
+{
+ /* post("Entra a vist amb vis %d", vis); */
+ t_imagegrid* s = (t_imagegrid*)z;
+ if (vis)
+ imagegrid_drawme(s, glist, 1);
+ else
+ imagegrid_erase(s,glist);
+}
+
+
+static void imagegrid_save(t_gobj *z, t_binbuf *b)
+{
+ /* post("Entra a save"); */
+ t_imagegrid *x = (t_imagegrid *)z;
+ /* crea la cadena de paths per desar */
+ /* 100 possibles paths com a màxim a 512 cada path*/
+ /* char cadenaPaths[51200];*/
+ char *cadenaPaths, *cadenaPathsInicials;
+ path ultimPath = "";
+ cadenaPaths = (char *)malloc(51200*sizeof(char));
+ strcpy(cadenaPaths,"");
+ cadenaPathsInicials = (char *)malloc(51200*sizeof(char));
+ strcpy(cadenaPathsInicials,"");
+ /*strcpy(cadenaPaths,(char *)argv[5].a_w.w_symbol->s_name);*/
+ if(!cuaBuida(&x->x_cua))
+ {
+ Node *actual;
+ int maxim = x->x_num_fil * x->x_num_col;
+ int contador = x->x_ultima_img + 1;
+
+ if (contador > maxim) {
+ contador = 0;
+ }
+ /* printf("\n contador %d i maxim %d i laultimaPOS %d \n", contador, maxim, x->x_ultima_img); */
+ /*
+ strcat(cadenaPaths, actual->pathFitxer);
+ strcat(cadenaPaths, "1|\n");
+ contador ++;
+ */
+ /* prenem el davanter de la cua */
+ actual=x->x_cua.davanter;
+
+ while(contador < numNodes(&x->x_cua)){
+ /* afegim els paths del davanter fins a l'ultim node al tauler */
+ strcat(cadenaPaths, actual->pathFitxer);
+ strcat(cadenaPaths, "|");
+ actual = actual->seguent;
+ contador ++;
+ }
+ if(actual != x->x_cua.final){
+ /* ara resten els de de l'inici del tauler fins al final de la cua */
+ while(actual != x->x_cua.final){
+ strcat(cadenaPathsInicials, actual->pathFitxer);
+ strcat(cadenaPathsInicials, "|");
+ actual = actual->seguent;
+ }
+ /* afegeix l'últim */
+ strcat(ultimPath, actual->pathFitxer);
+ strcat(ultimPath, "|");
+ /* afegeix l'ultim de la cua */
+ strcat(cadenaPathsInicials, ultimPath);
+ }else{
+ if(x->x_ultima_img == 0){
+ strcat(ultimPath, actual->pathFitxer);
+ strcat(ultimPath, "|");
+ strcat(cadenaPathsInicials, ultimPath);
+ }
+ }
+ /* ordena el paths segons aparicio en el tauler */
+ strcat(cadenaPathsInicials, cadenaPaths);
+ /* DE MOMENT NO DESA ELS PATHS */
+ strcat(cadenaPathsInicials, "");
+ /* printf("%s",cadenaPathsInicials); */
+ }
+
+ binbuf_addv(b, "ssiissiisss", gensym("#X"),gensym("obj"),
+ x->x_obj.te_xpix, x->x_obj.te_ypix,
+ gensym("imagegrid"),x->x_name,x->x_num_fil,x->x_num_col,x->x_color_fons,x->x_color_marc,gensym(cadenaPathsInicials));
+ binbuf_addv(b, ";");
+}
+
+static void imagegrid_properties(t_gobj *z, t_glist *owner)
+{
+ char buf[800];
+ t_imagegrid *x=(t_imagegrid *)z;
+
+ /* post("Es crida a pdtk_imagegrid dialog passant nom = %s\n fils = %d \t cols = %d \t color fons = %s \t color marc = %s\n", x->x_name->s_name, x->x_num_fil, x->x_num_col, x->x_color_fons->s_name, x->x_color_marc->s_name); */
+ sprintf(buf, "pdtk_imagegrid_dialog %%s %s %d %d %s %s\n",
+ x->x_name->s_name, x->x_num_fil, x->x_num_col, x->x_color_fons->s_name, x->x_color_marc->s_name);
+ /* post("imagegrid_properties : %s", buf ); */
+ gfxstub_new(&x->x_obj.ob_pd, x, buf);
+}
+
+static void imagegrid_dialog(t_imagegrid *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int maxim, nfil, ncol, maxdigit;
+ if ( !x ) {
+ post("Imagegrid: error_ intent de modificar le propietats d'un objecte inexistent\n");
+ }
+ if ( argc != 5 )
+ {
+ post("Imagegrid: error_ sobre el nombre d'arguments ( 5 enlloc de %d )\n",argc);
+ return;
+ }
+ if (argv[0].a_type != A_SYMBOL || argv[1].a_type != A_FLOAT || argv[2].a_type != A_FLOAT || argv[3].a_type != A_SYMBOL || argv[4].a_type != A_SYMBOL)
+ {
+ post("Imagegrid: error_ algun dels arguments no es del tipus adequat\n");
+ return;
+ }
+ x->x_name = argv[0].a_w.w_symbol;
+ nfil = (int)argv[1].a_w.w_float;
+ ncol = (int)argv[2].a_w.w_float;
+ x->x_color_fons = argv[3].a_w.w_symbol;
+ x->x_color_marc = argv[4].a_w.w_symbol;
+ /* el màxim es fixa pel nombre de digits utilitzats pel nom de la imatge temporal */
+ maxdigit = pow(10,BYTES_NUM_TEMP);
+ if((nfil*ncol) <= maxdigit){
+ if((nfil*ncol) > 0){
+ x->x_num_fil = nfil;
+ x->x_num_col = ncol;
+ }else{
+ post("Imagegrid: El nombre de files i columnes són inferiors al mímin permès: 1 casella\n",maxdigit);
+ }
+ }else{
+ post("Imagegrid: El nombre de files i columnes excedeixen del màxim permès: un total de %d caselles\n",maxdigit);
+ }
+
+ post("Imagegrid: Valors modificats_ nom = %s\n fils = %d \t cols = %d\n", x->x_name->s_name, x->x_num_fil, x->x_num_col);
+ /* elimina els nodes no representables amb la nova configuració */
+ maxim = x->x_num_fil * x->x_num_col;
+ int extret;
+ imagegrid_erase(x, x->x_glist);
+ /* si hi ha més nodes a la cua que el maxim */
+ while((numNodes(&x->x_cua)) > maxim){
+ /* desencuem */
+ extret = desencuar(&x->x_cua);
+ }
+ /* al reestablir el tamany del tauler cal saber la posició de l'últim element */
+ x->x_ultima_img = numNodes(&x->x_cua) - 1;
+ if (x->x_ultima_img < 0) x->x_ultima_img = 0;
+ x->x_tauler_primer = x->x_cua.davanter;
+ imagegrid_drawme(x, x->x_glist, 1);
+}
+
+t_widgetbehavior imagegrid_widgetbehavior;
+
+static void imagegrid_setwidget(void)
+{
+ /* post("Entra a setwidget"); */
+ imagegrid_widgetbehavior.w_getrectfn = imagegrid_getrect;
+ imagegrid_widgetbehavior.w_displacefn = imagegrid_displace;
+ imagegrid_widgetbehavior.w_selectfn = imagegrid_select;
+ imagegrid_widgetbehavior.w_activatefn = NULL;
+ imagegrid_widgetbehavior.w_deletefn = imagegrid_delete;
+ imagegrid_widgetbehavior.w_visfn = imagegrid_vis;
+ /* clic del ratoli */
+ imagegrid_widgetbehavior.w_clickfn = imagegrid_click;
+
+#if PD_MINOR_VERSION < 37
+ imagegrid_widgetbehavior.w_savefn = imagegrid_save;
+ imagegrid_widgetbehavior.w_propertiesfn = imagegrid_properties;
+#endif
+
+}
+
+/* el constructor de la classe*/
+static void *imagegrid_new(t_symbol* name, int argc, t_atom *argv)
+{
+ /* instanciació del nou objecte */
+ t_imagegrid *x = (t_imagegrid *)pd_new(imagegrid_class);
+ /* crea una sortida per l'objecte*/
+ x->x_sortida = outlet_new(&x->x_obj,&s_symbol);
+ /* s'obté el canvas de pd */
+ x->x_glist = (t_glist*) canvas_getcurrent();
+
+ /* posició en el tauler de la última imatge afegida */
+ x->x_ultima_img = 0;
+ /* posició de l'últim fitxer del directori encuat */
+ x->x_dir_pos = 0;
+ /* apuntador al primer element en el tauler */
+ x->x_tauler_primer = NULL;
+ /* fixa el nom de l'objecte */
+ char nom[15];
+ sprintf(nom, "imagegrid%d", ++imagegridcount);
+ name = gensym(nom);
+ x->x_name = name;
+ /* amb aquest nom es prepara per poder rebre dades */
+ pd_bind(&x->x_obj.ob_pd, x->x_name);
+ /* crea la cua de nodes */
+ crearCua(&x->x_cua);
+ post("NOU imagegrid: s'han entrat %d arguments\n", argc);
+
+ if (argc != 0)
+ {
+ post("NOU imagegrid: s'obre un objecte existent o amb arguments definits\n");
+ /* x->x_name */
+ x->x_num_fil = (int)atom_getintarg(1, argc, argv);
+ x->x_num_col = (int)atom_getintarg(2, argc, argv);
+ x->x_color_fons = argv[3].a_w.w_symbol;
+ x->x_color_marc = argv[4].a_w.w_symbol;
+ post("!!!NOU imagegrid: s'han entrat %d arguments\n", argc);
+ if(argc == 6){
+ /* llegir la cadena de paths | afegir els paths a la cua */
+ char *cadenaPaths;
+ cadenaPaths = (char *)malloc(51200*sizeof(char));
+ strcpy(cadenaPaths,(char *)argv[5].a_w.w_symbol->s_name);
+ /* printf("Es carreguen els paths %s --- %s **** %s\n", cadenaPaths, argv[5].a_w.w_symbol->s_name,argv[3].a_w.w_symbol->s_name); */
+ /* split */
+
+ char *token;
+ t_symbol *tt;
+ for ( token = strtok(argv[5].a_w.w_symbol->s_name,"|");
+ token != NULL;
+ token = strtok(NULL,"|") ){
+ tt = gensym(token);
+
+ /* printf("AFEGINT CARREGANT %s\n",tt->s_name); */
+ /* imagegrid_putimg(x,tt); */
+ /* DE MOMENT NO AFEGEIX ELS PATHS */
+ /* imagegrid_afegir_imatge(x,tt->s_name); */
+ }
+ /*
+ token = strtok(cadenaPaths,"|");
+ while(token){
+ tt = gensym(token);
+ printf("AFEGINT CARREGANT %s\n",tt->s_name);
+ imagegrid_putimg(x,tt);
+ token = strtok(NULL,"|");
+ }
+ */
+ free(cadenaPaths);
+ }
+ }else{
+ /* crea un objecte nou */
+ post("NOU imagegrid: es crea un objecte nou\n");
+ /* fixa el nombre de files */
+ x->x_num_fil = 3;
+ /* fixa el nombre de columnes */
+ x->x_num_col = 5;
+
+ /* colors de fons i de marc*/
+ x->x_color_fons = gensym("#F0F0F0");
+ x->x_color_marc = gensym("#0F0F0F");
+ }
+ /* printf("S'ha instanciat un imagegrid anomenat %s amb les caracteristiques seguents:",x->x_name->s_name);
+ printf("Nombre de files %d - Nombre de columnes: %d", x->x_num_fil, x->x_num_col); */
+
+ return (x);
+}
+
+static void imagegrid_destroy(t_imagegrid *x){
+ /* elimina el contingut de la cua */
+ eliminarCua(&x->x_cua);
+ post("Imagegrid eliminat");
+}
+
+/* generacio d'una nova classe */
+/* al carregar la nova llibreria my_lib pd intenta cridar la funció my_lib_setup */
+/* aquesta crea la nova classe i les seves propietats només un sol cop */
+
+void imagegrid_setup(void)
+{
+ /* post("Entra a setup per generar la classe imagegrid"); */
+ #include "imagegrid.tk2c"
+ /*
+ sense pas d'arguments
+ imagegrid_class = class_new(gensym("imagegrid"),
+ (t_newmethod)imagegrid_new,
+ (t_method)imagegrid_destroy,
+ sizeof(t_imagegrid),
+ CLASS_DEFAULT,
+ A_DEFSYM,
+ 0);
+ amb pas d'arguments:
+ */
+ imagegrid_class = class_new(gensym("imagegrid"),
+ (t_newmethod)imagegrid_new,
+ (t_method)imagegrid_destroy,
+ sizeof(t_imagegrid),
+ CLASS_DEFAULT,
+ A_GIMME,
+ 0);
+ /* class_new crea la nova classe retornant un punter al seu prototipus,
+ el primer argument es el nom simbolic de la classe,
+ el segon i tercer corresponen al constructor i destructor de la classe respectivament,
+ (el constructor instancia un objecte i inicialitza les seves dades cada cop que es crea un objecte
+ el destructor allibera la memoria reservada al destruid l'objecte per qualsevol causa)
+ el quart correspon a la mida de l'estructura de dades, per tal de poder reservar la memoria necessària,
+ el cinquè influeix en el mòde de representació gràfica del objectes. Per defecte CLASS_DEFAULT o ``0',
+ la resta d'arguments defineixen els arguments de l'objecte i el seu tipus, la llista acaba amb 0
+ */
+
+ /* afegeix el mètode helloworld_bang a la classe helloworld_class */
+ class_addbang(imagegrid_class, imagegrid_bang);
+
+ /* afegeix el mètode imagegrid_putimg a la classe imagegrid per a entrades de missatge
+ que inicien amb putimg i una cadena string com a argument */
+ class_addmethod(imagegrid_class,(t_method)imagegrid_putimg,gensym("putimg"), A_DEFSYMBOL, 0);
+
+ /* afegeix el mètode imagegrid_putimgdir a la classe imagegrid per a entrades de missatge
+ que inicien amb putimgdir i una cadena string com a argument */
+ class_addmethod(imagegrid_class,(t_method)imagegrid_putimgdir,gensym("putimgdir"), A_DEFSYMBOL, 0);
+ /* afegeix un metode per a modificar el valor de les propietats de l'objecte */
+ class_addmethod(imagegrid_class, (t_method)imagegrid_dialog, gensym("dialog"), A_GIMME, 0);
+ /* afegeix un metode per l'obtencio de la posicio del clic del ratolí */
+ class_addmethod(imagegrid_class, (t_method)imagegrid_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
+ /* inicia el comportament de imagegrid */
+ imagegrid_setwidget();
+
+#if PD_MINOR_VERSION >= 37
+ class_setsavefn(imagegrid_class,&imagegrid_save);
+ class_setpropertiesfn(imagegrid_class, imagegrid_properties);
+#endif
+
+ /* afegeix el mètode imagegrid_widgetbehavior al la classe imagegrid per a la creació de l'element visual */
+ class_setwidget(imagegrid_class,&imagegrid_widgetbehavior);
+ class_sethelpsymbol(imagegrid_class, gensym("imagegrid.pd"));
+}
diff --git a/imagegrid/imagegrid.tk b/imagegrid/imagegrid.tk
new file mode 100644
index 0000000..e594805
--- /dev/null
+++ b/imagegrid/imagegrid.tk
@@ -0,0 +1,146 @@
+############ procediments per imagegrid -- slario(at)gmail.com [a partir del codi del grid de l'Ives: ydegoyon(at)free.fr] #########
+
+proc imagegrid_apply {id} {
+# strip "." from the TK id to make a variable name suffix
+ set vid [string trimleft $id .]
+
+# for each variable, make a local variable to hold its name...
+ set var_graph_name [concat graph_name_$vid]
+ global $var_graph_name
+ set var_graph_num_fil [concat graph_num_fil_$vid]
+ global $var_graph_num_fil
+ set var_graph_num_col [concat graph_num_col_$vid]
+ global $var_graph_num_col
+ set var_graph_color_fons [concat graph_color_fons_$vid]
+ global $var_graph_color_fons
+ set var_graph_color_marc [concat graph_color_marc_$vid]
+ global $var_graph_color_marc
+
+
+ set cmd [concat $id dialog \
+ [eval concat $$var_graph_name] \
+ [eval concat $$var_graph_num_fil] \
+ [eval concat $$var_graph_num_col] \
+ [eval concat $$var_graph_color_fons] \
+ [eval concat $$var_graph_color_marc] \
+ \;]
+#puts stderr $cmd
+ pd $cmd
+}
+
+proc imagegrid_cancel {id} {
+ set cmd [concat $id cancel \;]
+#puts stderr $cmd
+ pd $cmd
+}
+
+proc imagegrid_ok {id} {
+ imagegrid_apply $id
+ imagegrid_cancel $id
+}
+
+proc pdtk_imagegrid_dialog {id name num_fil num_col color_fons color_marc} {
+ set vid [string trimleft $id .]
+ set var_graph_name [concat graph_name_$vid]
+ global $var_graph_name
+ set var_graph_num_fil [concat graph_num_fil_$vid]
+ global $var_graph_num_fil
+ set var_graph_num_col [concat graph_num_col_$vid]
+ global $var_graph_num_col
+ set var_graph_color_fons [concat graph_color_fons_$vid]
+ global $var_graph_color_fons
+ set var_graph_color_marc [concat graph_color_marc_$vid]
+ global $var_graph_color_marc
+
+ set $var_graph_name $name
+ set $var_graph_num_fil $num_fil
+ set $var_graph_num_col $num_col
+ set $var_graph_color_fons $color_fons
+ set $var_graph_color_marc $color_marc
+
+ toplevel $id
+ wm title $id {imagegrid}
+ wm protocol $id WM_DELETE_WINDOW [concat imagegrid_cancel $id]
+
+ label $id.label -text {IMAGEGRID PROPERTIES}
+ pack $id.label -side top
+
+ frame $id.buttonframe
+ pack $id.buttonframe -side bottom -fill x -pady 2m
+ button $id.buttonframe.cancel -text {Cancel}\
+ -command "imagegrid_cancel $id"
+ button $id.buttonframe.apply -text {Apply}\
+ -command "imagegrid_apply $id"
+ button $id.buttonframe.ok -text {OK}\
+ -command "imagegrid_ok $id"
+ pack $id.buttonframe.cancel -side left -expand 1
+ pack $id.buttonframe.apply -side left -expand 1
+ pack $id.buttonframe.ok -side left -expand 1
+
+ frame $id.1rangef
+ pack $id.1rangef -side top
+ label $id.1rangef.lname -text "Nom :"
+ entry $id.1rangef.name -textvariable $var_graph_name -width 7
+ pack $id.1rangef.lname $id.1rangef.name -side left
+
+ frame $id.2rangef
+ pack $id.2rangef -side top
+ label $id.2rangef.lnum_fil -text "Fils :"
+ entry $id.2rangef.num_fil -textvariable $var_graph_num_fil -width 7
+ pack $id.2rangef.lnum_fil $id.2rangef.num_fil -side left
+
+ frame $id.3rangef
+ pack $id.3rangef -side top
+ label $id.3rangef.lnum_col -text "Cols :"
+ entry $id.3rangef.num_col -textvariable $var_graph_num_col -width 7
+ pack $id.3rangef.lnum_col $id.3rangef.num_col -side left
+
+ frame $id.4rangef
+ pack $id.4rangef -side top
+ label $id.4rangef.lcolor_fons -text "Color fons :"
+ entry $id.4rangef.color_fons -textvariable $var_graph_color_fons -width 7
+ pack $id.4rangef.lcolor_fons $id.4rangef.color_fons -side left
+
+ frame $id.5rangef
+ pack $id.5rangef -side top
+ label $id.5rangef.lcolor_marc -text "Color marc :"
+ entry $id.5rangef.color_marc -textvariable $var_graph_color_marc -width 7
+ pack $id.5rangef.lcolor_marc $id.5rangef.color_marc -side left
+
+
+ bind $id.1rangef.name <KeyPress-Return> [concat imagegrid_ok $id]
+ bind $id.2rangef.num_fil <KeyPress-Return> [concat imagegrid_ok $id]
+ bind $id.3rangef.num_col <KeyPress-Return> [concat imagegrid_ok $id]
+ bind $id.4rangef.color_fons <KeyPress-Return> [concat imagegrid_ok $id]
+ bind $id.5rangef.color_marc <KeyPress-Return> [concat imagegrid_ok $id]
+
+ focus $id.1rangef.name
+}
+
+proc table {w content args} {
+ frame $w -bg black
+ set r 0
+ foreach row $content {
+ set fields {}
+ set c 0
+ foreach col $row {
+ # lappend fields [label $w.$r/$c -text $col]
+ set img [image create photo -file $col]
+ lappend fields [label $w.$r/$c -image $img]
+ incr c
+ }
+ eval grid $fields -sticky news -padx 1 -pady 1
+ incr r
+ }
+ set w
+}
+
+proc pdtk_imagegrid_table {id name num_fil num_col} {
+ table .tauler {
+ {sll80x60.gif 3160x120.gif sll80x60.gif}
+ {sll80x60.gif sll80x60.gif sll80x60.gif}
+ {sll80x60.ppm sll80x60.gif 3160x120.gif}
+ }
+ pack .tauler
+}
+############ FINAL procediments per imagegrid -- slario(at)gmail.com [a partir del codi del grid de l'Ives: ydegoyon(at)free.fr] ######### \ No newline at end of file
diff --git a/imagegrid/imagegrid.tk2c b/imagegrid/imagegrid.tk2c
new file mode 100644
index 0000000..6aaf386
--- /dev/null
+++ b/imagegrid/imagegrid.tk2c
@@ -0,0 +1,115 @@
+// ########### procediments per imagegrid -- slario(at)gmail.com [a partir del codi del grid de l'Ives: ydegoyon(at)free.fr] #########
+sys_gui("proc imagegrid_apply {id} {\n");
+// strip "." from the TK id to make a variable name suffix
+sys_gui("set vid [string trimleft $id .]\n");
+// for each variable, make a local variable to hold its name...
+sys_gui("set var_graph_name [concat graph_name_$vid]\n");
+sys_gui("global $var_graph_name\n");
+sys_gui("set var_graph_num_fil [concat graph_num_fil_$vid]\n");
+sys_gui("global $var_graph_num_fil\n");
+sys_gui("set var_graph_num_col [concat graph_num_col_$vid]\n");
+sys_gui("global $var_graph_num_col\n");
+sys_gui("set var_graph_color_fons [concat graph_color_fons_$vid]\n");
+sys_gui("global $var_graph_color_fons\n");
+sys_gui("set var_graph_color_marc [concat graph_color_marc_$vid]\n");
+sys_gui("global $var_graph_color_marc\n");
+sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_name] [eval concat $$var_graph_num_fil] [eval concat $$var_graph_num_col] [eval concat $$var_graph_color_fons] [eval concat $$var_graph_color_marc] \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc imagegrid_cancel {id} {\n");
+sys_gui("set cmd [concat $id cancel \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc imagegrid_ok {id} {\n");
+sys_gui("imagegrid_apply $id\n");
+sys_gui("imagegrid_cancel $id\n");
+sys_gui("}\n");
+sys_gui("proc pdtk_imagegrid_dialog {id name num_fil num_col color_fons color_marc} {\n");
+sys_gui("set vid [string trimleft $id .]\n");
+sys_gui("set var_graph_name [concat graph_name_$vid]\n");
+sys_gui("global $var_graph_name\n");
+sys_gui("set var_graph_num_fil [concat graph_num_fil_$vid]\n");
+sys_gui("global $var_graph_num_fil\n");
+sys_gui("set var_graph_num_col [concat graph_num_col_$vid]\n");
+sys_gui("global $var_graph_num_col\n");
+sys_gui("set var_graph_color_fons [concat graph_color_fons_$vid]\n");
+sys_gui("global $var_graph_color_fons\n");
+sys_gui("set var_graph_color_marc [concat graph_color_marc_$vid]\n");
+sys_gui("global $var_graph_color_marc\n");
+sys_gui("set $var_graph_name $name\n");
+sys_gui("set $var_graph_num_fil $num_fil\n");
+sys_gui("set $var_graph_num_col $num_col\n");
+sys_gui("set $var_graph_color_fons $color_fons\n");
+sys_gui("set $var_graph_color_marc $color_marc\n");
+sys_gui("toplevel $id\n");
+sys_gui("wm title $id {imagegrid}\n");
+sys_gui("wm protocol $id WM_DELETE_WINDOW [concat imagegrid_cancel $id]\n");
+sys_gui("label $id.label -text {IMAGEGRID PROPERTIES}\n");
+sys_gui("pack $id.label -side top\n");
+sys_gui("frame $id.buttonframe\n");
+sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n");
+sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"imagegrid_cancel $id\"\n");
+sys_gui("button $id.buttonframe.apply -text {Apply} -command \"imagegrid_apply $id\"\n");
+sys_gui("button $id.buttonframe.ok -text {OK} -command \"imagegrid_ok $id\"\n");
+sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.apply -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.ok -side left -expand 1\n");
+sys_gui("frame $id.1rangef\n");
+sys_gui("pack $id.1rangef -side top\n");
+sys_gui("label $id.1rangef.lname -text \"Nom :\"\n");
+sys_gui("entry $id.1rangef.name -textvariable $var_graph_name -width 7\n");
+sys_gui("pack $id.1rangef.lname $id.1rangef.name -side left\n");
+sys_gui("frame $id.2rangef\n");
+sys_gui("pack $id.2rangef -side top\n");
+sys_gui("label $id.2rangef.lnum_fil -text \"Fils :\"\n");
+sys_gui("entry $id.2rangef.num_fil -textvariable $var_graph_num_fil -width 7\n");
+sys_gui("pack $id.2rangef.lnum_fil $id.2rangef.num_fil -side left\n");
+sys_gui("frame $id.3rangef\n");
+sys_gui("pack $id.3rangef -side top\n");
+sys_gui("label $id.3rangef.lnum_col -text \"Cols :\"\n");
+sys_gui("entry $id.3rangef.num_col -textvariable $var_graph_num_col -width 7\n");
+sys_gui("pack $id.3rangef.lnum_col $id.3rangef.num_col -side left\n");
+sys_gui("frame $id.4rangef\n");
+sys_gui("pack $id.4rangef -side top\n");
+sys_gui("label $id.4rangef.lcolor_fons -text \"Color fons :\"\n");
+sys_gui("entry $id.4rangef.color_fons -textvariable $var_graph_color_fons -width 7\n");
+sys_gui("pack $id.4rangef.lcolor_fons $id.4rangef.color_fons -side left\n");
+sys_gui("frame $id.5rangef\n");
+sys_gui("pack $id.5rangef -side top\n");
+sys_gui("label $id.5rangef.lcolor_marc -text \"Color marc :\"\n");
+sys_gui("entry $id.5rangef.color_marc -textvariable $var_graph_color_marc -width 7\n");
+sys_gui("pack $id.5rangef.lcolor_marc $id.5rangef.color_marc -side left\n");
+sys_gui("bind $id.1rangef.name <KeyPress-Return> [concat imagegrid_ok $id]\n");
+sys_gui("bind $id.2rangef.num_fil <KeyPress-Return> [concat imagegrid_ok $id]\n");
+sys_gui("bind $id.3rangef.num_col <KeyPress-Return> [concat imagegrid_ok $id]\n");
+sys_gui("bind $id.4rangef.color_fons <KeyPress-Return> [concat imagegrid_ok $id]\n");
+sys_gui("bind $id.5rangef.color_marc <KeyPress-Return> [concat imagegrid_ok $id]\n");
+sys_gui("focus $id.1rangef.name\n");
+sys_gui("}\n");
+sys_gui("proc table {w content args} {\n");
+sys_gui("frame $w -bg black\n");
+sys_gui("set r 0\n");
+sys_gui("foreach row $content {\n");
+sys_gui("set fields {}\n");
+sys_gui("set c 0\n");
+sys_gui("foreach col $row {\n");
+// lappend fields [label $w.$r/$c -text $col]
+sys_gui("set img [image create photo -file $col]\n");
+sys_gui("lappend fields [label $w.$r/$c -image $img]\n");
+sys_gui("incr c\n");
+sys_gui("}\n");
+sys_gui("eval grid $fields -sticky news -padx 1 -pady 1\n");
+sys_gui("incr r\n");
+sys_gui("}\n");
+sys_gui("set w\n");
+sys_gui("}\n");
+sys_gui("proc pdtk_imagegrid_table {id name num_fil num_col} {\n");
+sys_gui("table .tauler {\n");
+sys_gui("{sll80x60.gif 3160x120.gif sll80x60.gif}\n");
+sys_gui("{sll80x60.gif sll80x60.gif sll80x60.gif}\n");
+sys_gui("{sll80x60.ppm sll80x60.gif 3160x120.gif}\n");
+sys_gui("}\n");
+sys_gui("pack .tauler\n");
+sys_gui("}\n");
diff --git a/imagegrid/imagegrid10x10.pd b/imagegrid/imagegrid10x10.pd
new file mode 100644
index 0000000..99fb78e
--- /dev/null
+++ b/imagegrid/imagegrid10x10.pd
@@ -0,0 +1,18 @@
+#N canvas 329 265 823 708 10;
+#X text 24 93 LLISTA STDOUT;
+#X text 154 138 AFEGIR IMATGE;
+#X text 154 183 AFEGIR IMATGES D'UN DIRECTORI;
+#X symbolatom 26 650 60 0 0 0 - - -;
+#X obj 26 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X obj 26 226 imagegrid imagegrid3 10 10 #F0F0F0 #0F0F0F ;
+#X text 154 83 AFEGIR IMATGES D'UN DIRECTORI;
+#X msg 156 96 putimgdir /home/sergi/vjgnulinux/media/imatges;
+#X msg 156 152 putimg /usr/local/lib/pd/extra/imagegrid/images/logo100.gif
+;
+#X msg 156 197 putimgdir /usr/local/lib/pd/extra/imagegrid/images;
+#X connect 4 0 5 0;
+#X connect 5 0 3 0;
+#X connect 7 0 5 0;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
diff --git a/imagegrid/magickconverter.c b/imagegrid/magickconverter.c
new file mode 100644
index 0000000..d553e27
--- /dev/null
+++ b/imagegrid/magickconverter.c
@@ -0,0 +1,52 @@
+#include "magickconverter.h"
+
+void convertir(pathimage pathFitxer, tipus_format f, int W, int H, int posi){
+
+ MagickBooleanType
+ status;
+ MagickWand
+ *magick_wand;
+ pathimage ig_path = PATH_TEMPORAL;
+ char posi_str[BYTES_NUM_TEMP];
+
+ /*printf("\nEl path %s i el format %s\n",pathFitxer,f);*/
+
+ /*
+ Read an image.
+ */
+ MagickWandGenesis();
+ magick_wand=NewMagickWand();
+ status=MagickReadImage(magick_wand,pathFitxer);
+ if (status == MagickFalse)
+ ThrowWandException(magick_wand);
+ /*
+ Turn the images into a thumbnail sequence.
+ */
+ MagickResetIterator(magick_wand);
+ while (MagickNextImage(magick_wand) != MagickFalse)
+ MagickResizeImage(magick_wand,W,H,LanczosFilter,1.0);
+ /*
+ Write the image as 'f' and destroy it.
+ */
+ sprintf(posi_str, "%d", posi);
+ strcat(ig_path,posi_str);
+ strcat(ig_path,".");
+ strcat(ig_path,f);
+
+ /* printf("\nEl nou path %s i el format %s\n",ig_path,f); */
+ status=MagickWriteImages(magick_wand,ig_path,MagickTrue);
+ if (status == MagickFalse)
+ ThrowWandException(magick_wand);
+ magick_wand=DestroyMagickWand(magick_wand);
+ MagickWandTerminus();
+}
+
+/*
+int main(void){
+ pathimage imatge = "/usr/lib/pd/extra/imagegrid/gifpmmimages/3160x120.gif";
+ format fo = "ppm";
+ int numi = 1;
+ convertir(imatge,fo,60,40,1);
+ return(0);
+}
+*/
diff --git a/imagegrid/magickconverter.h b/imagegrid/magickconverter.h
new file mode 100644
index 0000000..4e82c71
--- /dev/null
+++ b/imagegrid/magickconverter.h
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+/*#include <wand/MagickWand.h>*/
+#include <wand/magick-wand.h>
+
+#define BYTESNOMFITXERIMATGE 512
+#define BYTESTIPUSFROMAT 4
+
+#define FORMAT_MINIATURA "ppm"
+#define PATH_TEMPORAL "/tmp/imgrid_"
+#define BYTES_NUM_TEMP 4
+
+#define ThrowWandException(wand) \
+{ \
+ char \
+ *description; \
+ \
+ ExceptionType \
+ severity; \
+ \
+ description=MagickGetException(wand,&severity); \
+ (void) fprintf(stderr,"%s %s %ld %s\n",GetMagickModule(),description); \
+ description=(char *) MagickRelinquishMemory(description); \
+ exit(-1); \
+}
+
+typedef char pathimage[BYTESNOMFITXERIMATGE];
+
+typedef char tipus_format[BYTESTIPUSFROMAT];
+
+void convertir(pathimage pathFitxer, tipus_format f, int W, int H, int posi);
diff --git a/imagegrid/tk2c.sh b/imagegrid/tk2c.sh
new file mode 100644
index 0000000..1b1dc09
--- /dev/null
+++ b/imagegrid/tk2c.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#set -x
+
+while read line
+do
+ for word in $line
+ do
+ if [ "X"$word != "X"${word#\#} ]
+ then
+ echo // ${line#\#}
+ break
+ else
+ line=${line//\'/\\\'}
+#useless, slashes never gets in
+ line=${line//\\/\\\\}
+#this one's dirty, i know
+ line=${line//;/\\\\;}
+ line=${line//\"/\\\"}
+ echo 'sys_gui("'$line'\n");'
+ break
+ fi
+ done
+done
+
diff --git a/pdp_freeframe/CHANGES.LOG b/pdp_freeframe/CHANGES.LOG
new file mode 100755
index 0000000..46f7ad7
--- /dev/null
+++ b/pdp_freeframe/CHANGES.LOG
@@ -0,0 +1,6 @@
+0.3
+ added parameters details
+0.2
+ simplified RGB conversions
+0.1
+ initial release
diff --git a/pdp_freeframe/FreeFrame.h b/pdp_freeframe/FreeFrame.h
new file mode 100644
index 0000000..7ca7f75
--- /dev/null
+++ b/pdp_freeframe/FreeFrame.h
@@ -0,0 +1,233 @@
+#ifndef __FREEFRAME_H__
+#define __FREEFRAME_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * FreeFrame.h
+ *
+ * FreeFrame Open Video Plugin Prototype
+ * C Version
+ *
+ * www.freeframe.org
+ * marcus@freeframe.org
+ *
+ *
+ *
+ * Copyright (c) 2002, Marcus Clements www.freeframe.org
+ * All rights reserved.
+ *
+ * FreeFrame 1.0 upgrade by Pete Warden
+ * www.petewarden.com
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of FreeFrame nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * includes
+ */
+
+#ifdef WIN32
+
+#if _MSC_VER > 1000
+#pragma once
+#endif /* _MSC_VER > 1000 */
+
+#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
+#include <windows.h>
+
+#elif defined LINUX
+
+typedef unsigned int DWORD;
+typedef void *LPVOID;
+typedef unsigned char BYTE;
+
+#elif defined MACOS
+
+typedef unsigned int DWORD;
+typedef unsigned char BYTE;
+
+#endif
+
+
+/*
+ * #defines
+ */
+
+#define FF_EFFECT 0
+#define FF_SOURCE 1
+
+#define FF_FAIL 0xFFFFFFFF
+#define FF_SUCCESS 0
+#define FF_TRUE 1
+#define FF_FALSE 0
+#define FF_SUPPORTED 1
+#define FF_UNSUPPORTED 0
+
+#define FF_GETINFO 0
+#define FF_INITIALISE 1
+#define FF_DEINITIALISE 2
+#define FF_PROCESSFRAME 3
+#define FF_GETNUMPARAMETERS 4
+#define FF_GETPARAMETERNAME 5
+#define FF_GETPARAMETERDEFAULT 6
+#define FF_GETPARAMETERDISPLAY 7
+#define FF_SETPARAMETER 8
+#define FF_GETPARAMETER 9
+#define FF_GETPLUGINCAPS 10
+#define FF_INSTANTIATE 11
+#define FF_DEINSTANTIATE 12
+#define FF_GETEXTENDEDINFO 13
+#define FF_PROCESSFRAMECOPY 14
+#define FF_GETPARAMETERTYPE 15
+
+#define FF_CAP_16BITVIDEO 0
+#define FF_CAP_24BITVIDEO 1
+#define FF_CAP_32BITVIDEO 2
+#define FF_CAP_PROCESSFRAMECOPY 3
+#define FF_CAP_MINIMUMINPUTFRAMES 10
+#define FF_CAP_MAXIMUMINPUTFRAMES 11
+#define FF_CAP_COPYORINPLACE 15
+
+#define FF_CAP_PREFER_NONE 0
+#define FF_CAP_PREFER_INPLACE 1
+#define FF_CAP_PREFER_COPY 2
+#define FF_CAP_PREFER_BOTH 3
+
+#define FF_TYPE_BOOLEAN 0
+#define FF_TYPE_EVENT 1
+#define FF_TYPE_RED 2
+#define FF_TYPE_GREEN 3
+#define FF_TYPE_BLUE 4
+#define FF_TYPE_XPOS 5
+#define FF_TYPE_YPOS 6
+#define FF_TYPE_STANDARD 10
+#define FF_TYPE_TEXT 100
+
+/*
+ * FreeFrame types
+ */
+
+typedef struct PlugInfoStructTag {
+ DWORD APIMajorVersion;
+ DWORD APIMinorVersion;
+ BYTE uniqueID[4]; /* 4 chars uniqueID - not null terminated */
+ BYTE pluginName[16]; /* 16 chars plugin friendly name - not null terminated */
+ DWORD pluginType; /* Effect or source */
+} PlugInfoStruct;
+
+typedef struct PlugExtendedInfoStructTag {
+ DWORD PluginMajorVersion;
+ DWORD PluginMinorVersion;
+ char* Description;
+ char* About;
+ DWORD FreeFrameExtendedDataSize;
+ void* FreeFrameExtendedDataBlock;
+} PlugExtendedInfoStruct;
+
+typedef struct VideoInfoStructTag {
+ DWORD frameWidth; /* width of frame in pixels */
+ DWORD frameHeight; /* height of frame in pixels */
+ DWORD bitDepth; /* enumerated indicator of bit depth of video */
+ /* 0 = 16 bit 5-6-5 1 = 24bit packed 2 = 32bit */
+ DWORD orientation; /* video frame orientation meaningful values:
+ 1 = origin at top left 2 = origin at bottom left */
+
+} VideoInfoStruct;
+
+typedef struct ProcessFrameCopyStructTag {
+ DWORD numInputFrames;
+ void** InputFrames;
+ void* OutputFrame;
+} ProcessFrameCopyStruct;
+
+typedef struct SetParameterStructTag {
+ DWORD index;
+ float value;
+} SetParameterStruct;
+
+typedef union {
+ DWORD ivalue;
+ float fvalue;
+ char *svalue;
+} ParameterValue;
+
+typedef union plugMainUnionTag {
+ DWORD ivalue;
+ float fvalue;
+ VideoInfoStruct *VISvalue;
+ PlugInfoStruct *PISvalue;
+ char *svalue;
+} plugMainUnion;
+
+typedef plugMainUnion plugMainType(DWORD, LPVOID, DWORD);
+
+/*
+ * Function prototypes
+ */
+
+/*
+ * plugMain - The one and only exposed function
+ * parameters:
+ * functionCode - tells the plugin which function is being called
+ * pParam - 32-bit parameter or 32-bit pointer to parameter structure
+ *
+ * PLUGIN DEVELOPERS: you shouldn't need to change this function
+ *
+ * All parameters are cast as 32-bit untyped pointers and cast to appropriate
+ * types here
+ *
+ * All return values are cast to 32-bit untyped pointers here before return to
+ * the host
+ *
+ *
+ */
+
+#ifdef WIN32
+
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, DWORD lpReserved );
+
+__declspec(dllexport) LPVOID __stdcall plugMain(DWORD functionCode, LPVOID pParam, DWORD reserved);
+
+typedef __declspec(dllimport) LPVOID (__stdcall *FF_Main_FuncPtr)(DWORD, LPVOID, DWORD);
+
+#elif LINUX
+
+plugMainUnion plugMain(DWORD functionCode, LPVOID pParam, DWORD reserved);
+
+
+#elif MACOS
+
+typedef LPVOID (*FF_Main_FuncPtr)(DWORD, LPVOID, DWORD);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/pdp_freeframe/INSTALL b/pdp_freeframe/INSTALL
new file mode 100644
index 0000000..74dc31e
--- /dev/null
+++ b/pdp_freeframe/INSTALL
@@ -0,0 +1,21 @@
+1. Download FreeFrame1.0-05.tar.gz from http://sourceforge.net/projects/freeframe/
+
+ untar and cd to the FreeFrame1.0-05 directory
+ you have the binary plugins in the plugins_bin directory but you will need to compile the plugins to be sure that work.
+ compile the plugins::
+ cd to plugins_src/PetesPluginsLinux/ and type 'make'
+
+2. Download pdp_freeframe.tar.gz from http://www.artefacte.org/pd/pdp_freeframe.tar.gz
+
+ untar the pdp_freeframe.tar.gz file
+ cd in to the pdp_freeframe directory
+
+ edit the Makefile.config file and change the path to the pd and pdp sources i
+ and to the Free Frame plugins (*.so files)
+
+ type 'make'
+
+ to load the pdp_freeframe help file type 'pd -nrt -lib pdp:pdp_freeframe help_pdp_freeframe.pd'
+
+
+
diff --git a/pdp_freeframe/Makefile b/pdp_freeframe/Makefile
new file mode 100644
index 0000000..60c358b
--- /dev/null
+++ b/pdp_freeframe/Makefile
@@ -0,0 +1,16 @@
+current: all
+
+include Makefile.config
+
+PDP_MOD = pdp_freeframe.o
+
+
+# build basic image processing modules (derived from base class)
+all: $(PDP_MOD)
+ $(CC) -export_dynamic -shared -o pdp_freeframe.pd_linux *.o $(PDP_LIBS)
+
+clean:
+ rm -f *~
+ rm -f *.o
+ rm -f *.pd_linux
+
diff --git a/pdp_freeframe/Makefile.config b/pdp_freeframe/Makefile.config
new file mode 100644
index 0000000..2d0444b
--- /dev/null
+++ b/pdp_freeframe/Makefile.config
@@ -0,0 +1,25 @@
+# if configure can't find the m_pd.h header
+# specify pd's include path here and ignore the warning
+#
+FF_PLUGIN_DIR=/usr/lib/FreeFrame
+PD_CPPFLAGS=-I/usr/src/pd-0.40-2/src
+PDP_CFLAGS=-I/usr/src/pdp-0.12.5-test-7/include -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch -O2 -funroll-loops -fomit-frame-pointer -ffast-math -freg-struct-return -DLINUX
+
+prefix=/usr/local
+PDP_VERSION = 0.0.1
+PDP_TARGET = linux
+PDP_LIBRARY_NAME = pdp_freeframe.pd_linux
+
+PDP_CPPFLAGS = -I. -I/usr/X11R6/include -I../include -I../../include $(PD_CPPFLAGS)
+#--gstabs
+
+PDP_CFLAGS += -DPDP_VERSION=\"$(PDP_VERSION)\" -DFF_PLUGIN_DIR=\"$(FF_PLUGIN_DIR)\"
+
+CC = gcc
+
+# build rules
+
+.c.o:
+ $(CC) $(PDP_CFLAGS) $(PDP_CPPFLAGS) -o $*.o -c $*.c
+.s.o:
+ $(AS) -o $*.o $*.s $(PDP_AFLAGS)
diff --git a/pdp_freeframe/help_pdp_freeframe.pd b/pdp_freeframe/help_pdp_freeframe.pd
new file mode 100644
index 0000000..5eb6555
--- /dev/null
+++ b/pdp_freeframe/help_pdp_freeframe.pd
@@ -0,0 +1,206 @@
+#N canvas 0 0 996 665 10;
+#X obj 43 335 pdp_freeframe;
+#X floatatom 149 338 5 0 0 0 - - -;
+#X obj 46 115 pdp_qt;
+#X obj 46 45 metro 40;
+#X msg 46 -17 bang;
+#X msg 107 45 loop 1;
+#X obj 41 507 pdp_xv;
+#X obj 46 247 pdp_scale 320 240;
+#X obj 194 336 hradio 15 1 0 44 empty empty empty 0 -6 0 8 -262144
+-1 -1 0;
+#X obj 261 171 hsl 128 15 0 1 0 0 empty vparam3 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 401 171 hsl 128 15 0 1 0 0 empty vparam4 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 541 171 hsl 128 15 0 1 0 0 empty vparam5 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X msg 258 191 param 3 \$1;
+#X msg 398 190 param 4 \$1;
+#X msg 539 190 param 5 \$1;
+#X text 195 317 Select the plugin;
+#X text 258 72 Adjust plugin parameters.;
+#X msg 164 45 open \$1;
+#X obj 164 23 openpanel;
+#X text 95 -17 Load a mov file;
+#X symbolatom 96 488 20 0 0 0 - - -;
+#X text 249 488 <-- plugin name;
+#X floatatom 115 466 5 0 0 0 - - -;
+#X text 163 464 <-- number of parameters;
+#X obj 46 176 pdp_spigot;
+#X obj 119 148 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 89 215 pdp_scale 192 168;
+#X obj 241 47 pdp_v4l;
+#X obj 241 20 metro 40;
+#X msg 241 -8 bang;
+#X text 214 438 <-- parameter name;
+#X text 241 410 <-- parameter type;
+#X text 257 381 <-- parameter default;
+#X obj 263 112 hsl 128 15 0 1 0 0 empty vparam0 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 401 112 hsl 128 15 0 1 0 0 empty vparam1 empty -2 -6 0 8 -262144
+-1 -1 2391 1;
+#X obj 542 112 hsl 128 15 0 1 0 0 empty vparam2 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 261 234 hsl 128 15 0 1 0 0 empty vparam6 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 402 234 hsl 128 15 0 1 0 0 empty vparam7 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 544 234 hsl 128 15 0 1 0 0 empty vparam8 empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X msg 260 131 param 0 \$1;
+#X msg 398 131 param 1 \$1;
+#X msg 539 131 param 2 \$1;
+#X msg 260 254 param 6 \$1;
+#X msg 399 253 param 7 \$1;
+#X msg 541 253 param 8 \$1;
+#N canvas 0 0 996 665 pname 0;
+#X obj 51 119 l2s;
+#X obj 80 119 l2s;
+#X obj 111 119 l2s;
+#X obj 143 119 l2s;
+#X obj 207 120 l2s;
+#X obj 236 120 l2s;
+#X obj 267 120 l2s;
+#X obj 298 119 l2s;
+#X obj 97 86 route 0 1 2 3 4 5 6 7 8;
+#X obj 327 119 l2s;
+#X obj 97 51 inlet;
+#X obj 51 154 s ffparam0;
+#X obj 79 178 s ffparam1;
+#X obj 118 205 s ffparam2;
+#X obj 148 227 s ffparam3;
+#X obj 185 157 s ffparam4;
+#X obj 213 181 s ffparam5;
+#X obj 255 206 s ffparam6;
+#X obj 283 230 s ffparam7;
+#X obj 305 155 s ffparam8;
+#X obj 391 53 inlet;
+#X msg 390 79 symbol;
+#X connect 0 0 11 0;
+#X connect 1 0 12 0;
+#X connect 2 0 13 0;
+#X connect 3 0 14 0;
+#X connect 4 0 15 0;
+#X connect 5 0 16 0;
+#X connect 6 0 17 0;
+#X connect 7 0 18 0;
+#X connect 8 0 0 0;
+#X connect 8 1 1 0;
+#X connect 8 2 2 0;
+#X connect 8 3 3 0;
+#X connect 8 4 4 0;
+#X connect 8 5 5 0;
+#X connect 8 6 6 0;
+#X connect 8 7 7 0;
+#X connect 8 8 9 0;
+#X connect 9 0 19 0;
+#X connect 10 0 8 0;
+#X connect 20 0 21 0;
+#X connect 21 0 11 0;
+#X connect 21 0 12 0;
+#X connect 21 0 13 0;
+#X connect 21 0 14 0;
+#X connect 21 0 15 0;
+#X connect 21 0 16 0;
+#X connect 21 0 17 0;
+#X connect 21 0 18 0;
+#X connect 21 0 19 0;
+#X restore 146 438 pd pname;
+#X symbolatom 260 93 18 0 0 0 - ffparam0 -;
+#X symbolatom 399 92 18 0 0 0 - ffparam1 -;
+#X symbolatom 538 92 18 0 0 0 - ffparam2 -;
+#X symbolatom 261 154 18 0 0 0 - ffparam3 -;
+#X symbolatom 400 153 18 0 0 0 - ffparam4 -;
+#X symbolatom 539 153 18 0 0 0 - ffparam5 -;
+#X symbolatom 261 214 18 0 0 0 - ffparam6 -;
+#X symbolatom 400 213 18 0 0 0 - ffparam7 -;
+#X symbolatom 539 213 18 0 0 0 - ffparam8 -;
+#N canvas 0 0 996 665 default 0;
+#X obj 97 86 route 0 1 2 3 4 5 6 7 8;
+#X obj 97 51 inlet;
+#X obj 391 53 inlet;
+#X obj 51 154 s vparam0;
+#X obj 393 114 float 0;
+#X msg 392 88 bang;
+#X obj 79 178 s vparam1;
+#X obj 118 205 s vparam2;
+#X obj 148 227 s vparam3;
+#X obj 184 159 s vparam4;
+#X obj 213 181 s vparam5;
+#X obj 255 206 s vparam6;
+#X obj 283 230 s vparam7;
+#X obj 304 155 s vparam8;
+#X connect 0 0 3 0;
+#X connect 0 1 6 0;
+#X connect 0 2 7 0;
+#X connect 0 3 8 0;
+#X connect 0 4 9 0;
+#X connect 0 5 10 0;
+#X connect 0 6 11 0;
+#X connect 0 7 12 0;
+#X connect 0 8 13 0;
+#X connect 1 0 0 0;
+#X connect 2 0 5 0;
+#X connect 4 0 3 0;
+#X connect 4 0 6 0;
+#X connect 4 0 7 0;
+#X connect 4 0 8 0;
+#X connect 4 0 9 0;
+#X connect 4 0 10 0;
+#X connect 4 0 11 0;
+#X connect 4 0 12 0;
+#X connect 4 0 13 0;
+#X connect 5 0 4 0;
+#X restore 180 380 pd default;
+#X text 487 440 FreeFrame host for Pure Data Packet version 0.3;
+#X text 489 455 by Lluis Gomez i Bigorda (lluis@artefacte.org);
+#X text 508 468 & Yves Degoyon (ydegoyon@free.fr);
+#X text 489 483 using GPL code from http://freeframe.sf.net;
+#X text 489 498 and Pete Warden http://petewarden.com;
+#X obj 164 410 print type;
+#X connect 0 0 6 0;
+#X connect 0 1 20 0;
+#X connect 0 2 22 0;
+#X connect 0 3 45 0;
+#X connect 0 4 61 0;
+#X connect 0 5 55 0;
+#X connect 1 0 0 1;
+#X connect 2 0 24 0;
+#X connect 3 0 2 0;
+#X connect 4 0 3 0;
+#X connect 4 0 5 0;
+#X connect 4 0 18 0;
+#X connect 5 0 2 0;
+#X connect 7 0 0 0;
+#X connect 8 0 1 0;
+#X connect 9 0 12 0;
+#X connect 10 0 13 0;
+#X connect 11 0 14 0;
+#X connect 12 0 0 0;
+#X connect 13 0 0 0;
+#X connect 14 0 0 0;
+#X connect 17 0 2 0;
+#X connect 18 0 17 0;
+#X connect 22 0 45 1;
+#X connect 22 0 55 1;
+#X connect 24 0 7 0;
+#X connect 24 1 26 0;
+#X connect 25 0 24 1;
+#X connect 26 0 0 0;
+#X connect 27 0 24 0;
+#X connect 28 0 27 0;
+#X connect 29 0 28 0;
+#X connect 33 0 39 0;
+#X connect 34 0 40 0;
+#X connect 35 0 41 0;
+#X connect 36 0 42 0;
+#X connect 37 0 43 0;
+#X connect 38 0 44 0;
+#X connect 39 0 0 0;
+#X connect 40 0 0 0;
+#X connect 41 0 0 0;
+#X connect 42 0 0 0;
+#X connect 43 0 0 0;
+#X connect 44 0 0 0;
diff --git a/pdp_freeframe/pdp_freeframe.c b/pdp_freeframe/pdp_freeframe.c
new file mode 100644
index 0000000..7eaf1cc
--- /dev/null
+++ b/pdp_freeframe/pdp_freeframe.c
@@ -0,0 +1,461 @@
+/*
+ * Pure Data Packet module.
+ * Copyright (c) by Tom Schouten <pdp@zzz.kotnet.org>
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <limits.h>
+#include <dlfcn.h>
+
+#include "pdp.h"
+#include "FreeFrame.h"
+
+#define PLUGINDIR "plugins"
+#define FREEFRAME_PNAME_LENGTH 16
+#define FREEFRAME_ID_LENGTH 4
+#define FREEFRAME_PARAM_DETAILS_LENGTH 128
+
+#define FF_CAP_V_BITS_VIDEO FF_CAP_24BITVIDEO
+
+typedef struct
+{
+ char name[FREEFRAME_PNAME_LENGTH+1];
+ plugMainType *plugmain;
+ unsigned instance;
+ unsigned numparameters;
+} PLUGIN;
+
+typedef struct pdp_freeframe_struct
+{
+ t_object x_obj;
+ t_float x_f;
+
+ t_outlet *x_outlet0;
+ t_outlet *x_pname;
+ t_outlet *x_nparams;
+ t_outlet *x_parname;
+ t_outlet *x_partype;
+ t_outlet *x_pardefault;
+ int x_packet0;
+ int x_packet1;
+ int x_dropped;
+ int x_queue_id;
+
+ int x_width;
+ int x_height;
+ int x_size;
+
+ int x_plugin_count;
+ struct dirent **x_filename_list;
+ int x_filename_count;
+
+ int x_plugin;
+ int x_infosok;
+ char x_pdetails[FREEFRAME_PARAM_DETAILS_LENGTH];
+
+ PLUGIN *plugins;
+
+} t_pdp_freeframe;
+
+
+void panic(const char *panicstr, ...)
+{
+ post("pdp_freeframe :: PANIC!! %s\n", panicstr);
+ exit(1);
+}
+
+static int selector(const struct dirent *dp)
+{
+ return (strstr(dp->d_name, ".so") != NULL);
+}
+
+static void scan_plugins(t_pdp_freeframe *x, char *plugindir)
+{
+ x->x_filename_count = scandir(plugindir, &x->x_filename_list, selector, alphasort);
+ if (x->x_filename_count < 0)
+ x->x_filename_count = 0;
+}
+
+void ff_loadplugins(t_pdp_freeframe *x, char *plugindir)
+{
+ char libname[PATH_MAX];
+ plugMainType *plugmain;
+ unsigned instance, numparameters;
+ int i;
+ char *pluginname;
+ void *plugin_handle;
+
+ scan_plugins(x, plugindir);
+
+ x->x_plugin_count = 0;
+ x->plugins = (PLUGIN *)getbytes(x->x_filename_count*sizeof(PLUGIN));
+ if (x->plugins == NULL)
+ {
+ panic("no memory for loading plugins\n");
+ }
+ else
+ {
+ post( "allocated plugins : %x", x->plugins );
+ }
+
+ for (i=0; i<x->x_filename_count; i++)
+ {
+ pluginname = x->x_filename_list[i]->d_name;
+
+ snprintf(libname, PATH_MAX, "%s/%s", plugindir, pluginname);
+
+ plugin_handle = dlopen(libname, RTLD_NOW);
+ dlerror();
+ plugmain = (plugMainType *)(unsigned)dlsym(plugin_handle, "plugMain");
+ if (plugmain == NULL)
+ panic("plugin %s: %s", x->x_filename_list[i]->d_name, dlerror());
+
+ PlugInfoStruct *pis = (plugmain(FF_GETINFO, NULL, 0)).PISvalue;
+
+ if ((plugmain(FF_GETPLUGINCAPS, (LPVOID)FF_CAP_V_BITS_VIDEO, 0)).ivalue != FF_TRUE)
+ panic("plugin %s: no 24 bit support", pluginname);
+
+ if (pis->APIMajorVersion < 1)
+ panic("plugin %s: old api version", pluginname);
+
+ if ((plugmain(FF_INITIALISE, NULL, 0)).ivalue == FF_FAIL)
+ panic("plugin %s: init failed", pluginname);
+
+ VideoInfoStruct vidinfo;
+ vidinfo.frameWidth = x->x_width;
+ vidinfo.frameHeight = x->x_height;
+ vidinfo.orientation = 1;
+ vidinfo.bitDepth = FF_CAP_V_BITS_VIDEO;
+
+ instance = plugmain(FF_INSTANTIATE, &vidinfo, 0).ivalue;
+ if (instance == FF_FAIL)
+ panic("plugin %s: init failed", pluginname);
+
+ numparameters = plugmain(FF_GETNUMPARAMETERS, NULL, 0).ivalue;
+ if (numparameters == FF_FAIL)
+ panic("plugin %s: numparameters failed", pluginname);
+
+ x->plugins[x->x_plugin_count].plugmain = plugmain;
+
+ strncpy(x->plugins[x->x_plugin_count].name, (char *)(pis->pluginName), 16);
+ x->plugins[x->x_plugin_count].name[16] = 0;
+
+ x->plugins[x->x_plugin_count].instance = instance;
+ x->plugins[x->x_plugin_count].numparameters = numparameters;
+
+ post("%s [%s] is loaded", x->plugins[x->x_plugin_count].name, pluginname);
+ x->x_plugin_count++;
+ }
+}
+
+void ff_processframe(t_pdp_freeframe *x, int plugin, void *buffer)
+{
+ x->plugins[plugin].plugmain(FF_PROCESSFRAME, buffer, x->plugins[plugin].instance);
+}
+
+void ff_freeplugins(t_pdp_freeframe *x)
+{
+ t_int i;
+
+ for (i=0; i<x->x_plugin_count; i++)
+ {
+ plugMainType *plugmain = x->plugins[i].plugmain;
+
+ plugmain(FF_DEINITIALISE, NULL, 0);
+ plugmain(FF_DEINSTANTIATE, NULL, x->plugins[i].instance);
+ }
+ post("freeing plugin resources : %x", x->plugins);
+ freebytes( x->plugins, x->x_filename_count*sizeof(PLUGIN) );
+ x->plugins = NULL;
+}
+
+static void pdp_freeframe_process_rgb(t_pdp_freeframe *x)
+{
+ t_pdp *header = pdp_packet_header(x->x_packet0);
+ short int *data = (short int *)pdp_packet_data(x->x_packet0);
+ t_pdp *newheader = pdp_packet_header(x->x_packet1);
+ short int *newdata = (short int *)pdp_packet_data(x->x_packet1);
+
+ if ( x->x_plugin_count <= 0 )
+ {
+ return;
+ }
+
+ if ((x->x_width != (t_int)header->info.image.width) ||
+ (x->x_height != (t_int)header->info.image.height))
+ {
+
+ post("pdp_freeframe :: resizing plugins");
+
+ ff_freeplugins(x);
+
+ x->x_width = header->info.image.width;
+ x->x_height = header->info.image.height;
+ x->x_size = x->x_width*x->x_height;
+
+ //load the plugins
+ ff_loadplugins(x, FF_PLUGIN_DIR);
+ }
+
+ newheader->info.image.encoding = header->info.image.encoding;
+ newheader->info.image.width = x->x_width;
+ newheader->info.image.height = x->x_height;
+
+ memcpy( newdata, data, x->x_size*3 );
+
+ ff_processframe(x, x->x_plugin, newdata);
+
+ return;
+}
+
+static void pdp_freeframe_param(t_pdp_freeframe *x, t_floatarg f1, t_floatarg f2)
+{
+ int i=0;
+ plugMainType *plugmain = x->plugins[x->x_plugin].plugmain;
+ unsigned instance = x->plugins[x->x_plugin].instance;
+ unsigned numparameters = x->plugins[x->x_plugin].numparameters;
+
+ SetParameterStruct sps;
+
+ //for (i=0; i<numparameters; i++)
+ //{
+ //if (plugmain(FF_GETPARAMETERTYPE, (LPVOID)i, 0).ivalue == FF_TYPE_TEXT)
+ // continue;
+
+ //sps.value = plugmain(FF_GETPARAMETER, (LPVOID)i, instance).fvalue;
+
+ //post ("%d param.value %d", i, sps.value);
+
+ //if((f2<=1)&&(f2>=0))
+ sps.value = f2;
+ //sps.value += .01;
+ //if (sps.value > 1.0) sps.value = 1.0;
+ //else
+ //if (sps.value < 0.0) sps.value = 0.0;
+
+ sps.index = f1;
+ plugmain(FF_SETPARAMETER, &sps, instance);
+ //}
+}
+
+static void pdp_freeframe_plugin(t_pdp_freeframe *x, t_floatarg f)
+{
+ unsigned pi;
+ char *parname;
+ int partype;
+ float pardefault;
+ t_atom plist[2];
+ t_atom tlist[2];
+ t_atom vlist[2];
+
+ if ( x->x_plugin_count <= 0 )
+ {
+ post( "freeframe : no plugins loaded, check your plugin directory setup" );
+ return;
+ }
+ if((f<x->x_plugin_count)&&(f>-1))
+ {
+ x->x_plugin = f;
+ }
+ else
+ {
+ post( "freeframe : plugin out of range : %d", (t_int)f );
+ return;
+ }
+ post ("pdp_freeframe :: %s selected, %d parameters", x->plugins[x->x_plugin].name, x->plugins[x->x_plugin].numparameters);
+ outlet_symbol(x->x_pname, gensym( x->plugins[x->x_plugin].name ) );
+ outlet_float(x->x_nparams, (float)x->plugins[x->x_plugin].numparameters);
+ for ( pi=0; pi<x->plugins[x->x_plugin].numparameters; pi++ )
+ {
+ parname = (x->plugins[x->x_plugin].plugmain(FF_GETPARAMETERNAME, (LPVOID)pi, 0)).svalue;
+ SETFLOAT(&plist[0], pi);
+ SETSYMBOL(&plist[1], gensym(parname) );
+ outlet_list( x->x_parname, &s_list, 2, &plist[0] );
+ }
+ for ( pi=0; pi<x->plugins[x->x_plugin].numparameters; pi++ )
+ {
+ partype = (x->plugins[x->x_plugin].plugmain(FF_GETPARAMETERTYPE, (LPVOID)pi, 0)).ivalue;
+ SETFLOAT(&tlist[0], pi);
+ SETFLOAT(&tlist[1], partype );
+ outlet_list( x->x_partype, &s_list, 2, &tlist[0] );
+ if ( ( partype != FF_TYPE_TEXT ) && ( partype > 0 ) )
+ {
+ pardefault = (x->plugins[x->x_plugin].plugmain(FF_GETPARAMETERDEFAULT, (LPVOID)pi, 0)).fvalue;
+ SETFLOAT(&vlist[0], pi);
+ SETFLOAT(&vlist[1], pardefault );
+ outlet_list( x->x_pardefault, &s_list, 2, &vlist[0] );
+ }
+ }
+}
+
+static void pdp_freeframe_sendpacket(t_pdp_freeframe *x)
+{
+ /* release the packet */
+ pdp_packet_mark_unused(x->x_packet0);
+ x->x_packet0 = -1;
+
+ /* unregister and propagate if valid dest packet */
+ pdp_packet_pass_if_valid(x->x_outlet0, &x->x_packet1);
+}
+
+static void pdp_freeframe_process(t_pdp_freeframe *x)
+{
+ int encoding;
+ t_pdp *header = 0;
+ char *parname;
+ unsigned pi;
+ int partype;
+ float pardefault;
+ t_atom plist[2];
+ t_atom tlist[2];
+ t_atom vlist[2];
+
+ /* check if image data packets are compatible */
+ if ( (header = pdp_packet_header(x->x_packet0))
+ && (PDP_BITMAP == header->type)){
+
+ /* pdp_freeframe_process inputs and write into active inlet */
+ switch(pdp_packet_header(x->x_packet0)->info.image.encoding){
+
+ case PDP_BITMAP_RGB:
+ x->x_packet1 = pdp_packet_clone_rw(x->x_packet0);
+ pdp_queue_add(x, pdp_freeframe_process_rgb, pdp_freeframe_sendpacket, &x->x_queue_id);
+ break;
+
+ default:
+ /* don't know the type, so dont pdp_freeframe_process */
+ break;
+
+ }
+ }
+
+ // hack to display infos of first loaded plugin
+ if ( (x->x_plugin_count > 0) && (!x->x_infosok) )
+ {
+ x->x_infosok = 1;
+ outlet_symbol(x->x_pname, gensym( x->plugins[x->x_plugin].name ) );
+ outlet_float(x->x_nparams, (float)x->plugins[x->x_plugin].numparameters);
+ for ( pi=0; pi<x->plugins[x->x_plugin].numparameters; pi++ )
+ {
+ parname = (x->plugins[x->x_plugin].plugmain(FF_GETPARAMETERNAME, (LPVOID)pi, 0)).svalue;
+ SETFLOAT(&plist[0], pi);
+ SETSYMBOL(&plist[1], gensym(parname) );
+ outlet_list( x->x_parname, &s_list, 2, &plist[0] );
+ }
+ for ( pi=0; pi<x->plugins[x->x_plugin].numparameters; pi++ )
+ {
+ partype = (x->plugins[x->x_plugin].plugmain(FF_GETPARAMETERTYPE, (LPVOID)pi, 0)).ivalue;
+ SETFLOAT(&tlist[0], pi);
+ SETFLOAT(&tlist[1], partype );
+ outlet_list( x->x_partype, &s_list, 2, &tlist[0] );
+ if ( ( partype != FF_TYPE_TEXT ) && ( partype > 0 ) )
+ {
+ pardefault = (x->plugins[x->x_plugin].plugmain(FF_GETPARAMETERDEFAULT, (LPVOID)pi, 0)).fvalue;
+ SETFLOAT(&vlist[0], pi);
+ SETFLOAT(&vlist[1], pardefault );
+ outlet_list( x->x_pardefault, &s_list, 2, &vlist[0] );
+ }
+ }
+ }
+}
+
+static void pdp_freeframe_input_0(t_pdp_freeframe *x, t_symbol *s, t_floatarg f)
+{
+ /* if this is a register_ro message or register_rw message, register with packet factory */
+
+ if (s == gensym("register_rw"))
+ x->x_dropped = pdp_packet_convert_ro_or_drop(&x->x_packet0, (int)f, pdp_gensym("bitmap/rgb/*") );
+
+ if ((s == gensym("process")) && (-1 != x->x_packet0) && (!x->x_dropped))
+ {
+ /* add the process method and callback to the process queue */
+ pdp_freeframe_process(x);
+ }
+}
+
+static void pdp_freeframe_free(t_pdp_freeframe *x)
+{
+ int i;
+
+ pdp_queue_finish(x->x_queue_id);
+ pdp_packet_mark_unused(x->x_packet0);
+ ff_freeplugins(x);
+}
+
+t_class *pdp_freeframe_class;
+
+
+void *pdp_freeframe_new(t_floatarg f)
+{
+ int i;
+
+ t_pdp_freeframe *x = (t_pdp_freeframe *)pd_new(pdp_freeframe_class);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("plugin"));
+
+ x->x_outlet0 = outlet_new(&x->x_obj, &s_anything);
+ x->x_pname = outlet_new(&x->x_obj, &s_anything);
+ x->x_nparams = outlet_new(&x->x_obj, &s_anything);
+ x->x_parname = outlet_new(&x->x_obj, &s_anything);
+ x->x_partype = outlet_new(&x->x_obj, &s_anything);
+ x->x_pardefault = outlet_new(&x->x_obj, &s_anything);
+
+ x->x_packet0 = -1;
+ x->x_packet1 = -1;
+ x->x_queue_id = -1;
+
+ x->x_width = 320;
+ x->x_height = 240;
+ x->x_size = x->x_width * x->x_height;
+
+ //load the plugins
+ x->x_plugin_count = 0;
+ x->x_infosok = 0;
+ ff_loadplugins(x, FF_PLUGIN_DIR);
+
+ pdp_freeframe_plugin(x, f);
+
+ return (void *)x;
+}
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+void pdp_freeframe_setup(void)
+{
+
+ post( "pdp_freeframe :: FreeFrame host for Pure Data Packet version 0.3\n by Lluis Gomez i Bigorda (lluis@artefacte.org) \n & Yves Degoyon (ydegoyon@free.fr)\n using GPL code from http://freeframe.sf.net\n and Pete Warden http://petewarden.com" );
+ pdp_freeframe_class = class_new(gensym("pdp_freeframe"), (t_newmethod)pdp_freeframe_new,
+ (t_method)pdp_freeframe_free, sizeof(t_pdp_freeframe), 0, A_DEFFLOAT, A_NULL);
+
+ class_addmethod(pdp_freeframe_class, (t_method)pdp_freeframe_input_0, gensym("pdp"), A_SYMBOL, A_DEFFLOAT, A_NULL);
+ class_addmethod(pdp_freeframe_class, (t_method)pdp_freeframe_plugin, gensym("plugin"), A_FLOAT, A_NULL);
+ class_addmethod(pdp_freeframe_class, (t_method)pdp_freeframe_param, gensym("param"), A_FLOAT, A_FLOAT, A_NULL);
+
+
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/pdp_frei0r/CHANGES.LOG b/pdp_frei0r/CHANGES.LOG
new file mode 100755
index 0000000..a273448
--- /dev/null
+++ b/pdp_frei0r/CHANGES.LOG
@@ -0,0 +1,2 @@
+0.1
+ initial release
diff --git a/pdp_frei0r/INSTALL b/pdp_frei0r/INSTALL
new file mode 100644
index 0000000..551090b
--- /dev/null
+++ b/pdp_frei0r/INSTALL
@@ -0,0 +1,20 @@
+1. Download Frei0r specs and plugins, here: http://www.piksel.org/frei0r
+
+ darcs get http://darcs.gephex.org/frei0r/frei0r--main--1.1
+ cd to the frei0r-plugins-x.y.z directory
+ compile the plugins::
+ cd to plugins and type 'scons'
+ install the plugins::
+ type 'scons install'
+
+2. Download pdp_frei0r-0.1.tar.gz from http://www.artefacte.org/pd/pdp_frei0r-0.1.tar.gz
+
+ untar the pdp_frei0r-0.1.tar.gz file
+ cd in to the pdp_frei0r-0.1 directory
+
+ edit the Makefile.config file and change the path to the pd (m_pd.h), pdp (pdp.h) sources
+ and frei0r plugin directory (.so) if needed.
+
+ type 'make'
+
+ to load the pdp_frei0r help file type 'pd -nrt -lib pdp:pdp_frei0r help_pdp_frei0r.pd'
diff --git a/pdp_frei0r/Makefile b/pdp_frei0r/Makefile
new file mode 100644
index 0000000..30b81e0
--- /dev/null
+++ b/pdp_frei0r/Makefile
@@ -0,0 +1,14 @@
+current: all
+
+include Makefile.config
+
+PDP_MOD = pdp_frei0r.o
+
+all: $(PDP_MOD)
+ $(CC) -export_dynamic -shared -o pdp_frei0r.pd_linux *.o $(PDP_LIBS)
+
+clean:
+ rm -f *~
+ rm -f *.o
+ rm -f *.pd_linux
+
diff --git a/pdp_frei0r/Makefile.config b/pdp_frei0r/Makefile.config
new file mode 100644
index 0000000..cf89221
--- /dev/null
+++ b/pdp_frei0r/Makefile.config
@@ -0,0 +1,22 @@
+# if configure can't find the m_pd.h header
+# specify pd's include path here and ignore the warning
+#
+FR_PLUGIN_DIR=/usr/local/lib/frei0r-1/
+PD_CPPFLAGS=-I/usr/local/pd/src
+PDP_CFLAGS=-I/usr/local/pd/pdp/include -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch -O2 -funroll-loops -fomit-frame-pointer -ffast-math -freg-struct-return -DLINUX
+
+prefix=/usr/local
+PDPF_VERSION = 0.1
+PDPF_TARGET = linux
+PDPF_LIBRARY_NAME = pdp_frei0r.pd_linux
+
+PDP_CPPFLAGS = -I. -I/usr/X11R6/include -I../include -I../../include $(PD_CPPFLAGS)
+
+PDP_CFLAGS += -DPDPF_VERSION=\"$(PDPF_VERSION)\" -DFR_PLUGIN_DIR=\"$(FR_PLUGIN_DIR)\"
+
+CC = gcc
+
+# build rules
+
+.c.o:
+ $(CC) $(PDP_CFLAGS) $(PDP_CPPFLAGS) -o $*.o -c $*.c
diff --git a/pdp_frei0r/frei0r.h b/pdp_frei0r/frei0r.h
new file mode 100644
index 0000000..2e09113
--- /dev/null
+++ b/pdp_frei0r/frei0r.h
@@ -0,0 +1,567 @@
+/** @mainpage frei0r - a minimalistic plugin API for video effects
+ *
+ * @section sec_intro Introduction
+ *
+ * This is frei0r - a minimalistic plugin API for video effects.
+ *
+ * The main emphasis is on simplicity - there are many different applications
+ * that use video effects, and they all have different requirements regarding
+ * their internal plugin API. And that's why frei0r does not try to be a
+ * one-in-all general video plugin API, but instead an API for the most
+ * common video effects: simple filters, sources and mixers that can be
+ * controlled by parameters.
+ *
+ * It's our hope that this way these simple effects can be shared between
+ * many applications, avoiding their reimplementation by different
+ * projects.
+ *
+ * On the other hand, this is not meant as a competing standard to
+ * more ambitious efforts that try to satisfy the needs of many different
+ * applications and more complex effects.
+ *
+ *
+ * @section sec_overview Overview
+ *
+ * If you are new to frei0r, the best thing is probably to have
+ * a look at the <a href="frei0r_8h-source.html">frei0r header</a>,
+ * which is quite simple.
+ *
+ * After that, you might want to look at the
+ * <a href="frei0r_8h.html">frei0r functions</a> in more detail.
+ *
+ * When developing a new frei0r effect, you have to choose
+ * - which effect type to use (\ref PLUGIN_TYPE),
+ * - which color model to use (\ref COLOR_MODEL), and
+ * - which parameter types (\ref PARAM_TYPE) your effect will support.
+ *
+ * To round things up, you should decide whether your effect should have
+ * an associated icon (\ref icons), and where it will be installed
+ * (\ref pluglocations).
+ *
+ * @section sec_changes Changes
+ *
+ * @subsection sec_changes_1_0_1_1 From frei0r 1.0 to frei0r 1.1
+ *
+ * - added specifications for plugin locations
+ * - added specifications for frei0r icons
+ * - added RGBA8888 color model
+ * - added packed32 color model
+ * - added better specification of color models
+ * - added string type
+ * - added bounds to resolution (8 <= width, height <= 2048)
+ * - width and height must be an integer multiple of 8
+ * - frame data must be 16 byte aligned
+ * - improved update specification (must not change parameters,
+ * must restore fpu state)
+ * - added note for applications to ignore effects with unknown fields
+ * - added new plugin types mixer2 and mixer3
+ * - added section about \ref concurrency
+ */
+
+
+/**
+ * \addtogroup pluglocations Plugin Locations
+ * @section sec_pluglocations Plugin Locations
+ *
+ * For Unix platforms there are rules for the location of frei0r plugins.
+ *
+ * frei0r 1.x plugin files should be located in
+ *
+ * - (1) /usr/lib/frei0r-1/\<vendor\>
+ * - (2) /usr/local/lib/frei0r-1/\<vendor\>
+ * - (3) $HOME/.frei0r-1/lib/\<vendor\>
+ *
+ * Examples:
+ *
+ * - /usr/lib/frei0r-1/mob/flippo.so
+ * - /usr/lib/frei0r-1/drone/flippo.so
+ * - /usr/local/lib/frei0r-1/gephex/coma/invert0r.so
+ * - /home/martin/.frei0r-1/lib/martin/test.so
+ *
+ * Like in these examples plugins should be placed in "vendor" subdirs
+ * to reduce name clashes.
+ *
+ * @subsection sec_order Plugin Loading Order
+ *
+ * The application shall load plugins in the following order: 3, 2, 1.
+ * If a name clash occurs (two or more frei0r plugins with identical
+ * effect name), the plugins in directory 3 have precedence over plugins
+ * in directory 2, and those in directory 2 have precedence over plugins
+ * in directory 1.
+ *
+ * This makes it possible for users to "override" effects that are
+ * installed in system wide directories by placing plugins in their
+ * home directory.
+ *
+ * The order of loading plugins inside each of the directories
+ * 1, 2, and 3 is not defined.
+ */
+
+/**
+ *\addtogroup icons Icons for frei0r effects
+ * @section sec_icons Icons for frei0r effects
+ *
+ * Each frei0r effect can have an associated icon.
+ *
+ * @subsection sec_icon_format Icon Format
+ *
+ * The format of frei0r icons must be png.
+ * Recommended resolution is 64x64.
+ * The icon filename of an effect with effect name "frei0r"
+ * must be "frei0r.png".
+ *
+ * @subsection sec_icon_location Icon location
+ *
+ * The exact location where the application should look for the
+ * plugin is platform dependant.
+ *
+ * For Windows platforms, the icon should be at the same place as
+ * the plugin containing the effect.
+ *
+ * For Unix platforms, the following mapping from plugin location
+ * to icon location must be used:
+ *
+ * Let \<plugin_path\>/\<plugin\> be a frei0r plugin with name \<effect_name\>.
+ * Then the corresponding icon (if any) shall be located in
+ * \<icon_path\>/\<effect_name\>.png.
+ * \<icon_path\> can be obtained in the following way:
+ *
+ * @verbatim
+ <plugin_path> | <icon_path>
+ ----------------------------------------------------------------------------
+ $HOME/.frei0r-1/lib/<vendor> | $HOME/.frei0r-1/icons/<vendor>
+ /usr/local/lib/frei0r-1/<vendor> | /usr/local/share/frei0r-1/icons/<vendor>
+ /usr/lib/frei0r-1/<vendor> | /usr/share/frei0r-1/icons/<vendor>
+ * | <plugin_path>
+ @endverbatim
+ *
+ * (The wildcard '*' stands for any other plugin_path)
+ *
+ * For other platforms, no location is defined. We recommend to use the
+ * plugin path where possible.
+ */
+
+/**
+ * \addtogroup concurrency Concurrency
+ * @section sec_concurrency Concurrency
+ *
+ * - \ref f0r_init
+ * - \ref f0r_deinit
+ *
+ * These methods must not be called more than once. It is obvious that no
+ * concurrent calls are allowed.
+ *
+ *
+ * - \ref f0r_get_plugin_info
+ * - \ref f0r_get_param_info
+ * - \ref f0r_construct
+ * - \ref f0r_destruct
+ *
+ * Concurrent calls of these functions are allowed.
+ *
+ *
+ * - \ref f0r_set_param_value
+ * - \ref f0r_get_param_value
+ * - \ref f0r_update
+ * - \ref f0r_update2
+ *
+ * If a thread is in one of these methods its allowed for another thread to
+ * enter one of theses methods for a different effect instance. But for one
+ * effect instance only one thread is allowed to execute any of these methods.
+ */
+
+
+
+/** \file
+ * \brief This file defines the frei0r api, version 1.1.
+ *
+ * A conforming plugin must implement and export all functions declared in
+ * this header.
+ *
+ * A conforming application must accept only those plugins which use
+ * allowed values for the described fields.
+ */
+
+#ifndef INCLUDED_FREI0R_H
+#define INCLUDED_FREI0R_H
+
+#include <inttypes.h>
+
+/**
+ * The frei0r API major version
+ */
+#define FREI0R_MAJOR_VERSION 1
+
+/**
+ * The frei0r API minor version
+ */
+#define FREI0R_MINOR_VERSION 1
+
+//---------------------------------------------------------------------------
+
+/**
+ * f0r_init() is called once when the plugin is loaded by the application.
+ * \see f0r_deinit
+ */
+int f0r_init(void);
+
+/**
+ * f0r_deinit is called once when the plugin is unloaded by the application.
+ * \see f0r_init
+ */
+void f0r_deinit(void);
+
+//---------------------------------------------------------------------------
+
+/** \addtogroup PLUGIN_TYPE Type of the Plugin
+ * These defines determine whether the plugin is a
+ * source, a filter or one of the two mixer types
+ * @{
+ */
+
+/** one input and one output */
+#define F0R_PLUGIN_TYPE_FILTER 0
+/** just one output */
+#define F0R_PLUGIN_TYPE_SOURCE 1
+/** two inputs and one output */
+#define F0R_PLUGIN_TYPE_MIXER2 2
+/** three inputs and one output */
+#define F0R_PLUGIN_TYPE_MIXER3 3
+
+/** @} */
+
+//---------------------------------------------------------------------------
+
+/** \addtogroup COLOR_MODEL Color Models
+ * List of supported color models.
+ *
+ * Note: the color models are endian independent, because the
+ * color components are defined by their positon in memory, not
+ * by their significance in an uint32_t value.
+ *
+ * For effects that work on the color components,
+ * RGBA8888 is the recommended color model for frei0r-1.1 effects.
+ * For effects that only work on pixels, PACKED32 is the recommended
+ * color model since it helps the application to avoid unnecessary
+ * color conversions.
+ *
+ * Effects can choose an appropriate color model, applications must support
+ * all color models and do conversions if necessary. Source effects
+ * must not use the PACKED32 color model because the application must know
+ * in which color model the created framebuffers are represented.
+ *
+ * For each color model, a frame consists of width*height pixels which
+ * are stored row-wise and consecutively in memory. The size of a pixel is
+ * 4 bytes. There is no extra pitch parameter
+ * (i.e. the pitch is simply width*4).
+ *
+ * The following additional constraints must be honored:
+ * - The top-most line of a frame is stored first in memory.
+ * - A frame must be aligned to a 16 byte border in memory.
+ * - The width and height of a frame must be positive
+ * - The width and height of a frame must be integer multiples of 8
+ *
+ * These constraints make sure that each line is stored at an address aligned
+ * to 16 byte.
+ */
+/*@{*/
+/**
+ * In BGRA8888, each pixel is represented by 4 consecutive
+ * unsigned bytes, where the first byte value represents
+ * the blue, the second the green, and the third the red color
+ * component of the pixel. The last value represents the
+ * alpha value.
+ */
+#define F0R_COLOR_MODEL_BGRA8888 0
+
+/**
+ * In RGBA8888, each pixel is represented by 4 consecutive
+ * unsigned bytes, where the first byte value represents
+ * the red, the second the green, and the third the blue color
+ * component of the pixel. The last value represents the
+ * alpha value.
+ */
+#define F0R_COLOR_MODEL_RGBA8888 1
+
+/**
+ * In PACKED32, each pixel is represented by 4 consecutive
+ * bytes, but it is not defined how the color componets are
+ * stored. The true color format could be RGBA8888,
+ * BGRA8888, a packed 32 bit YUV format, or any other
+ * color format that stores pixels in 32 bit.
+ *
+ * This is useful for effects that don't work on color but
+ * only on pixels (for example a mirror effect).
+ *
+ * Note that source effects must not use this color model.
+ */
+#define F0R_COLOR_MODEL_PACKED32 2
+/*@}*/
+
+/**
+ * The f0r_plugin_info_t structure is filled in by the plugin
+ * to tell the application about its name, type, number of parameters,
+ * and version.
+ *
+ * An application should ignore (i.e. not use) frei0r effects that
+ * have unknown values in the plugin_type or color_model field.
+ * It should also ignore effects with a too high frei0r_version.
+ *
+ * This is necessary to be able to extend the frei0r spec (e.g.
+ * by adding new color models or plugin types) in a way that does not
+ * result in crashes when loading effects that make use of these
+ * extensions into an older application.
+ *
+ * All strings are unicode, 0-terminated, and the encoding is utf-8.
+ */
+typedef struct f0r_plugin_info
+{
+ const char* name; /**< The (short) name of the plugin */
+ const char* author; /**< The plugin author */
+ /** The plugin type
+ * \see PLUGIN_TYPE
+ */
+ int plugin_type;
+ int color_model; /**< The color model used */
+ int frei0r_version; /**< The frei0r major version this plugin is built for*/
+ int major_version; /**< The major version of the plugin */
+ int minor_version; /**< The minor version of the plugin */
+ int num_params; /**< The number of parameters of the plugin */
+ const char* explanation; /**< An optional explanation string */
+} f0r_plugin_info_t;
+
+
+/**
+ * Is called once after init. The plugin has to fill in the values in info.
+ *
+ * \param info Pointer to an info struct allocated by the application.
+ */
+void f0r_get_plugin_info(f0r_plugin_info_t* info);
+
+//---------------------------------------------------------------------------
+
+/** \addtogroup PARAM_TYPE Parameter Types
+ *
+ * @{
+ */
+
+
+/**
+ * Parameter type for boolean values
+ * \see f0r_param_bool
+ */
+#define F0R_PARAM_BOOL 0
+
+/**
+ * Parameter type for doubles
+ * \see f0r_param_double
+ */
+#define F0R_PARAM_DOUBLE 1
+
+/**
+ * Parameter type for color
+ * \see f0r_param_color
+ */
+#define F0R_PARAM_COLOR 2
+/**
+ * Parameter type for position
+ * \see f0r_param_position
+ */
+#define F0R_PARAM_POSITION 3
+
+/**
+ * Parameter type for string
+ * \see f0r_param_string
+ */
+#define F0R_PARAM_STRING 4
+
+/**
+ * The boolean type. The allowed range of values is [0, 1].
+ * [0, 0.5[ is mapped to false and [0.5, 1] is mapped to true.
+ */
+typedef double f0r_param_bool;
+
+/**
+ * The double type. The allowed range of values is [0, 1].
+ */
+typedef double f0r_param_double;
+
+/**
+ * The color type. All three color components are in the range [0, 1].
+ */
+typedef struct f0r_param_color
+{
+ float r; /**< red color component */
+ float g; /**< green color component */
+ float b; /**< blue color component */
+} f0r_param_color_t;
+
+/**
+ * The position type. Both position coordinates are in the range [0, 1].
+ */
+typedef struct f0r_param_position
+{
+ double x; /**< x coordinate */
+ double y; /**< y coordinate */
+} f0r_param_position_t;
+
+
+/**
+ * The string type.
+ * Zero terminated array of 8-bit values in utf-8 encoding
+ */
+typedef char f0r_param_string;
+
+/** @} */
+
+
+/**
+ * Similar to f0r_plugin_info_t, this structure is filled by the plugin
+ * for every parameter.
+ *
+ * All strings are unicode, 0-terminated, and the encoding is utf-8.
+ */
+typedef struct f0r_param_info
+{
+ const char* name; /**<The (short) name of the param */
+ int type; /**<The type (see the F0R_PARAM_* defines) */
+ const char* explanation; /**<Optional explanation (can be 0) */
+} f0r_param_info_t;
+
+/**
+ * f0r_get_param_info is called by the application to query the type of
+ * each parameter.
+ *
+ * \param info is allocated by the application and filled by the plugin
+ * \param param_index the index of the parameter to be queried (from 0 to
+ * num_params-1)
+ */
+void f0r_get_param_info(f0r_param_info_t* info, int param_index);
+
+//---------------------------------------------------------------------------
+
+/**
+ * Transparent instance pointer of the frei0r effect.
+ */
+typedef void* f0r_instance_t;
+
+/**
+ * Constructor for effect instances. The plugin returns a pointer to
+ * its internal instance structure.
+ *
+ * The resolution has to be an integer multiple of 8,
+ * must be greater than 0 and be at most 2048 in both dimensions.
+ *
+ * \param width The x-resolution of the processed video frames
+ * \param height The y-resolution of the processed video frames
+ * \returns 0 on failure or a pointer != 0 on success
+ *
+ * \see f0r_destruct
+ */
+f0r_instance_t f0r_construct(unsigned int width, unsigned int height);
+
+/**
+ * Destroys an effect instance.
+ *
+ * \param instance The pointer to the plugins internal instance structure.
+ *
+ * \see f0r_construct
+ */
+void f0r_destruct(f0r_instance_t instance);
+
+//---------------------------------------------------------------------------
+
+/**
+ * Transparent parameter handle.
+ */
+typedef void* f0r_param_t;
+
+/**
+ * This function allows the application to set the parameter values of an
+ * effect instance. Validity of the parameter pointer is handled by the
+ * application thus the data must be copied by the effect.
+ *
+ * \param instance the effect instance
+ * \param param pointer to the parameter value
+ * \param param_index index of the parameter
+ *
+ * \see f0r_get_param_value
+ */
+void f0r_set_param_value(f0r_instance_t instance,
+ f0r_param_t param, int param_index);
+
+/**
+ * This function allows the application to query the parameter values of an
+ * effect instance.
+ *
+ * \param instance the effect instance
+ * \param param pointer to the parameter value
+ * \param param_index index of the parameter
+ *
+ * \see f0r_set_param_value
+ */
+void f0r_get_param_value(f0r_instance_t instance,
+ f0r_param_t param, int param_index);
+
+//---------------------------------------------------------------------------
+
+/**
+ * This is where the core effect processing happens. The application calls it
+ * after it has set the necessary parameter values.
+ * inframe and outframe must be aligned to an integer multiple of 16 bytes
+ * in memory.
+ *
+ * This funcition should not alter the parameters of the effect in any
+ * way (\ref f0r_get_param_value should return the same values after a call
+ * to \ref f0r_update as before the call).
+ *
+ * The function is responsible to restore the fpu state (e.g. rounding mode)
+ * and mmx state if applicable before it returns to the caller.
+ *
+ * The host mustn't call \ref f0r_update for effects of type
+ * \ref F0R_PLUGIN_TYPE_MIXER2 and \ref F0R_PLUGIN_TYPE_MIXER3.
+ *
+ * \param instance the effect instance
+ * \param time the application time in seconds but with subsecond resolution
+ * (e.g. milli-second resolution). The resolution should be at least
+ * the inter-frame period of the application.
+ * \param inframe the incoming video frame (can be zero for sources)
+ * \param outframe the resulting video frame
+ *
+ * \see f0r_update2
+ */
+void f0r_update(f0r_instance_t instance,
+ double time, const uint32_t* inframe, uint32_t* outframe);
+
+//---------------------------------------------------------------------------
+
+/**
+ * For effects of type \ref F0R_PLUGIN_TYPE_SOURCE or
+ * \ref F0R_PLUGIN_TYPE_FILTER this method is optional. The \ref f0r_update
+ * method must still be exported for these two effect types. If both are
+ * provided the behavior of them must be the same.
+ *
+ * Effects of type \ref F0R_PLUGIN_TYPE_MIXER2 or \ref F0R_PLUGIN_TYPE_MIXER3 must provide the new \ref f0r_update2 method.
+
+ * \param instance the effect instance
+ * \param time the application time in seconds but with subsecond resolution
+ * (e.g. milli-second resolution). The resolution should be at least
+ * the inter-frame period of the application.
+ * \param inframe1 the first incoming video frame (can be zero for sources)
+ * \param inframe2 the second incoming video frame
+ (can be zero for sources and filters)
+ * \param inframe3 the third incoming video frame
+ (can be zero for sources, filters and mixer3)
+ * \param outframe the resulting video frame
+ *
+ * \see f0r_update
+ */
+void f0r_update2(f0r_instance_t instance,
+ double time,
+ const uint32_t* inframe1,
+ const uint32_t* inframe2,
+ const uint32_t* inframe3,
+ uint32_t* outframe);
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/pdp_frei0r/help_pdp_frei0r.pd b/pdp_frei0r/help_pdp_frei0r.pd
new file mode 100644
index 0000000..0898526
--- /dev/null
+++ b/pdp_frei0r/help_pdp_frei0r.pd
@@ -0,0 +1,328 @@
+#N canvas 0 0 996 665 10;
+#X floatatom 151 379 5 0 0 0 - - -;
+#X obj 196 377 hradio 15 1 0 49 empty empty empty 0 -6 0 8 -262144
+-1 -1 16;
+#X obj 261 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 401 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 541 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X msg 258 191 param 3 \$1;
+#X msg 398 190 param 4 \$1;
+#X msg 539 190 param 5 \$1;
+#X text 197 358 Select the plugin;
+#X text 258 72 Adjust plugin parameters.;
+#X symbolatom 87 501 20 0 0 0 - - -;
+#X text 240 501 <-- plugin name;
+#X floatatom 106 479 5 0 0 0 - - -;
+#X text 154 477 <-- number of parameters;
+#X text 205 451 <-- parameter name;
+#X text 232 423 <-- parameter type;
+#X obj 263 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 3200 1;
+#X obj 401 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 4100 1;
+#X obj 542 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 261 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 402 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 544 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X msg 260 131 param 0 \$1;
+#X msg 398 131 param 1 \$1;
+#X msg 539 131 param 2 \$1;
+#X msg 260 254 param 6 \$1;
+#X msg 399 253 param 7 \$1;
+#X msg 541 253 param 8 \$1;
+#N canvas 0 0 996 665 pname 0;
+#X obj 51 119 l2s;
+#X obj 80 119 l2s;
+#X obj 111 119 l2s;
+#X obj 143 119 l2s;
+#X obj 207 120 l2s;
+#X obj 236 120 l2s;
+#X obj 267 120 l2s;
+#X obj 298 119 l2s;
+#X obj 327 119 l2s;
+#X obj 97 51 inlet;
+#X obj 51 154 s ffparam0;
+#X obj 79 178 s ffparam1;
+#X obj 118 205 s ffparam2;
+#X obj 148 227 s ffparam3;
+#X obj 185 157 s ffparam4;
+#X obj 213 181 s ffparam5;
+#X obj 255 206 s ffparam6;
+#X obj 283 230 s ffparam7;
+#X obj 305 155 s ffparam8;
+#X obj 391 53 inlet;
+#X msg 390 79 symbol;
+#X obj 359 118 l2s;
+#X obj 391 118 l2s;
+#X obj 97 79 route 0 1 2 3 4 5 6 7 8 9 10;
+#X obj 357 178 s ffparam9;
+#X obj 414 202 s ffparam10;
+#X connect 0 0 10 0;
+#X connect 1 0 11 0;
+#X connect 2 0 12 0;
+#X connect 3 0 13 0;
+#X connect 4 0 14 0;
+#X connect 5 0 15 0;
+#X connect 6 0 16 0;
+#X connect 7 0 17 0;
+#X connect 8 0 18 0;
+#X connect 9 0 23 0;
+#X connect 19 0 20 0;
+#X connect 20 0 10 0;
+#X connect 20 0 11 0;
+#X connect 20 0 12 0;
+#X connect 20 0 13 0;
+#X connect 20 0 14 0;
+#X connect 20 0 15 0;
+#X connect 20 0 16 0;
+#X connect 20 0 17 0;
+#X connect 20 0 18 0;
+#X connect 20 0 24 0;
+#X connect 20 0 25 0;
+#X connect 21 0 24 0;
+#X connect 22 0 25 0;
+#X connect 23 0 0 0;
+#X connect 23 1 1 0;
+#X connect 23 2 2 0;
+#X connect 23 3 3 0;
+#X connect 23 4 4 0;
+#X connect 23 5 5 0;
+#X connect 23 6 6 0;
+#X connect 23 7 7 0;
+#X connect 23 8 8 0;
+#X connect 23 9 21 0;
+#X connect 23 10 22 0;
+#X restore 137 451 pd pname;
+#X symbolatom 260 93 18 0 0 0 - ffparam0 -;
+#X symbolatom 399 92 18 0 0 0 - ffparam1 -;
+#X symbolatom 538 92 18 0 0 0 - ffparam2 -;
+#X symbolatom 261 154 18 0 0 0 - ffparam3 -;
+#X symbolatom 400 153 18 0 0 0 - ffparam4 -;
+#X symbolatom 539 153 18 0 0 0 - ffparam5 -;
+#X symbolatom 261 214 18 0 0 0 - ffparam6 -;
+#X symbolatom 400 213 18 0 0 0 - ffparam7 -;
+#X symbolatom 539 213 18 0 0 0 - ffparam8 -;
+#X text 489 424 frei0r host for Pure Data Packet version 0.1;
+#X text 491 439 by Lluis Gomez i Bigorda (lluis@artefacte.org);
+#X text 510 452 & Yves Degoyon (ydegoyon@free.fr);
+#X text 491 495 made at piksel yearly gathering : http://www.piksel.no
+;
+#X obj 155 423 print type;
+#X text 491 467 using frei0r specification 1.1 by Georg Seidel \, Phillip
+Promesberger and Martin Bayer;
+#X obj 261 304 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 404 304 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X symbolatom 261 283 18 0 0 0 - ffparam9 -;
+#X symbolatom 400 283 18 0 0 0 - ffparam10 -;
+#X msg 259 323 param 9 \$1;
+#X msg 401 323 param 10 \$1;
+#X obj 46 545 pdp_xv;
+#N canvas 222 59 450 300 input1 0;
+#X obj 49 181 pdp_qt;
+#X msg 49 49 bang;
+#X msg 110 111 loop 1;
+#X obj 50 214 pdp_scale 320 240;
+#X msg 167 111 open \$1;
+#X obj 167 89 openpanel;
+#X text 98 49 Load a mov file;
+#X obj 244 113 pdp_v4l;
+#X msg 244 58 bang;
+#X obj 49 250 outlet;
+#X obj 49 5 inlet;
+#X obj 251 7 inlet;
+#X obj 247 33 route 0;
+#X msg 298 59 stop;
+#X obj 50 28 route 0;
+#X msg 14 79 stop;
+#X obj 49 111 metro 80;
+#X obj 244 86 metro 80;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 1 0 16 0;
+#X connect 2 0 0 0;
+#X connect 3 0 9 0;
+#X connect 4 0 0 0;
+#X connect 5 0 4 0;
+#X connect 7 0 3 0;
+#X connect 8 0 17 0;
+#X connect 10 0 14 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 12 1 8 0;
+#X connect 13 0 17 0;
+#X connect 14 0 15 0;
+#X connect 14 1 1 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X connect 17 0 7 0;
+#X restore 44 44 pd input1;
+#X text 49 24 .mov;
+#X text 115 24 cam;
+#X obj 102 10 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
+;
+#X obj 44 10 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X text 85 89 .mov;
+#X text 151 89 cam;
+#X obj 138 75 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 80 75 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
+;
+#N canvas 222 59 450 300 input2 0;
+#X obj 49 181 pdp_qt;
+#X msg 49 49 bang;
+#X msg 110 111 loop 1;
+#X obj 50 214 pdp_scale 320 240;
+#X msg 167 111 open \$1;
+#X obj 167 89 openpanel;
+#X text 98 49 Load a mov file;
+#X obj 244 113 pdp_v4l;
+#X msg 244 58 bang;
+#X obj 49 250 outlet;
+#X obj 49 5 inlet;
+#X obj 251 7 inlet;
+#X obj 247 33 route 0;
+#X msg 298 59 stop;
+#X obj 50 28 route 0;
+#X msg 14 79 stop;
+#X obj 49 111 metro 80;
+#X obj 244 86 metro 80;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 1 0 16 0;
+#X connect 2 0 0 0;
+#X connect 3 0 9 0;
+#X connect 4 0 0 0;
+#X connect 5 0 4 0;
+#X connect 7 0 3 0;
+#X connect 8 0 17 0;
+#X connect 10 0 14 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 12 1 8 0;
+#X connect 13 0 17 0;
+#X connect 14 0 15 0;
+#X connect 14 1 1 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X connect 17 0 7 0;
+#X restore 80 109 pd input2;
+#X text 116 148 .mov;
+#X text 182 148 cam;
+#X obj 169 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 111 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#N canvas 222 59 450 300 input3 0;
+#X obj 49 181 pdp_qt;
+#X msg 49 49 bang;
+#X msg 110 111 loop 1;
+#X obj 50 214 pdp_scale 320 240;
+#X msg 167 111 open \$1;
+#X obj 167 89 openpanel;
+#X text 98 49 Load a mov file;
+#X obj 244 113 pdp_v4l;
+#X msg 244 58 bang;
+#X obj 49 250 outlet;
+#X obj 49 5 inlet;
+#X obj 251 7 inlet;
+#X obj 247 33 route 0;
+#X msg 298 59 stop;
+#X obj 50 28 route 0;
+#X msg 14 79 stop;
+#X obj 49 111 metro 80;
+#X obj 244 86 metro 80;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 1 0 16 0;
+#X connect 2 0 0 0;
+#X connect 3 0 9 0;
+#X connect 4 0 0 0;
+#X connect 5 0 4 0;
+#X connect 7 0 3 0;
+#X connect 8 0 17 0;
+#X connect 10 0 14 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 12 1 8 0;
+#X connect 13 0 17 0;
+#X connect 14 0 15 0;
+#X connect 14 1 1 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X connect 17 0 7 0;
+#X restore 111 168 pd input3;
+#X obj 43 202 pdp_scale 320 240;
+#X obj 69 232 pdp_scale 320 240;
+#X obj 93 262 pdp_scale 320 240;
+#X obj 905 409 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 905 461 pdp_control;
+#X msg 905 434 thread \$1;
+#X floatatom 905 522 5 0 0 0 - - -;
+#X obj 905 493 route pdp_drop;
+#X text 498 547 constructor : pdp_frei0r <index>;
+#X obj 46 376 pdp_frei0r 16;
+#X text 499 562 you can get the index from the list of loaded plugins
+;
+#X text 498 575 at startup ( check pd window );
+#X text 13 290 WARNING : sizes of inputs;
+#X text 12 302 _must_ be the same;
+#X connect 0 0 75 3;
+#X connect 1 0 0 0;
+#X connect 2 0 5 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 75 0;
+#X connect 6 0 75 0;
+#X connect 7 0 75 0;
+#X connect 12 0 28 1;
+#X connect 16 0 22 0;
+#X connect 17 0 23 0;
+#X connect 18 0 24 0;
+#X connect 19 0 25 0;
+#X connect 20 0 26 0;
+#X connect 21 0 27 0;
+#X connect 22 0 75 0;
+#X connect 23 0 75 0;
+#X connect 24 0 75 0;
+#X connect 25 0 75 0;
+#X connect 26 0 75 0;
+#X connect 27 0 75 0;
+#X connect 44 0 48 0;
+#X connect 45 0 49 0;
+#X connect 48 0 75 0;
+#X connect 49 0 75 0;
+#X connect 51 0 66 0;
+#X connect 54 0 51 1;
+#X connect 55 0 51 0;
+#X connect 58 0 60 1;
+#X connect 59 0 60 0;
+#X connect 60 0 67 0;
+#X connect 63 0 65 1;
+#X connect 64 0 65 0;
+#X connect 65 0 68 0;
+#X connect 66 0 75 0;
+#X connect 67 0 75 1;
+#X connect 68 0 75 2;
+#X connect 69 0 71 0;
+#X connect 70 0 73 0;
+#X connect 71 0 70 0;
+#X connect 73 0 72 0;
+#X connect 75 0 50 0;
+#X connect 75 1 10 0;
+#X connect 75 2 12 0;
+#X connect 75 3 28 0;
+#X connect 75 4 42 0;
diff --git a/pdp_frei0r/pdp_frei0r.c b/pdp_frei0r/pdp_frei0r.c
new file mode 100644
index 0000000..3a66147
--- /dev/null
+++ b/pdp_frei0r/pdp_frei0r.c
@@ -0,0 +1,637 @@
+/*
+ * Pure Data Packet module.
+ * Copyright (c) by Tom Schouten <pdp@zzz.kotnet.org>
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <limits.h>
+#include <dlfcn.h>
+
+#include "pdp.h"
+#include "frei0r.h"
+
+#define FREI0R_PNAME_LENGTH 128
+
+typedef struct
+{
+ char name[FREI0R_PNAME_LENGTH+1];
+ unsigned numparameters;
+ int plugin_type;
+ f0r_instance_t instance;
+ f0r_plugin_info_t plugin_info;
+ int (*f0r_init)(void);
+ void (*f0r_get_plugin_info)(f0r_plugin_info_t* pluginInfo);
+ void (*f0r_get_param_info)(f0r_param_info_t* info, int param_index);
+ f0r_instance_t (*f0r_construct)(unsigned int width, unsigned int height);
+ void (*f0r_destruct)(f0r_instance_t instance);
+ void (*f0r_set_param_value)(f0r_instance_t instance, f0r_param_t param, int param_index);
+ void (*f0r_get_param_value)(f0r_instance_t instance, f0r_param_t param, int param_index);
+ void (*f0r_update)(f0r_instance_t instance, double time, const uint32_t* inframe, uint32_t* outframe);
+ void (*f0r_update2)(f0r_instance_t instance, double time,
+ const uint32_t* inframe1, const uint32_t* inframe2, const uint32_t* inframe3, uint32_t* outframe);
+ int (*f0r_deinit)(void);
+} PLUGIN;
+
+typedef struct pdp_frei0r_struct
+{
+ t_object x_obj;
+ t_float x_f;
+
+ t_outlet *x_outlet0;
+ t_outlet *x_pname;
+ t_outlet *x_nparams;
+ t_outlet *x_parname;
+ t_outlet *x_partype;
+ int x_packet0;
+ int x_packet1;
+ int x_packet2;
+ int x_packet3;
+
+ // middle input packets
+ int x_packetm0;
+ int x_packetm1;
+
+ // right input packets
+ int x_packetr0;
+ int x_packetr1;
+
+ int x_dropped;
+ int x_queue_id;
+
+ int x_width;
+ int x_height;
+ int x_size;
+
+ int x_plugin_count;
+ struct dirent **x_filename_list;
+ int x_filename_count;
+
+ int x_plugin;
+ int x_infosok;
+
+ PLUGIN *plugins;
+
+} t_pdp_frei0r;
+
+void panic(const char *panicstr, ...)
+{
+ post("pdp_frei0r :: PANIC!! %s\n", panicstr);
+ exit(1);
+}
+
+static int selector(const struct dirent *dp)
+{
+ return (strstr(dp->d_name, ".so") != NULL);
+}
+
+static void scan_plugins(t_pdp_frei0r *x, char *plugindir)
+{
+ x->x_filename_count = scandir(plugindir, &x->x_filename_list, selector, alphasort);
+ if (x->x_filename_count < 0)
+ {
+ x->x_filename_count = 0;
+ }
+}
+
+void fr_loadplugins(t_pdp_frei0r *x, char *plugindir)
+{
+ char libname[PATH_MAX];
+ unsigned instance, numparameters;
+ int i;
+ char *pluginname;
+ void *plugin_handle;
+
+ scan_plugins(x, plugindir);
+
+ x->x_plugin_count = 0;
+ x->plugins = (PLUGIN *)getbytes(x->x_filename_count*sizeof(PLUGIN));
+ if (x->plugins == NULL)
+ {
+ panic("no memory for loading plugins\n");
+ }
+ else
+ {
+ post( "allocated plugins : %x", x->plugins );
+ }
+
+ for (i=0; i<x->x_filename_count; i++)
+ {
+ pluginname = x->x_filename_list[i]->d_name;
+
+ snprintf(libname, PATH_MAX, "%s/%s", plugindir, pluginname);
+
+ post( "pdp_frei0r : opening : %s", pluginname );
+
+ plugin_handle = dlopen(libname, RTLD_NOW);
+ dlerror();
+
+ // get functions pointers
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_init) = dlsym(plugin_handle, "f0r_init");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_get_plugin_info) = dlsym(plugin_handle, "f0r_get_plugin_info");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_get_param_info) = dlsym(plugin_handle, "f0r_get_param_info");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_construct) = dlsym(plugin_handle, "f0r_construct");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_destruct) = dlsym(plugin_handle, "f0r_destruct");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_set_param_value) = dlsym(plugin_handle, "f0r_set_param_value");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_get_param_value) = dlsym(plugin_handle, "f0r_get_param_value");
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_update) = dlsym(plugin_handle, "f0r_update");
+ dlerror();
+
+ // check for special function update2
+ *(void**) (&x->plugins[x->x_plugin_count].f0r_update2) = dlsym(plugin_handle, "f0r_update2");
+ if (!dlerror())
+ {
+ // continue;
+ }
+
+ // init plugin
+ (*x->plugins[x->x_plugin_count].f0r_init)();
+
+ // instantiate
+ x->plugins[x->x_plugin_count].instance = (*x->plugins[x->x_plugin_count].f0r_construct)(x->x_width, x->x_height);
+
+ // get plugin infos
+ (*x->plugins[x->x_plugin_count].f0r_get_plugin_info)(&x->plugins[x->x_plugin_count].plugin_info);
+ strcpy( x->plugins[x->x_plugin_count].name, x->plugins[x->x_plugin_count].plugin_info.name );
+ x->plugins[x->x_plugin_count].numparameters=x->plugins[x->x_plugin_count].plugin_info.num_params;
+ x->plugins[x->x_plugin_count].plugin_type=x->plugins[x->x_plugin_count].plugin_info.plugin_type;
+
+ if ( ( x->plugins[x->x_plugin_count].plugin_info.color_model != F0R_COLOR_MODEL_RGBA8888 ) &&
+ ( x->plugins[x->x_plugin_count].plugin_info.color_model != F0R_COLOR_MODEL_BGRA8888 ) &&
+ ( x->plugins[x->x_plugin_count].plugin_info.color_model != F0R_COLOR_MODEL_PACKED32 ) )
+ {
+ post( "pdp_frei0r : warning : plugin : %s use unsupported color model (%d) : ignored ...",
+ pluginname, x->plugins[x->x_plugin_count].plugin_info.color_model );
+ continue;
+ }
+
+ x->x_plugin_count++;
+ }
+}
+
+void fr_processframe(t_pdp_frei0r *x, int plugin, void *ibuffer, void *imbuffer, void *irbuffer, void *obuffer)
+{
+ double time = 0.0;
+
+ if ( x->x_plugin_count <= 0 )
+ {
+ return;
+ }
+
+ if ( ( x->plugins[x->x_plugin].plugin_type == F0R_PLUGIN_TYPE_FILTER ) ||
+ ( x->plugins[x->x_plugin].plugin_type == F0R_PLUGIN_TYPE_SOURCE ) )
+ {
+ // process frame
+ (*x->plugins[x->x_plugin].f0r_update)(x->plugins[x->x_plugin].instance, time, ibuffer, obuffer);
+ }
+ if ( x->plugins[x->x_plugin].plugin_type == F0R_PLUGIN_TYPE_MIXER2 )
+ {
+ if ( ( x->x_packet1 != -1 ) && ( x->x_packet2 != -1 ) && ( x->x_packetm1 != -1 ) )
+ {
+ // process frame
+ (*x->plugins[x->x_plugin].f0r_update2)(x->plugins[x->x_plugin].instance, time, ibuffer, imbuffer, irbuffer, obuffer);
+ }
+ }
+ if ( x->plugins[x->x_plugin].plugin_type == F0R_PLUGIN_TYPE_MIXER3 )
+ {
+ if ( ( x->x_packet1 != -1 ) && ( x->x_packet2 != -1 ) && ( x->x_packetm1 != -1 ) && ( x->x_packetr1 != -1 ) )
+ {
+ // process frame
+ (*x->plugins[x->x_plugin].f0r_update2)(x->plugins[x->x_plugin].instance, time, ibuffer, imbuffer, irbuffer, obuffer);
+ }
+ }
+}
+
+void fr_freeplugins(t_pdp_frei0r *x)
+{
+ t_int i;
+
+ for (i=0; i<x->x_plugin_count; i++)
+ {
+ // destroy plugin
+ (*x->plugins[i].f0r_destruct)(x->plugins[i].instance);
+ }
+ post("freeing plugin resources : %x", x->plugins);
+ freebytes( x->plugins, x->x_filename_count*sizeof(PLUGIN) );
+ x->plugins = NULL;
+}
+
+static void pdp_frei0r_process_rgba(t_pdp_frei0r *x)
+{
+ t_pdp *newheader = pdp_packet_header(x->x_packet2);
+ char *newdata = (char *)pdp_packet_data(x->x_packet2);
+ t_pdp *lheader = pdp_packet_header(x->x_packet1);
+ char *ldata = (char *)pdp_packet_data(x->x_packet1);
+ t_pdp *mheader = pdp_packet_header(x->x_packetm1);
+ char *mdata = (char *)pdp_packet_data(x->x_packetm1);
+ t_pdp *rheader = pdp_packet_header(x->x_packetr1);
+ char *rdata = (char *)pdp_packet_data(x->x_packetr1);
+
+ if ((x->x_width != (t_int)lheader->info.image.width) ||
+ (x->x_height != (t_int)lheader->info.image.height))
+ {
+
+ post("pdp_frei0r :: resizing plugins");
+
+ fr_freeplugins(x);
+
+ x->x_width = lheader->info.image.width;
+ x->x_height = lheader->info.image.height;
+ x->x_size = x->x_width*x->x_height;
+
+ //load the plugins
+ fr_loadplugins(x, FR_PLUGIN_DIR);
+ }
+
+ newheader->info.image.encoding = lheader->info.image.encoding;
+ newheader->info.image.width = x->x_width;
+ newheader->info.image.height = x->x_height;
+
+ memcpy( newdata, ldata, x->x_size*sizeof(uint32_t) );
+
+ fr_processframe(x, x->x_plugin, ldata, mdata, rdata, newdata);
+
+
+}
+
+static void pdp_frei0r_param(t_pdp_frei0r *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int pnumber;
+ f0r_param_info_t param_infos;
+
+ if ( x->x_plugin_count <= 0 )
+ {
+ post( "frei0r : set parameter : no plugins loaded, check your plugin directory setup" );
+ return;
+ }
+
+ if ( argc < 2 )
+ {
+ post("pdp_frei0r : set parameter : insufficient parameters (%d)", argc );
+ return;
+ }
+
+ if ( argv[0].a_type != A_FLOAT )
+ {
+ post("pdp_frei0r : set parameter : wrong parameter number" );
+ return;
+ }
+ pnumber = (int)argv[0].a_w.w_float;
+ // post("pdp_frei0r : setting parameter : %d", pnumber );
+
+ if ( (pnumber<0) || (pnumber>=(int)x->plugins[x->x_plugin].numparameters) )
+ {
+ post("pdp_frei0r : set parameter : wrong parameter number : %d : max : %d", pnumber, x->plugins[x->x_plugin].numparameters );
+ return;
+ }
+
+ (*x->plugins[x->x_plugin].f0r_get_param_info)(&param_infos, pnumber);
+
+ // set parameter
+ switch (param_infos.type)
+ {
+ case F0R_PARAM_BOOL:
+ {
+ f0r_param_bool fvalue;
+
+ if ( argc != 2 )
+ {
+ post("pdp_frei0r : wrong parameter arguments (%d) for boolean", argc );
+ return;
+ }
+ if ( argv[1].a_type != A_FLOAT )
+ {
+ post("pdp_frei0r : wrong parameter value" );
+ return;
+ }
+ if ( argv[1].a_w.w_float != 0. && argv[1].a_w.w_float != 1. )
+ {
+ // post("pdp_frei0r : wrong parameter value for boolean" );
+ return;
+ }
+ fvalue=argv[1].a_w.w_float;
+ (*x->plugins[x->x_plugin].f0r_set_param_value)(x->plugins[x->x_plugin].instance, &fvalue, pnumber);
+ }
+ break;
+ case F0R_PARAM_DOUBLE:
+ {
+ f0r_param_double fvalue;
+
+ if ( argc != 2 )
+ {
+ post("pdp_frei0r : wrong parameter arguments (%d) for double", argc );
+ return;
+ }
+ if ( argv[1].a_type != A_FLOAT )
+ {
+ post("pdp_frei0r : wrong parameter value" );
+ return;
+ }
+ fvalue=argv[1].a_w.w_float;
+ (*x->plugins[x->x_plugin].f0r_set_param_value)(x->plugins[x->x_plugin].instance, &fvalue, pnumber);
+ }
+ break;
+ case F0R_PARAM_COLOR:
+ {
+ struct f0r_param_color color;
+
+ if ( argc != 4 )
+ {
+ post("pdp_frei0r : wrong parameter arguments (%d) for color", argc );
+ return;
+ }
+ if ( argv[1].a_type != A_FLOAT ||
+ argv[2].a_type != A_FLOAT ||
+ argv[3].a_type != A_FLOAT )
+ {
+ post("pdp_frei0r : wrong parameter value" );
+ return;
+ }
+ color.r = argv[1].a_w.w_float;
+ color.g = argv[2].a_w.w_float;
+ color.b = argv[3].a_w.w_float;
+ (*x->plugins[x->x_plugin].f0r_set_param_value)(x->plugins[x->x_plugin].instance, &color, pnumber);
+ }
+ break;
+ case F0R_PARAM_POSITION:
+ {
+ struct f0r_param_position position;
+
+ if ( argc != 3 )
+ {
+ post("pdp_frei0r : wrong parameter arguments (%d) for position", argc );
+ return;
+ }
+ if ( argv[1].a_type != A_FLOAT ||
+ argv[2].a_type != A_FLOAT )
+ {
+ post("pdp_frei0r : wrong parameter value" );
+ return;
+ }
+ position.x = argv[1].a_w.w_float;
+ position.y = argv[2].a_w.w_float;
+ (*x->plugins[x->x_plugin].f0r_set_param_value)(x->plugins[x->x_plugin].instance, &position, pnumber);
+ }
+ break;
+ default:
+ post("pdp_frei0r : unsupported parameter type (%d)", param_infos.type );
+ return;
+ }
+}
+
+static void pdp_frei0r_plugin(t_pdp_frei0r *x, t_floatarg f)
+{
+ unsigned pi;
+ char *parname;
+ int partype;
+ t_atom plist[2];
+ t_atom tlist[2];
+ t_atom vlist[2];
+ f0r_param_info_t param_infos;
+
+ if ( x->x_plugin_count <= 0 )
+ {
+ post( "frei0r : no plugins loaded, check your plugin directory setup" );
+ return;
+ }
+ if((f<x->x_plugin_count)&&(f>-1))
+ {
+ x->x_plugin = f;
+ }
+ else
+ {
+ post( "frei0r : plugin out of range : %d", (t_int)f );
+ return;
+ }
+ post ("pdp_freeframe :: %s selected, %d parameters", x->plugins[x->x_plugin].name, x->plugins[x->x_plugin].numparameters);
+ outlet_symbol(x->x_pname, gensym( x->plugins[x->x_plugin].name ) );
+ outlet_float(x->x_nparams, (float)x->plugins[x->x_plugin].numparameters);
+ for ( pi=0; pi<x->plugins[x->x_plugin].numparameters; pi++ )
+ {
+ (*x->plugins[x->x_plugin].f0r_get_param_info)(&param_infos, pi);
+ SETFLOAT(&plist[0], pi);
+ SETSYMBOL(&plist[1], gensym(param_infos.name) );
+ outlet_list( x->x_parname, &s_list, 2, &plist[0] );
+ SETFLOAT(&tlist[0], pi);
+ SETFLOAT(&tlist[1], param_infos.type );
+ outlet_list( x->x_partype, &s_list, 2, &tlist[0] );
+ }
+}
+
+static void pdp_frei0r_sendpacket(t_pdp_frei0r *x)
+{
+ /* release the incoming packets */
+ pdp_packet_mark_unused(x->x_packet0);
+ x->x_packet0 = -1;
+ pdp_packet_mark_unused(x->x_packet1);
+ x->x_packet1 = -1;
+ pdp_packet_mark_unused(x->x_packetr0);
+ x->x_packetr0 = -1;
+ pdp_packet_mark_unused(x->x_packetr1);
+ x->x_packetr1 = -1;
+ pdp_packet_mark_unused(x->x_packetm0);
+ x->x_packetm0 = -1;
+ pdp_packet_mark_unused(x->x_packetm1);
+ x->x_packetm1 = -1;
+
+ x->x_packet3=-1;
+ x->x_dropped = pdp_packet_convert_ro_or_drop(&x->x_packet3, x->x_packet2, pdp_gensym("bitmap/rgb/*") );
+ pdp_packet_mark_unused(x->x_packet2);
+ x->x_packet2 = -1;
+
+ /* unregister and propagate if valid dest packet */
+ pdp_packet_pass_if_valid(x->x_outlet0, &x->x_packet3);
+}
+
+static void pdp_frei0r_process(t_pdp_frei0r *x)
+{
+ int encoding;
+ t_pdp *header = 0;
+ char *parname;
+ unsigned pi;
+ int partype;
+ t_atom plist[2];
+ t_atom tlist[2];
+ t_atom vlist[2];
+ f0r_param_info_t param_infos;
+
+ /* check if image data packets are compatible */
+ if ( (header = pdp_packet_header(x->x_packet1))
+ && (PDP_BITMAP == header->type)){
+
+ /* pdp_frei0r_process inputs and write into active inlet */
+ switch(pdp_packet_header(x->x_packet1)->info.image.encoding){
+
+ case PDP_BITMAP_RGBA:
+ x->x_packet2 = pdp_packet_clone_rw(x->x_packet1);
+ pdp_queue_add(x, pdp_frei0r_process_rgba, pdp_frei0r_sendpacket, &x->x_queue_id);
+ break;
+
+ default:
+ /* don't know the type, so dont pdp_frei0r_process */
+ break;
+
+ }
+ }
+
+ // hack to display infos of first loaded plugin
+ if ( ( x->x_plugin_count>0 ) && ( !x->x_infosok ) )
+ {
+ outlet_symbol(x->x_pname, gensym( x->plugins[x->x_plugin].name ) );
+ outlet_float(x->x_nparams, (float)x->plugins[x->x_plugin].numparameters);
+ for ( pi=0; pi<x->plugins[x->x_plugin].numparameters; pi++ )
+ {
+ (*x->plugins[x->x_plugin].f0r_get_param_info)(&param_infos, pi);
+ SETFLOAT(&plist[0], pi);
+ SETSYMBOL(&plist[1], gensym(param_infos.name) );
+ outlet_list( x->x_parname, &s_list, 2, &plist[0] );
+ SETFLOAT(&tlist[0], pi);
+ SETFLOAT(&tlist[1], param_infos.type );
+ outlet_list( x->x_partype, &s_list, 2, &tlist[0] );
+ }
+ x->x_infosok = 1;
+ }
+}
+
+static void pdp_frei0r_input_0(t_pdp_frei0r *x, t_symbol *s, t_floatarg f)
+{
+ if (s == gensym("register_rw"))
+ {
+ x->x_packet0=-1;
+ x->x_dropped = pdp_packet_convert_ro_or_drop(&x->x_packet0, (int)f, pdp_gensym("bitmap/rgb/*") );
+ // post("pdp_freiOr : drop 1 : %d", x->x_dropped );
+ x->x_packet1=-1;
+ x->x_dropped = pdp_packet_convert_ro_or_drop(&x->x_packet1, x->x_packet0, pdp_gensym("bitmap/rgba/*") );
+ // post("pdp_freiOr : drop 2 : %d", x->x_dropped );
+ }
+
+ if ((s == gensym("process")) && (-1 != x->x_packet1) && (!x->x_dropped))
+ {
+ /* add the process method and callback to the process queue */
+ pdp_frei0r_process(x);
+ }
+}
+
+static void pdp_frei0r_input_1(t_pdp_frei0r *x, t_symbol *s, t_floatarg f)
+{
+ char *ddata;
+ char *sdata;
+
+ if ( x->x_packetm0 != -1 )
+ {
+ return;
+ }
+ x->x_dropped = pdp_packet_convert_rw_or_drop(&x->x_packetm0, (int)f, pdp_gensym("bitmap/rgb/*") );
+ // post("pdp_freiOr : middle drop 1 : %d", x->x_dropped );
+ x->x_dropped = pdp_packet_convert_rw_or_drop(&x->x_packetm1, x->x_packetm0, pdp_gensym("bitmap/rgba/*") );
+ // post("pdp_freiOr : middle drop 2 : %d", x->x_dropped );
+}
+
+static void pdp_frei0r_input_2(t_pdp_frei0r *x, t_symbol *s, t_floatarg f)
+{
+ char *ddata;
+ char *sdata;
+
+ if ( x->x_packetr0 != -1 )
+ {
+ return;
+ }
+ x->x_dropped = pdp_packet_convert_rw_or_drop(&x->x_packetr0, (int)f, pdp_gensym("bitmap/rgb/*") );
+ // post("pdp_freiOr : right drop 1 : %d", x->x_dropped );
+ x->x_dropped = pdp_packet_convert_rw_or_drop(&x->x_packetr1, x->x_packetr0, pdp_gensym("bitmap/rgba/*") );
+ // post("pdp_freiOr : right drop 2 : %d", x->x_dropped );
+}
+
+static void pdp_frei0r_free(t_pdp_frei0r *x)
+{
+ int i;
+
+ pdp_queue_finish(x->x_queue_id);
+ pdp_packet_mark_unused(x->x_packet0);
+ fr_freeplugins(x);
+}
+
+t_class *pdp_frei0r_class;
+
+void *pdp_frei0r_new(t_floatarg f)
+{
+ int i;
+
+ t_pdp_frei0r *x = (t_pdp_frei0r *)pd_new(pdp_frei0r_class);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("pdp"), gensym("pdp1") );
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("pdp"), gensym("pdp2") );
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("plugin"));
+
+ x->x_outlet0 = outlet_new(&x->x_obj, &s_anything);
+ x->x_pname = outlet_new(&x->x_obj, &s_anything);
+ x->x_nparams = outlet_new(&x->x_obj, &s_anything);
+ x->x_parname = outlet_new(&x->x_obj, &s_anything);
+ x->x_partype = outlet_new(&x->x_obj, &s_anything);
+
+ x->x_packet0 = -1;
+ x->x_packet1 = -1;
+ x->x_packet2 = -1;
+ x->x_packet3 = -1;
+ x->x_packetm0 = -1;
+ x->x_packetm1 = -1;
+ x->x_packetr0 = -1;
+ x->x_packetr1 = -1;
+ x->x_queue_id = -1;
+
+ x->x_width = 320;
+ x->x_height = 240;
+ x->x_size = x->x_width * x->x_height;
+
+ //load the plugins
+ x->x_plugin_count = 0;
+ x->x_infosok = 0;
+ fr_loadplugins(x, FR_PLUGIN_DIR);
+
+ //select plugin
+ pdp_frei0r_plugin(x, f);
+
+ return (void *)x;
+}
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+void pdp_frei0r_setup(void)
+{
+
+ post( "pdp_frei0r :: frei0r host for Pure Data Packet version 0.1\n by Lluis Gomez i Bigorda (lluis@artefacte.org) \n & Yves Degoyon (ydegoyon@free.fr)\n using frei0r specification 1.1 by Georg Seidel,\n Phillip Promesberger and Martin Bayer\n made at piksel yearly gathering : http://www.piksel.no" );
+ pdp_frei0r_class = class_new(gensym("pdp_frei0r"), (t_newmethod)pdp_frei0r_new,
+ (t_method)pdp_frei0r_free, sizeof(t_pdp_frei0r), 0, A_DEFFLOAT, A_NULL);
+
+ class_addmethod(pdp_frei0r_class, (t_method)pdp_frei0r_input_0, gensym("pdp"), A_SYMBOL, A_DEFFLOAT, A_NULL);
+ class_addmethod(pdp_frei0r_class, (t_method)pdp_frei0r_input_1, gensym("pdp1"), A_SYMBOL, A_DEFFLOAT, A_NULL);
+ class_addmethod(pdp_frei0r_class, (t_method)pdp_frei0r_input_2, gensym("pdp2"), A_SYMBOL, A_DEFFLOAT, A_NULL);
+ class_addmethod(pdp_frei0r_class, (t_method)pdp_frei0r_plugin, gensym("plugin"), A_FLOAT, A_NULL);
+ class_addmethod(pdp_frei0r_class, (t_method)pdp_frei0r_param, gensym("param"), A_GIMME, A_NULL);
+
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/pix_preview/.pix_2pnm.cpp.swp b/pix_preview/.pix_2pnm.cpp.swp
new file mode 100644
index 0000000..86fde97
--- /dev/null
+++ b/pix_preview/.pix_2pnm.cpp.swp
Binary files differ
diff --git a/pix_preview/.pix_2pnm.h.swp b/pix_preview/.pix_2pnm.h.swp
new file mode 100644
index 0000000..32ddb97
--- /dev/null
+++ b/pix_preview/.pix_2pnm.h.swp
Binary files differ
diff --git a/pix_preview/.tm_project.cache b/pix_preview/.tm_project.cache
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pix_preview/.tm_project.cache
diff --git a/pix_preview/Makefile b/pix_preview/Makefile
new file mode 100644
index 0000000..0c0b38f
--- /dev/null
+++ b/pix_preview/Makefile
@@ -0,0 +1,37 @@
+PD_DIR = /usr/src/pd-0.40-2
+GEM_DIR = /usr/src/Gem
+
+LIBS = -lm
+GEM2PNM_VERSION = 0.6
+
+GEM2PNM_DISTRO = /mnt/c/ydegoyon.free.fr/gem2pdp-$(GEM2PNM_VERSION)
+GEM2PNM_TARBALL = $(GEM2PNM_DISTRO).tar.gz
+# build flags
+
+GEM2PNM_INCLUDE = -I$(PD_DIR)/src -I. -I$(GEM_DIR)/src -I$(PD_DIR)/src
+GEM2PNM_CPPFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \
+ -Wall -W -Wno-unused -Wno-parentheses -Wno-switch \
+ -DGEM2PNM_VERSION=\"$(GEM2PNM_VERSION)\" -g
+
+all: pix_preview.pd_linux
+
+
+pix_preview.pd_linux: pix_preview.o
+ rm -f pix_preview.pd_linux
+ gcc -export_dynamic -shared -o pix_preview.pd_linux pix_preview.o $(LIBS)
+
+clean:
+ rm -f *.o
+ rm -f pix_preview.pd_linux
+
+distro: clean all
+ rm *.o
+
+.cpp.o:
+ g++ $(GEM2PNM_CPPFLAGS) $(GEM2PNM_INCLUDE) -o $*.o -c $*.cpp
+
+.c.o:
+ gcc $(GEM2PNM_CPPFLAGS) $(GEM2PNM_INCLUDE) -o $*.o -c $*.c
+
+install:
+ cp -f --remove-destination *.pd $(PD_DIR)/doc/5.reference
diff --git a/pix_preview/Makefile.in b/pix_preview/Makefile.in
new file mode 100755
index 0000000..42a1168
--- /dev/null
+++ b/pix_preview/Makefile.in
@@ -0,0 +1,37 @@
+PD_DIR = @PD_DIR@
+GEM_DIR = @GEM_DIR@
+
+LIBS = @LIBS@
+GEM2PNM_VERSION = @GEM2PNM_VERSION@
+
+GEM2PNM_DISTRO = /mnt/c/ydegoyon.free.fr/gem2pdp-$(GEM2PNM_VERSION)
+GEM2PNM_TARBALL = $(GEM2PNM_DISTRO).tar.gz
+# build flags
+
+GEM2PNM_INCLUDE = -I$(PD_DIR)/src -I. -I$(GEM_DIR)/src -I$(PD_DIR)/src
+GEM2PNM_CPPFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \
+ -Wall -W -Wno-unused -Wno-parentheses -Wno-switch \
+ -DGEM2PNM_VERSION=\"$(GEM2PNM_VERSION)\" -g
+
+all: pix_preview.pd_linux
+
+
+pix_preview.pd_linux: pix_preview.o
+ rm -f pix_preview.pd_linux
+ gcc -export_dynamic -shared -o pix_preview.pd_linux pix_preview.o $(LIBS)
+
+clean:
+ rm -f *.o
+ rm -f pix_preview.pd_linux
+
+distro: clean all
+ rm *.o
+
+.cpp.o:
+ g++ $(GEM2PNM_CPPFLAGS) $(GEM2PNM_INCLUDE) -o $*.o -c $*.cpp
+
+.c.o:
+ gcc $(GEM2PNM_CPPFLAGS) $(GEM2PNM_INCLUDE) -o $*.o -c $*.c
+
+install:
+ cp -f --remove-destination *.pd $(PD_DIR)/doc/5.reference
diff --git a/pix_preview/configure b/pix_preview/configure
new file mode 100755
index 0000000..fe2c0e0
--- /dev/null
+++ b/pix_preview/configure
@@ -0,0 +1,4735 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GEM2PNM_VERSION GEM_DIR PD_DIR LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-dmalloc use dmalloc, as in
+ ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz
+ --with-pddir=<dir> specify an alternate pd source tree
+ --with-gemdir=<dir> specify an alternate gem source tree
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd "$ac_popdir"
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+GEM2PNM_VERSION=0.6
+
+if test -d /usr/local/pd;
+then
+ PD_DIR=/usr/local/pd
+elif test -d ../../pd;
+then
+ PD_DIR=../../pd
+else
+ echo "Pd sources not found"
+fi
+
+
+if test -d /win/Georg/pd-cvs/gem/Gem;
+then
+ GEM_DIR=/win/Georg/pd-cvs/gem/Gem
+elif test -d ../../gem/Gem;
+then
+ GEM_DIR=../../gem/Gem
+elif test -d ../../gem/Gem;
+then
+ GEM_DIR=../../gem/Gem
+else
+ echo "Gem sources not found"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcposix $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_cposix_strerror=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_cposix_strerror=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
+if test $ac_cv_lib_cposix_strerror = yes; then
+ LIBS="$LIBS -lcposix"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
+if test "${am_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+
+int
+main ()
+{
+
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_prog_cc_stdc="$ac_arg"; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+CC="$ac_save_CC"
+
+fi
+
+if test -z "$am_cv_prog_cc_stdc"; then
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6
+else
+ echo "$as_me:$LINENO: result: $am_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$am_cv_prog_cc_stdc" >&6
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f conftest*
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5
+echo $ECHO_N "checking if malloc debugging is wanted... $ECHO_C" >&6
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+ withval="$with_dmalloc"
+ if test "$withval" = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_DMALLOC 1
+_ACEOF
+
+ LIBS="$LIBS -ldmalloc"
+ LDFLAGS="$LDFLAGS -g"
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+
+
+
+
+
+# Check whether --with-pddir or --without-pddir was given.
+if test "${with_pddir+set}" = set; then
+ withval="$with_pddir"
+
+fi;
+
+if test "$with_pddir" != ""
+then
+ PD_DIR=$with_pddir
+fi
+
+# Check whether --with-gemdir or --without-gemdir was given.
+if test "${with_gemdir+set}" = set; then
+ withval="$with_gemdir"
+
+fi;
+
+if test "$with_gemdir" != ""
+then
+ GEM_DIR=$with_gemdir
+fi
+
+
+echo -n "looking for gem sources (required) ... "
+if test -f $GEM_DIR/src/Base/GemMan.h
+then
+
+ echo "ok."
+else
+ echo "gem source tree not found... use ./configure --with-gemdir= option"
+ exit -1
+fi
+
+echo -n "looking for pd sources (required) ... "
+if test -f $PD_DIR/src/m_imp.h
+then
+ echo "ok."
+else
+ echo "pd source tree not found... use ./configure --with-pddir= option"
+ exit -1
+fi
+
+
+
+LIBS="$LIBS -lm"
+CFLAGS="$CFLAGS -Wall"
+
+ ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+t quote
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@GEM2PNM_VERSION@,$GEM2PNM_VERSION,;t t
+s,@GEM_DIR@,$GEM_DIR,;t t
+s,@PD_DIR@,$PD_DIR,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/pix_preview/configure.ac b/pix_preview/configure.ac
new file mode 100755
index 0000000..22cb86a
--- /dev/null
+++ b/pix_preview/configure.ac
@@ -0,0 +1,83 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT
+GEM2PNM_VERSION=0.6
+
+if test -d /usr/local/pd;
+then
+ PD_DIR=/usr/local/pd
+elif test -d ../../pd;
+then
+ PD_DIR=../../pd
+else
+ echo "Pd sources not found"
+fi
+
+
+if test -d /win/Georg/pd-cvs/gem/Gem;
+then
+ GEM_DIR=/win/Georg/pd-cvs/gem/Gem
+elif test -d ../../gem/Gem;
+then
+ GEM_DIR=../../gem/Gem
+elif test -d ../../gem/Gem;
+then
+ GEM_DIR=../../gem/Gem
+else
+ echo "Gem sources not found"
+fi
+
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AM_SANITY_CHECK
+
+AM_MAINTAINER_MODE
+AM_WITH_DMALLOC
+
+AC_SUBST(GEM2PNM_VERSION)
+
+AC_ARG_WITH(pddir, [ --with-pddir=<dir> specify an alternate pd source tree])
+AC_ARG_WITH(gemdir, [ --with-gemdir=<dir> specify an alternate gem source tree])
+
+if test "$with_gemdir" != ""
+then
+ GEM_DIR=$with_gemdir
+fi
+
+if test "$with_pddir" != ""
+then
+ PD_DIR=$with_pddir
+fi
+
+echo -n "looking for gem sources (required) ... "
+if test -f $GEM_DIR/src/Base/GemMan.h
+then
+ AC_SUBST(GEM_DIR)
+ echo "ok."
+else
+ echo "gem source tree not found... use ./configure --with-gemdir= option"
+ exit -1
+fi
+
+
+echo -n "looking for pd sources (required) ... "
+if test -f $PD_DIR/src/m_imp.h
+then
+ AC_SUBST(PD_DIR)
+ echo "ok."
+else
+ echo "pd source tree not found... use ./configure --with-pddir= option"
+ exit -1
+fi
+
+LIBS="$LIBS -lm"
+CFLAGS="$CFLAGS -Wall"
+
+AC_CONFIG_FILES([
+Makefile
+])
+AC_OUTPUT
diff --git a/pix_preview/help-pix_preview.pd b/pix_preview/help-pix_preview.pd
new file mode 100644
index 0000000..cd86349
--- /dev/null
+++ b/pix_preview/help-pix_preview.pd
@@ -0,0 +1,77 @@
+#N canvas 0 25 1247 665 10;
+#X obj 419 -161 cnv 15 250 350 empty empty empty 20 12 0 14 -228992
+-66577 0;
+#X text 423 -178 Example:;
+#X obj 564 122 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577
+0;
+#N canvas 0 0 450 300 gemwin 0;
+#X obj 132 136 gemwin;
+#X obj 67 89 outlet;
+#X obj 67 10 inlet;
+#X msg 67 70 set destroy;
+#X msg 132 112 create \, 1;
+#X msg 198 112 destroy;
+#X msg 156 71 set create;
+#X obj 67 41 route create;
+#X connect 2 0 7 0;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 5 0 0 0;
+#X connect 6 0 1 0;
+#X connect 7 0 3 0;
+#X connect 7 0 4 0;
+#X connect 7 1 6 0;
+#X connect 7 1 5 0;
+#X restore 569 161 pd gemwin;
+#X msg 569 142 destroy;
+#X text 565 121 Create window:;
+#X obj 421 -130 cnv 15 155 250 empty empty empty 20 12 0 14 -24198
+-66577 0;
+#X obj 421 -155 gemhead;
+#X obj 421 142 pix_texture;
+#X obj 433 -125 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144
+-1 -1;
+#X text 475 -161 open a supported;
+#X text 476 -150 movie-clip;
+#X obj 446 69 unpack 0 0 0;
+#X floatatom 436 92 5 0 0 3 length - -;
+#X floatatom 485 92 5 0 0 3 width - -;
+#X floatatom 535 92 5 0 0 3 height - -;
+#X obj 490 50 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144
+-1 -1;
+#X floatatom 472 15 5 0 10000 1 frame# - -;
+#X obj 433 -96 openpanel;
+#X msg 433 -76 open \$1;
+#X obj 421 164 rectangle 4 3;
+#X obj 421 33 pix_film;
+#X msg 439 -33 auto \$1;
+#X obj 439 -51 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X msg 450 -9 colorspace Grey;
+#X obj 121 101 pix_preview;
+#X obj 520 -36 loadbang;
+#X obj 50 -136 metro 140;
+#X obj 45 -165 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X connect 3 0 4 0;
+#X connect 4 0 3 0;
+#X connect 7 0 21 0;
+#X connect 8 0 20 0;
+#X connect 9 0 18 0;
+#X connect 12 0 13 0;
+#X connect 12 1 14 0;
+#X connect 12 2 15 0;
+#X connect 16 0 17 0;
+#X connect 17 0 21 1;
+#X connect 18 0 19 0;
+#X connect 19 0 21 0;
+#X connect 21 0 8 0;
+#X connect 21 0 25 0;
+#X connect 21 1 12 0;
+#X connect 21 2 16 0;
+#X connect 22 0 21 0;
+#X connect 23 0 22 0;
+#X connect 24 0 21 0;
+#X connect 26 0 23 0;
+#X connect 27 0 25 0;
+#X connect 28 0 27 0;
diff --git a/pix_preview/help-pix_preview2.pd b/pix_preview/help-pix_preview2.pd
new file mode 100644
index 0000000..67fd6c6
--- /dev/null
+++ b/pix_preview/help-pix_preview2.pd
@@ -0,0 +1,163 @@
+#N canvas 0 25 1247 665 10;
+#X obj 256 -305 cnv 15 250 350 empty empty empty 20 12 0 14 -228992
+-66577 0;
+#X text 260 -322 Example:;
+#X obj 401 -22 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577
+0;
+#N canvas 0 0 450 300 gemwin 0;
+#X obj 132 136 gemwin;
+#X obj 67 89 outlet;
+#X obj 67 10 inlet;
+#X msg 67 70 set destroy;
+#X msg 132 112 create \, 1;
+#X msg 198 112 destroy;
+#X msg 156 71 set create;
+#X obj 67 41 route create;
+#X connect 2 0 7 0;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 5 0 0 0;
+#X connect 6 0 1 0;
+#X connect 7 0 3 0;
+#X connect 7 0 4 0;
+#X connect 7 1 6 0;
+#X connect 7 1 5 0;
+#X restore 406 17 pd gemwin;
+#X msg 406 -2 destroy;
+#X text 402 -23 Create window:;
+#X obj 258 -274 cnv 15 155 250 empty empty empty 20 12 0 14 -24198
+-66577 0;
+#X obj 258 -299 gemhead;
+#X obj 258 -2 pix_texture;
+#X obj 270 -269 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144
+-1 -1;
+#X text 312 -305 open a supported;
+#X text 313 -294 movie-clip;
+#X obj 283 -75 unpack 0 0 0;
+#X floatatom 273 -52 5 0 0 3 length - -;
+#X floatatom 322 -52 5 0 0 3 width - -;
+#X floatatom 372 -52 5 0 0 3 height - -;
+#X obj 327 -94 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144
+-1 -1;
+#X floatatom 309 -129 5 0 10000 1 frame# - -;
+#X obj 270 -240 openpanel;
+#X msg 270 -220 open \$1;
+#X obj 258 20 rectangle 4 3;
+#X obj 258 -111 pix_film;
+#X msg 276 -177 auto \$1;
+#X obj 276 -195 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X msg 287 -153 colorspace Grey;
+#X obj 191 200 pix_preview;
+#X obj 357 -180 loadbang;
+#X obj 114 104 metro 140;
+#X obj 109 75 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X obj 191 70 pix_resize 128 128;
+#X obj 583 -294 cnv 15 250 350 empty empty empty 20 12 0 14 -228992
+-66577 0;
+#X obj 728 -11 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577
+0;
+#N canvas 0 0 450 300 gemwin 0;
+#X obj 132 136 gemwin;
+#X obj 67 89 outlet;
+#X obj 67 10 inlet;
+#X msg 67 70 set destroy;
+#X msg 132 112 create \, 1;
+#X msg 198 112 destroy;
+#X msg 156 71 set create;
+#X obj 67 41 route create;
+#X connect 2 0 7 0;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 5 0 0 0;
+#X connect 6 0 1 0;
+#X connect 7 0 3 0;
+#X connect 7 0 4 0;
+#X connect 7 1 6 0;
+#X connect 7 1 5 0;
+#X restore 733 28 pd gemwin;
+#X msg 733 9 destroy;
+#X text 729 -12 Create window:;
+#X obj 585 -263 cnv 15 155 250 empty empty empty 20 12 0 14 -24198
+-66577 0;
+#X obj 585 -288 gemhead;
+#X obj 585 9 pix_texture;
+#X obj 597 -258 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144
+-1 -1;
+#X text 639 -294 open a supported;
+#X text 640 -283 movie-clip;
+#X obj 610 -64 unpack 0 0 0;
+#X floatatom 600 -41 5 0 0 3 length - -;
+#X floatatom 649 -41 5 0 0 3 width - -;
+#X floatatom 699 -41 5 0 0 3 height - -;
+#X obj 654 -83 bng 15 250 50 0 empty empty end_reached 20 7 0 10 -262144
+-1 -1;
+#X floatatom 636 -118 5 0 10000 1 frame# - -;
+#X obj 597 -229 openpanel;
+#X msg 597 -209 open \$1;
+#X obj 585 31 rectangle 4 3;
+#X obj 585 -100 pix_film;
+#X msg 603 -166 auto \$1;
+#X obj 603 -184 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X msg 614 -142 colorspace Grey;
+#X obj 518 211 pix_preview;
+#X obj 684 -169 loadbang;
+#X obj 439 134 metro 140;
+#X obj 434 105 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X obj 518 132 pix_resize 128 128;
+#X msg 663 69 -1 -2 -1 -2 8 -2 1 -2 1;
+#X obj 522 106 pix_convolve 3 3;
+#X msg 676 96 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125
+;
+#X connect 3 0 4 0;
+#X connect 4 0 3 0;
+#X connect 7 0 21 0;
+#X connect 8 0 20 0;
+#X connect 9 0 18 0;
+#X connect 12 0 13 0;
+#X connect 12 1 14 0;
+#X connect 12 2 15 0;
+#X connect 16 0 17 0;
+#X connect 17 0 21 1;
+#X connect 18 0 19 0;
+#X connect 19 0 21 0;
+#X connect 21 0 8 0;
+#X connect 21 0 29 0;
+#X connect 21 1 12 0;
+#X connect 21 2 16 0;
+#X connect 22 0 21 0;
+#X connect 23 0 22 0;
+#X connect 24 0 21 0;
+#X connect 26 0 23 0;
+#X connect 27 0 25 0;
+#X connect 28 0 27 0;
+#X connect 29 0 25 0;
+#X connect 32 0 33 0;
+#X connect 33 0 32 0;
+#X connect 36 0 50 0;
+#X connect 37 0 49 0;
+#X connect 38 0 47 0;
+#X connect 41 0 42 0;
+#X connect 41 1 43 0;
+#X connect 41 2 44 0;
+#X connect 45 0 46 0;
+#X connect 46 0 50 1;
+#X connect 47 0 48 0;
+#X connect 48 0 50 0;
+#X connect 50 0 37 0;
+#X connect 50 0 60 0;
+#X connect 50 1 41 0;
+#X connect 50 2 45 0;
+#X connect 51 0 50 0;
+#X connect 52 0 51 0;
+#X connect 53 0 50 0;
+#X connect 55 0 52 0;
+#X connect 56 0 54 0;
+#X connect 57 0 56 0;
+#X connect 58 0 54 0;
+#X connect 59 0 60 2;
+#X connect 60 0 58 0;
+#X connect 61 0 60 2;
diff --git a/pix_preview/install b/pix_preview/install
new file mode 100755
index 0000000..3999a4a
--- /dev/null
+++ b/pix_preview/install
@@ -0,0 +1,18 @@
+first, install gem and pd sources (if you don't have them)
+
+you will need libtk-img also
+
+Use the configure script and specify the directories:
+e.g.: ./configure --with-pddir=../../pd --with-gemdir=../../gem/Gem
+
+make clean
+
+make
+
+pix_preview requires the loading of gem library, of course.
+
+Enjoy!!
+
+Thanx for getting here.
+lluis/
+comments and bugs @ lluis@hangar.org
diff --git a/pix_preview/install-sh b/pix_preview/install-sh
new file mode 100755
index 0000000..e9de238
--- /dev/null
+++ b/pix_preview/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/pix_preview/pix_preview.cpp b/pix_preview/pix_preview.cpp
new file mode 100644
index 0000000..87cd428
--- /dev/null
+++ b/pix_preview/pix_preview.cpp
@@ -0,0 +1,520 @@
+////////////////////////////////////////////////////////
+//
+// GEM - Graphics Environment for Multimedia
+//
+// zmoelnig@iem.kug.ac.at
+//
+// Implementation file
+//
+// Copyright (c) 1997-1998 Mark Danks.
+// Copyright (c) Günther Geiger.
+// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM
+// Copyright (c) 2002 James Tittle & Chris Clepper
+// For information on usage and redistribution, and for a DISCLAIMER OF ALL
+// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
+//
+/////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+//
+// pix_preview
+//
+// 0409:forum::für::umläute:2000
+// IOhannes m zmoelnig
+// mailto:zmoelnig@iem.kug.ac.at
+//
+/////////////////////////////////////////////////////////
+
+#include <iostream>
+#include <string>
+#include <sstream>
+using namespace std;
+#include "stdio.h"
+
+
+#include "m_pd.h"
+#include "m_imp.h"
+#include "g_canvas.h"
+#include "t_tk.h"
+
+#include "pix_preview.h"
+
+int guidebug=0;
+
+#define COLORGRID_SYS_VGUI2(a,b) if (guidebug) \
+ post(a,b);\
+ sys_vgui(a,b)
+
+#define COLORGRID_SYS_VGUI3(a,b,c) if (guidebug) \
+ post(a,b,c);\
+ sys_vgui(a,b,c)
+
+#define COLORGRID_SYS_VGUI4(a,b,c,d) if (guidebug) \
+ post(a,b,c,d);\
+ sys_vgui(a,b,c,d)
+
+#define COLORGRID_SYS_VGUI5(a,b,c,d,e) if (guidebug) \
+ post(a,b,c,d,e);\
+ sys_vgui(a,b,c,d,e)
+
+#define COLORGRID_SYS_VGUI6(a,b,c,d,e,f) if (guidebug) \
+ post(a,b,c,d,e,f);\
+ sys_vgui(a,b,c,d,e,f)
+
+#define COLORGRID_SYS_VGUI7(a,b,c,d,e,f,g) if (guidebug) \
+ post(a,b,c,d,e,f,g );\
+ sys_vgui(a,b,c,d,e,f,g)
+
+#define COLORGRID_SYS_VGUI8(a,b,c,d,e,f,g,h) if (guidebug) \
+ post(a,b,c,d,e,f,g,h );\
+ sys_vgui(a,b,c,d,e,f,g,h)
+
+#define COLORGRID_SYS_VGUI9(a,b,c,d,e,f,g,h,i) if (guidebug) \
+ post(a,b,c,d,e,f,g,h,i );\
+ sys_vgui(a,b,c,d,e,f,g,h,i)
+
+
+ char *fdata="R0lGODlhHAAcAIABAAAAAP///ywAAAAAHAAcAAACGoSPqcvtD6OctNqLs968+w+G4kiW5omm6ooUADs=";
+
+
+/* base64 conversion*/
+
+static const std::string base64_chars =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789+/";
+
+std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
+ std::string ret;
+ int i = 0;
+ int j = 0;
+ unsigned char char_array_3[3];
+ unsigned char char_array_4[4];
+
+ while (in_len--) {
+ char_array_3[i++] = *(bytes_to_encode++);
+ if (i == 3) {
+ char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
+ char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
+ char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
+ char_array_4[3] = char_array_3[2] & 0x3f;
+
+ for(i = 0; (i <4) ; i++)
+ ret += base64_chars[char_array_4[i]];
+ i = 0;
+ }
+ }
+
+ if (i)
+ {
+ for(j = i; j < 3; j++)
+ char_array_3[j] = '\0';
+
+ char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
+ char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
+ char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
+ char_array_4[3] = char_array_3[2] & 0x3f;
+
+ for (j = 0; (j < i + 1); j++)
+ ret += base64_chars[char_array_4[j]];
+
+ while((i++ < 3))
+ ret += '=';
+
+ }
+
+ return ret;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CPPEXTERN_NEW_WITH_TWO_ARGS(pix_preview, t_floatarg, A_DEFFLOAT, t_floatarg, A_DEFFLOAT)
+
+
+ /////////////////////////////////////////////////////////
+ //
+ // pix_preview
+ //
+ /////////////////////////////////////////////////////////
+ // Constructor
+ //
+ /////////////////////////////////////////////////////////
+ pix_preview :: pix_preview(t_floatarg fx, t_floatarg fy)
+{
+ #include "pix_preview.tk2c"
+ xsize = (int)fx;
+ ysize = (int)fy;
+ m_csize = 3;
+
+
+ image_widgetbehavior.w_getrectfn = image_getrect;
+ image_widgetbehavior.w_displacefn = image_displace;
+ image_widgetbehavior.w_selectfn = image_select;
+ image_widgetbehavior.w_activatefn = image_activate;
+ image_widgetbehavior.w_deletefn = image_delete;
+ image_widgetbehavior.w_visfn = image_vis;
+#if (PD_VERSION_MINOR > 31)
+ image_widgetbehavior.w_clickfn = NULL;
+ image_widgetbehavior.w_propertiesfn = NULL;
+#endif
+#if PD_MINOR_VERSION < 37
+ image_widgetbehavior.w_savefn = image_save;
+#endif
+
+
+ class_setwidget(pix_preview_class,&image_widgetbehavior);
+
+ if (xsize < 0) xsize = 0;
+ if (ysize < 0) ysize = 0;
+
+ m_xsize = xsize;
+ m_ysize = ysize;
+
+ oldimagex = xsize;
+ oldimagey = ysize;
+
+ m_bufsize = m_xsize * m_ysize * m_csize;
+
+ m_buffer = new t_atom[m_bufsize];
+
+ //m_dataOut = outlet_new(this->x_obj, &s_list);
+}
+
+/////////////////////////////////////////////////////////
+// Destructor
+//
+/////////////////////////////////////////////////////////
+pix_preview :: ~pix_preview()
+{
+}
+
+/////////////////////////////////////////////////////////
+// processImage
+//
+/////////////////////////////////////////////////////////
+void pix_preview :: processImage(imageStruct &image)
+{
+ int x = m_xsize, y = m_ysize, c = m_csize;
+
+ if (image.xsize != oldimagex) {
+ oldimagex = image.xsize;
+ m_xsize = ((!xsize) || (xsize > oldimagex))?oldimagex:xsize;
+ }
+ if (image.ysize != oldimagey) {
+ oldimagey = image.ysize;
+ m_ysize = ((!ysize) || (ysize > oldimagey))?oldimagey:ysize;
+ }
+
+ if (image.csize != m_csize) m_csize = image.csize;
+
+ if ( (m_xsize != x) || (m_ysize != y) || (m_csize != c) ) {
+ // resize the image buffer
+ if(m_buffer)delete [] m_buffer;
+ m_bufsize = m_xsize * m_ysize * m_csize;
+ m_buffer = new t_atom[m_bufsize];
+
+ m_xstep = m_csize * ((float)image.xsize/(float)m_xsize);
+ m_ystep = m_csize * ((float)image.ysize/(float)m_ysize) * image.xsize;
+ }
+
+ m_data = image.data;
+}
+
+/////////////////////////////////////////////////////////
+// processYUVImage
+//
+/////////////////////////////////////////////////////////
+void pix_preview :: processYUVImage(imageStruct &image)
+{
+ int x = m_xsize, y = m_ysize, c = m_csize;
+
+ if (image.xsize != oldimagex) {
+ oldimagex = image.xsize;
+ m_xsize = ((!xsize) || (xsize > oldimagex))?oldimagex:xsize;
+ }
+ if (image.ysize != oldimagey) {
+ oldimagey = image.ysize;
+ m_ysize = ((!ysize) || (ysize > oldimagey))?oldimagey:ysize;
+ }
+
+ if (image.csize != m_csize) m_csize = image.csize;
+
+ if ( (m_xsize != x) || (m_ysize != y) || (m_csize != c) ) {
+ // resize the image buffer
+ if(m_buffer)delete [] m_buffer;
+ m_bufsize = m_xsize * m_ysize * m_csize;
+ m_buffer = new t_atom[m_bufsize];
+
+ m_xstep = m_csize * ((float)image.xsize/(float)m_xsize);
+ m_ystep = m_csize * ((float)image.ysize/(float)m_ysize) * image.xsize;
+ }
+
+ m_data = image.data;
+}
+
+/////////////////////////////////////////////////////////
+// trigger
+//
+/////////////////////////////////////////////////////////
+void pix_preview :: trigger()
+{
+ if (!m_data) return;
+
+ int n = m_ysize, m = 0;
+ int i = 0;
+
+ unsigned char *data, *line;
+ stringstream sx,sy;
+
+ //fprintf (stderr,"%d %d %d %d %d %d",xsize, ysize,m_xsize, m_ysize,oldimagex,oldimagey);
+
+ std::string pnm;
+ std::string pnm64;
+ pnm += "P6\n";
+ sx << m_xsize;
+ pnm += sx.str();
+ pnm += " ";
+ sy << m_ysize;
+ pnm += sy.str();
+ pnm += "\n255\n";
+
+ //fprintf (stderr,"%s",pnm.c_str());
+
+ /*/escriu el contingut de data a un arxiu.
+ FILE * fp = fopen("/tmp/pixdump01.pnm", "w");
+ fprintf (fp, "P6\n%d %d\n255\n", m_xsize, m_ysize);*/
+ data = line = m_data;
+ switch(m_csize){
+ case 4:
+/*
+ while (n > 0) {
+ while (m < m_xsize) {
+ int r, g, b, a;
+ r = (int)data[chRed];
+ fprintf (fp, "%c", (char)r);
+ i++;
+ g = (int)data[chGreen];
+ fprintf (fp, "%c", (char)g);
+ i++;
+ b = (int)data[chBlue];
+ fprintf (fp, "%c", (char)b);
+ i++;
+ a = (int)data[chAlpha];
+ i++;
+ m++;
+ data = line + (int)(m_xstep * (float)m);
+ }
+ m = 0;
+ n--;
+ line = m_data + (int)(m_ystep*n);
+ data = line;
+ }
+ fclose (fp);
+*/
+ while (n > 0) {
+ while (m < m_xsize) {
+ int r, g, b, a;
+ r = (int)data[chRed];
+ pnm += (char)r;
+ i++;
+ g = (int)data[chGreen];
+ pnm += (char)g;
+ i++;
+ b = (int)data[chBlue];
+ pnm += (char)b;
+ i++;
+ a = (int)data[chAlpha];
+ i++;
+ m++;
+ data = line + (int)(m_xstep * (float)m);
+ }
+ m = 0;
+ n--;
+ line = m_data + (int)(m_ystep*n);
+ data = line;
+ }
+
+ //std::cout << "NOT encoded: " << pnm << std::endl;
+
+ pnm64 = base64_encode(reinterpret_cast<const unsigned char*>(pnm.c_str()), pnm.length());
+ //std::cout << "encoded: " << pnm64 << std::endl;
+
+
+
+ //m_glist = (t_glist *) canvas_getcurrent();
+
+ sys_vgui("img%x put {%s}\n", this->x_obj, reinterpret_cast<const unsigned char*>(pnm64.c_str()) );
+
+ break;
+ case 2:
+ while (n < m_ysize) {
+ while (m < m_xsize/2) {
+ float y,u,y1,v;
+ u = (float)data[0] / 255.f;
+ SETFLOAT(&m_buffer[i], u);
+ i++;
+ y = (float)data[1] / 255.f;
+ SETFLOAT(&m_buffer[i], y);
+ i++;
+ v = (float)data[2] / 255.f;
+ SETFLOAT(&m_buffer[i], v);
+ i++;
+ y1 = (float)data[3] / 255.f;
+ SETFLOAT(&m_buffer[i], y1);
+ i++;
+ m++;
+ data = line + (int)(m_xstep * (float)m);
+ }
+ m = 0;
+ n++;
+ line = m_data + (int)(m_ystep*n);
+ data = line;
+ }
+ case 1: default:
+ int datasize=m_xsize*m_ysize*m_csize/4;
+ while (datasize--) {
+ float v;
+ v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i], v);
+ v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+1], v);
+ v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+2], v);
+ v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+3], v);
+ i+=4;
+ }
+ }
+ //outlet_list(m_dataOut, gensym("list"), i, m_buffer);
+}
+
+/////////////////////////////////////////////////////////
+// static member function
+//
+/////////////////////////////////////////////////////////
+void pix_preview :: obj_setupCallback(t_class *classPtr)
+{
+ class_addbang(classPtr, (t_method)&pix_preview::triggerMessCallback);
+}
+
+void pix_preview :: triggerMessCallback(void *data)
+{
+ GetMyClass(data)->trigger();
+}
+
+
+
+
+/* widget helper functions */
+
+
+
+
+void pix_preview :: image_drawme(pix_preview *x, t_glist *glist, int firsttime)
+{
+ if (firsttime) {
+
+ sys_vgui("image create photo img%x -data {%s}\n",x,fdata);
+ sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n",
+ glist_getcanvas(glist),text_xpix((t_object*)x, glist)+14, text_ypix((t_object*)x, glist)+14,x,x);
+ //fprintf (stderr, "%x %x - %d %d \n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist));
+ }
+ else {
+ sys_vgui(".x%x.c coords %xS \
+%d %d\n",
+ glist_getcanvas(glist), x,
+ text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist));
+ //fprintf (stderr, "%x %x - %d %d\n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist));
+ }
+
+}
+
+void pix_preview :: image_erase(pix_preview* x,t_glist* glist)
+{
+ int n;
+ sys_vgui(".x%x.c delete %xS\n",
+ glist_getcanvas(glist), x);
+
+}
+
+
+/* ------------------------ image widgetbehaviour----------------------------- */
+
+
+void pix_preview :: image_getrect(t_gobj *z, t_glist *glist,
+ int *xp1, int *yp1, int *xp2, int *yp2)
+{
+ int width, height;
+ pix_preview* x = (pix_preview*)z;
+
+
+ width = 250;
+ height = 50;
+ *xp1 = text_xpix((t_object*)x, glist);
+ *yp1 = text_ypix((t_object*)x, glist);
+ *xp2 = text_xpix((t_object*)x, glist) + width;
+ *yp2 = text_ypix((t_object*)x, glist) + height;
+}
+
+void pix_preview :: image_displace(t_gobj *z, t_glist *glist,
+ int dx, int dy)
+{
+ t_object *x = (t_object *)z;
+ x->te_xpix += dx;
+ x->te_ypix += dy;
+ sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n",
+ glist_getcanvas(glist), x,
+ text_xpix(x, glist), text_ypix(x, glist),
+ text_xpix(x, glist) + 25, text_ypix(x, glist) + 25);
+
+ image_drawme((pix_preview *)x, glist, 0);
+ canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x);
+}
+
+void pix_preview :: image_select(t_gobj *z, t_glist *glist, int state)
+{ t_object *x = (t_object *)z;
+ if (state) {
+ sys_vgui(".x%x.c create rectangle \
+%d %d %d %d -tags %xSEL -outline blue\n",
+ glist_getcanvas(glist),
+ text_xpix(x, glist), text_ypix(x, glist),
+ text_xpix(x, glist) + 25, text_ypix(x, glist) + 25,
+ x);
+ }
+ else {
+ sys_vgui(".x%x.c delete %xSEL\n",
+ glist_getcanvas(glist), x);
+ }
+}
+
+
+void pix_preview :: image_activate(t_gobj *z, t_glist *glist, int state)
+{
+}
+
+void pix_preview :: image_delete(t_gobj *z, t_glist *glist)
+{
+
+ t_text *x = (t_text *)z;
+ pix_preview* s = (pix_preview*)z;
+ canvas_deletelinesfor(glist_getcanvas(glist), x);
+ image_erase(s, glist);
+}
+
+
+void pix_preview :: image_vis(t_gobj *z, t_glist *glist, int vis)
+{
+ pix_preview* s = (pix_preview*)z;
+ if (vis)
+ image_drawme(s, glist, 1);
+}
+
diff --git a/pix_preview/pix_preview.h b/pix_preview/pix_preview.h
new file mode 100644
index 0000000..0124bf4
--- /dev/null
+++ b/pix_preview/pix_preview.h
@@ -0,0 +1,144 @@
+/*-----------------------------------------------------------------
+LOG
+GEM - Graphics Environment for Multimedia
+
+Get pixel information
+
+Copyright (c) 1997-1998 Mark Danks. mark@danks.org
+Copyright (c) Günther Geiger. geiger@epy.co.at
+Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM. zmoelnig@iem.kug.ac.at
+Copyright (c) 2002 James Tittle & Chris Clepper
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
+
+-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------
+pix_preview
+
+ 0409:forum::für::umläute:2000
+ IOhannes m zmoelnig
+ mailto:zmoelnig@iem.kug.ac.at
+-----------------------------------------------------------------*/
+
+#ifndef INCLUDE_PIX_DUMP_H_
+#define INCLUDE_PIX_DUMP_H_
+
+#include "Base/GemPixObj.h"
+
+/*needed for base64 conversion*/
+#include <string>
+
+std::string base64_encode(unsigned char const* , unsigned int len);
+
+
+
+
+
+
+/*-----------------------------------------------------------------
+-------------------------------------------------------------------
+CLASS
+
+ pix_preview
+
+ Get pixel information
+
+ KEYWORDS
+ pix
+
+ DESCRIPTION
+
+ dumps the pix-data as a float-package
+
+-----------------------------------------------------------------*/
+class GEM_EXTERN pix_preview : public GemPixObj
+{
+ CPPEXTERN_HEADER(pix_preview, GemPixObj)
+
+public:
+
+ //////////
+ // Constructor
+ pix_preview(t_floatarg fx, t_floatarg fy);
+ int x_width, x_height;
+
+protected:
+
+ //////////
+ // Destructor
+ virtual ~pix_preview();
+
+ //////////
+ // All we want is the pixel information, so this is a complete override.
+ virtual void processImage(imageStruct &image);
+
+ //////////
+ virtual void processYUVImage(imageStruct &image);
+
+ //////////
+ void trigger();
+
+ //////////
+ // The color outlet
+ t_outlet *m_dataOut;
+
+ //////////
+ // the buffer
+ int xsize, ysize; // proposed x/y-sizes
+ int m_xsize, m_ysize;
+ int m_csize;
+ t_atom *m_buffer;
+ int m_bufsize;
+
+ int oldimagex;
+ int oldimagey;
+
+ //////////
+ // navigation
+ float m_xstep;
+ float m_ystep;
+
+ /////////
+ // pointer to the image data
+ unsigned char *m_data;
+
+ /////////
+ // LLUO :: widget tk list pointer
+ t_glist *m_glist;
+
+ t_widgetbehavior image_widgetbehavior;
+
+ static void image_drawme(pix_preview *x, t_glist *glist, int firsttime);
+
+ static void image_erase(pix_preview* x,t_glist* glist);
+
+
+/* ------------------------ image widgetbehaviour----------------------------- */
+
+
+ static void image_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2);
+
+ static void image_displace(t_gobj *z, t_glist *glist, int dx, int dy);
+
+ static void image_select(t_gobj *z, t_glist *glist, int state);
+
+ static void image_activate(t_gobj *z, t_glist *glist, int state);
+
+ static void image_delete(t_gobj *z, t_glist *glist);
+
+ static void image_vis(t_gobj *z, t_glist *glist, int vis);
+
+
+private:
+
+ //////////
+ // Static member callbacks
+ static void triggerMessCallback(void *dump);
+ static void GREYMessCallback(void *dump);
+ static void RGBAMessCallback(void *dump);
+ static void RGBMessCallback(void *dump);
+
+};
+
+#endif // for header file
diff --git a/pix_preview/pix_preview.tk2c b/pix_preview/pix_preview.tk2c
new file mode 100755
index 0000000..6e6abec
--- /dev/null
+++ b/pix_preview/pix_preview.tk2c
@@ -0,0 +1,66 @@
+// ########### colorgrid procedures -- ydegoyon@free.fr #########
+sys_gui("package require Img\n");
+sys_gui("proc colorgrid_apply {id} {\n");
+// strip "." from the TK id to make a variable name suffix
+sys_gui("set vid [string trimleft $id .]\n");
+// for each variable, make a local variable to hold its name...
+sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n");
+sys_gui("global $var_graph_colorgrid\n");
+sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n");
+sys_gui("global $var_graph_xlines\n");
+sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n");
+sys_gui("global $var_graph_ylines\n");
+sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_xlines] [eval concat $$var_graph_ylines] [eval concat $$var_graph_colorgrid] \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc colorgrid_cancel {id} {\n");
+sys_gui("set cmd [concat $id cancel \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc colorgrid_ok {id} {\n");
+sys_gui("colorgrid_apply $id\n");
+sys_gui("colorgrid_cancel $id\n");
+sys_gui("}\n");
+sys_gui("proc pdtk_colorgrid_dialog {id xlines ylines colorgrid} {\n");
+sys_gui("set vid [string trimleft $id .]\n");
+sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n");
+sys_gui("global $var_graph_colorgrid\n");
+sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n");
+sys_gui("global $var_graph_xlines\n");
+sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n");
+sys_gui("global $var_graph_ylines\n");
+sys_gui("set $var_graph_colorgrid $colorgrid\n");
+sys_gui("set $var_graph_xlines $xlines\n");
+sys_gui("set $var_graph_ylines $ylines\n");
+sys_gui("toplevel $id\n");
+sys_gui("wm title $id {colorgrid}\n");
+sys_gui("wm protocol $id WM_DELETE_WINDOW [concat colorgrid_cancel $id]\n");
+sys_gui("label $id.label -text {COLORGRID PROPERTIES}\n");
+sys_gui("pack $id.label -side top\n");
+sys_gui("frame $id.buttonframe\n");
+sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n");
+sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"colorgrid_cancel $id\"\n");
+sys_gui("button $id.buttonframe.apply -text {Apply} -command \"colorgrid_apply $id\"\n");
+sys_gui("button $id.buttonframe.ok -text {OK} -command \"colorgrid_ok $id\"\n");
+sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.apply -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.ok -side left -expand 1\n");
+sys_gui("frame $id.42rangef\n");
+sys_gui("pack $id.42rangef -side top\n");
+sys_gui("label $id.42rangef.lxlines -text \"X sections :\"\n");
+sys_gui("entry $id.42rangef.xlines -textvariable $var_graph_xlines -width 7\n");
+sys_gui("pack $id.42rangef.lxlines $id.42rangef.xlines -side left\n");
+sys_gui("frame $id.72rangef\n");
+sys_gui("pack $id.72rangef -side top\n");
+sys_gui("label $id.72rangef.lylines -text \"Y sections :\"\n");
+sys_gui("entry $id.72rangef.ylines -textvariable $var_graph_ylines -width 7\n");
+sys_gui("pack $id.72rangef.lylines $id.72rangef.ylines -side left\n");
+sys_gui("checkbutton $id.showcolorgrid -text {Show Grid} -variable $var_graph_colorgrid -anchor w\n");
+sys_gui("pack $id.showcolorgrid -side top\n");
+sys_gui("bind $id.42rangef.xlines <KeyPress-Return> [concat colorgrid_ok $id]\n");
+sys_gui("bind $id.72rangef.ylines <KeyPress-Return> [concat colorgrid_ok $id]\n");
+sys_gui("focus $id.42rangef.xlines\n");
+sys_gui("}\n");
+// ########### colorgrid procedures END -- lluis@artefacte.org #########
diff --git a/videogrid/INSTALL_videogrid b/videogrid/INSTALL_videogrid
new file mode 100755
index 0000000..1733d70
--- /dev/null
+++ b/videogrid/INSTALL_videogrid
@@ -0,0 +1,48 @@
+
+VIDEOGRID INSTALL
+
+[ENG]
+
+In order to compile this source it must have the library QuickTime and the source code of Puredata.
+
+tar xzvf videogrid[-version].tar.gz in folder pd/extra/ o edit file Makefile modifying the value of PD_SRC whit the correct path location of the pd/src/. If you don't have ir, download and copy the src/ folder into pd/ folder.
+
+$ cd videogrid[-version]
+
+# make clean
+
+# make
+
+# make install
+
+now you can open example: help-videogrid.pd
+
+$ pd help-videogrid.pd
+
+Thanks.
+
+Sergi Lario
+slario(at)gmail.com
+
+[CAT]
+
+Per compilar el codi font cal disposar de la biblioteca QuickTime i el codi font de Puredata.
+
+tar xzvf videogrid[-versio].tar.gz en el directori pd/extra/ o bé edita el fitxer Makefile modificant el valor de la variable PD_SRC amb el path correcte del codi font de pd/src/. Si no el tens el pots descarregar i copiar la carpeta src/ dins el directori pd/
+
+$ cd videogrid[-versio]
+
+# make clean
+
+# make
+
+# make install
+
+ara ja pots obrir l'exemple help-videogrid.pd
+
+$ pd help-videogrid.pd
+
+Gràcies.
+
+Sergi Lario
+slario(at)gmail.com
diff --git a/videogrid/LICENSE b/videogrid/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/videogrid/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. 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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. 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.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ 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.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ 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
+state 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) <year> <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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU 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 Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/videogrid/Makefile b/videogrid/Makefile
new file mode 100755
index 0000000..298532e
--- /dev/null
+++ b/videogrid/Makefile
@@ -0,0 +1,38 @@
+PD_SRC=../../src
+
+NAME=videogrid
+CSYM=videogrid
+
+current: pd_linux
+
+# ----------------------- LINUX -----------------------
+
+pd_linux: $(NAME).pd_linux
+
+.SUFFIXES: .pd_linux
+
+LINUXCFLAGS = -fPIC -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wno-shadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch
+
+
+LINUXINCLUDE = -I$(PD_SRC) -I/usr/include/
+
+.c.pd_linux:
+ cc -fPIC -c -ansi -O -Wall -Wmissing-prototypes cua.c
+ cc -fPIC -c -O -Wall -Wmissing-prototypes -o qtconverter.o -c qtconverter.c
+# ./tk2c.bash < $*.tk > $*.tk2c
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o cua.o qtconverter.o -lc -lm -lquicktime
+ strip --strip-unneeded $*.pd_linux
+ rm -f $*.o ../$*.pd_linux
+ ln -s $*/$*.pd_linux ..
+
+# ----------------------------------------------------------
+
+install:
+ cp help-*.pd ../../doc/5.reference
+
+clean:
+ rm -f *.o *.pd_* so_locations
+
diff --git a/videogrid/cat-help-videogrid.pd b/videogrid/cat-help-videogrid.pd
new file mode 100755
index 0000000..a14bca1
--- /dev/null
+++ b/videogrid/cat-help-videogrid.pd
@@ -0,0 +1,20 @@
+#N canvas 772 365 1148 655 10;
+#X text 24 93 LLISTA STDOUT;
+#X symbolatom 72 324 60 0 0 0 - - -;
+#X obj 26 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X text 24 13 VIDEOGRID;
+#X text 25 29 Objecte per seleccionar amb un sol clic la ubicacio d'un
+video amb el frame afegit al tauler.;
+#X text 154 63 AFEGIR VIDEO;
+#X text 154 113 AFEGIR VIDEOS D'UN DIRECTORI;
+#X text 74 344 PATH DEL VIDEO CLICAT;
+#X obj 72 179 videogrid videogrid2 3 5 #F0F0F0 #0F0F0F /usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0243.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0243.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0243.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0243.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0243.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/lib/pd/extra/videogrid/videos/dscn0241.mov|
+;
+#X msg 156 127 putimgdir /usr/lib/pd/extra/videogrid/videos;
+#X msg 156 77 putimg /usr/lib/pd/extra/videogrid/videos/dscn0241.mov
+;
+#X connect 2 0 8 0;
+#X connect 8 0 1 0;
+#X connect 9 0 8 0;
+#X connect 10 0 8 0;
diff --git a/videogrid/cua.c b/videogrid/cua.c
new file mode 100644
index 0000000..f03fb2a
--- /dev/null
+++ b/videogrid/cua.c
@@ -0,0 +1,164 @@
+/*
+cue for videogrid external
+Copyright (C) 2007 Sergi Lario
+
+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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "cua.h"
+
+/*
+- compilació:
+ $ gcc -c -ansi -O -Wall -Wmissing-prototypes cua.c
+- muntatge:
+ $ gcc cua.o -o cua
+- execució:
+ $ ./cua
+*/
+/* programa principal de prova */
+/*
+int main()
+{
+
+ int opc=8;
+ char path[BYTESNOMFITXER];
+ int ok;
+ Cua cua;
+ crearCua(&cua);
+
+ while(opc!=5)
+ {
+ printf("\t\t\tMENU PRINCIPAL\n\n\n");
+ printf("\t 1. Encuar\n");
+ printf("\t 2. Desencuar\n");
+ printf("\t 3. Nombre de nodes\n");
+ printf("\t 4. Contingut de la cua\n");
+ printf("\t 5. Sortir\n");
+
+ scanf("%d", &opc);
+
+ switch(opc)
+ {
+ case 1:
+ printf("path a introduir:\n");
+ scanf("%s", path);
+ encuar(&cua, path);
+ break;
+
+ case 2:
+ ok = desencuar(&cua);
+ if(ok) printf("node eliminat de la cua\n");
+ break;
+
+ case 3:
+ printf("nombre de nodes de la cua %d\n", numNodes(&cua));
+ break;
+ case 4:
+ escriuCua(&cua);
+ break;
+ case 5:
+ eliminarCua(&cua);
+ break;
+ }
+ }
+ getchar();
+ return 0;
+}
+*/
+/* implementació de les funcions */
+void crearCua(Cua *cua)
+{
+ cua->davanter=cua->final=NULL;
+}
+
+/* funció que encua el node al final de la cua */
+void encuar (Cua *cua, path x)
+{
+ Node *nou;
+ nou=(Node*)malloc(sizeof(Node));
+ strcpy(nou->pathFitxer,x);
+ nou->seguent=NULL;
+ if(cuaBuida(cua))
+ {
+ cua->davanter=nou;
+ }
+ else
+ cua->final->seguent=nou;
+ cua->final=nou;
+}
+
+/* elimina l'element del principi de la cua */
+int desencuar (Cua *cua)
+{
+ if(!cuaBuida(cua))
+ {
+ Node *nou;
+ nou=cua->davanter;
+ cua->davanter=cua->davanter->seguent;
+ free(nou);
+ return 1;
+ }
+ else
+ {
+ /* printf("Cua buida\a\n"); */
+ return 0;
+ }
+
+}
+
+/* funció que retorna si la cua és buida */
+int cuaBuida(Cua *cua)
+{
+ return (cua->davanter==NULL);
+}
+
+/* elimina el contingut de la cua */
+void eliminarCua(Cua *cua)
+{
+ while (!cuaBuida(cua)) desencuar(cua);
+ printf("Cua eliminada\a\n");
+}
+
+/* funció que retorna el nombre de nodes de la cua */
+int numNodes(Cua *cua)
+{
+ int contador=0;
+ Node *actual;
+ actual=cua->davanter;
+ if(actual) contador=1;
+ while((actual)&&(actual != cua->final)){
+ contador ++;
+ actual = actual->seguent;
+ }
+ return (contador);
+}
+
+/* funció que escriu la cua de nodes per la sortida estàndard */
+void escriuCua(Cua *cua)
+{
+ if(!cuaBuida(cua))
+ {
+ Node *actual;
+ actual=cua->davanter;
+ printf("CUA DE NODES\n[");
+ do{
+ printf("#%s#",actual->pathFitxer);
+ actual = actual->seguent;
+ }while(actual);
+ printf("]\n");
+
+ }
+ else
+ printf("Cua buida\a\n");
+}
diff --git a/videogrid/cua.h b/videogrid/cua.h
new file mode 100644
index 0000000..4144770
--- /dev/null
+++ b/videogrid/cua.h
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* nombre de caracters per el nom del path del fitxer */
+#define BYTESNOMFITXER 512
+
+typedef char path[BYTESNOMFITXER];
+
+/* estructures i tipus de dades de la cua */
+
+/* estructura de dades: un node de la cua */
+struct node
+{
+ /* nom del path de la imatge */
+ path pathFitxer;
+ /* apuntador al següent node en cua */
+ struct node *seguent;
+};
+
+/* definició del tipus node */
+typedef struct node Node;
+
+/* definició del tipus de cua */
+typedef struct
+{
+ Node *davanter;
+ Node *final;
+}Cua;
+
+
+/* declaracions de les funcions */
+
+/* crea una cua */
+void crearCua(Cua *cua);
+/* encuara un element al final de la cua */
+void encuar (Cua *cua, path x);
+/* elimina un element de la cua */
+int desencuar (Cua *cua);
+/* retorna si la cua és buida */
+int cuaBuida(Cua *cua);
+/* elimina el contingut de la cua */
+void eliminarCua(Cua *cua);
+/* retorna el nombre de nodes de la cua */
+int numNodes(Cua *cua);
+/* escriu el contingut de la cua */
+void escriuCua(Cua *cua);
diff --git a/videogrid/help-videogrid.pd b/videogrid/help-videogrid.pd
new file mode 100755
index 0000000..cd556c1
--- /dev/null
+++ b/videogrid/help-videogrid.pd
@@ -0,0 +1,21 @@
+#N canvas 323 160 580 404 10;
+#X symbolatom 72 324 60 0 0 0 - - -;
+#X obj 26 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X text 24 13 VIDEOGRID;
+#X obj 72 178 videogrid videogrid1 3 5 #F0F0F0 #0F0F0F /usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0248.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0248.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0248.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0248.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0248.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov|/usr/local/lib/pd/extra/videogrid/videos/dscn0248.mov|
+;
+#X text 154 63 ADD VIDEO;
+#X text 154 113 ADD VIDEOS FROM FOLDER;
+#X text 25 29 Object to select the path location of a video quiktime
+added in the grid \, in form of image of its first frame.;
+#X text 74 344 LOCATION OF THE SELECTED VIDEO;
+#X text 24 93 LIST STDOUT;
+#X msg 156 77 putvideo /usr/local/lib/pd/extra/videogrid/videos/dscn0241.mov
+;
+#X msg 156 127 putvideodir /usr/local/lib/pd/extra/videogrid/videos
+;
+#X connect 1 0 3 0;
+#X connect 3 0 0 0;
+#X connect 9 0 3 0;
+#X connect 10 0 3 0;
diff --git a/videogrid/qtconverter.c b/videogrid/qtconverter.c
new file mode 100644
index 0000000..24e99fd
--- /dev/null
+++ b/videogrid/qtconverter.c
@@ -0,0 +1,133 @@
+#include "qtconverter.h"
+
+/*
+void post(char args[]){
+ printf("%s",args);
+}
+*/
+
+int convertir_img(pathimage pathFitxer, tipus_format f, int W, int H, int posi){
+ /*
+ Quicktime per les conversions
+ */
+
+ /* RGB vectors */
+ unsigned char * qt_rows[3];
+ /* YUV vesctor frame */
+ unsigned char *qt_frame = NULL;
+ /* quicktime decoder */
+ quicktime_t *qt;
+ /* quicktime color model */
+ int qt_cmodel;
+
+ int nN = posi;
+ int x_vwidth = 0;
+ int x_vheight = 0;
+ /* convertir(entrada,FORMAT_MINIATURA, W_CELL, H_CELL, nN); */
+ qt = quicktime_open(pathFitxer, 1, 0);
+
+ if (!(qt)){
+ /* post("videogrid: error opening qt file"); */
+ return -1;
+ }
+
+ if (!quicktime_has_video(qt)) {
+ /* post("videogrid: no video stream"); */
+ quicktime_close(qt);
+ return -1;
+
+ }
+ else if (!quicktime_supported_video(qt,0)) {
+ /* post("videogrid: unsupported video codec\n"); */
+ quicktime_close(qt);
+ return -1;
+ }
+ else
+ {
+ qt_cmodel = BC_YUV420P;
+ x_vwidth = quicktime_video_width(qt,0);
+ x_vheight = quicktime_video_height(qt,0);
+
+
+ free(qt_frame);
+ qt_frame = (unsigned char*)malloc(x_vwidth*x_vheight*4);
+
+ int size = x_vwidth * x_vheight;
+ qt_rows[0] = &qt_frame[0];
+ qt_rows[2] = &qt_frame[size];
+ qt_rows[1] = &qt_frame[size + (size>>2)];
+
+ quicktime_set_cmodel(qt, qt_cmodel);
+ }
+
+ /* int length = quicktime_video_length(qt,0); */
+ /* int Vpos = quicktime_video_position(qt,0); */
+ lqt_decode_video(qt, qt_rows, 0);
+
+ switch(qt_cmodel){
+ case BC_YUV420P:
+ printf(" ");
+ /* post("videogrid: qt colormodel : BC_YUV420P"); */
+
+ /* per a fer la miniatura
+ cada k colomnes pillem una
+ cada l files pillem una */
+ int w = x_vwidth;
+ int h = x_vheight;
+ int k = (w/W);
+ int l = (h/H);
+
+ /*int cont=0;*/
+
+ char nNstr[BYTES_NUM_TEMP];
+ pathimage ig_path = PATH_TEMPORAL;
+
+ sprintf(nNstr, "%d", nN);
+ strcat(ig_path,nNstr);
+ strcat(ig_path,".");
+ strcat(ig_path,FORMAT_MINIATURA);
+ /* printf("Creacio de la imatge %s ...",ig_path); */
+ /* escriu el contingut de data a un arxiu. */
+ FILE *fp = fopen(ig_path, "w");
+ fprintf (fp, "P6\n%d %d\n255\n", W, H);
+
+ int i,j,y,u,v,r,g,b;
+
+ for (i=0;i<(l*H);i=i+l) {
+ for (j=0;j<(k*W);j=j+k) {
+ y=qt_rows[0][(w*i+j)];
+ u=qt_rows[1][(w/2)*(i/2)+(j/2)];
+ v=qt_rows[2][(w/2)*(i/2)+(j/2)];
+ r = CLAMP8(y + 1.402 *(v-128));
+ g = CLAMP8(y - 0.34414 *(u-128) - 0.71414 *(v-128));
+ b = CLAMP8(y + 1.772 *(u-128));
+ fprintf (fp, "%c%c%c", r,g,b);
+ }
+ }
+
+ /* escriu el contingut de data a un arxiu.*/
+ fclose (fp);
+ }
+ return 0;
+}
+
+
+
+/*
+cc -fPIC -c -O -Wall -Wmissing-prototypes -o qtconverter.o -c qtconverter.c
+cc -o qtconverter qtconverter.o -lc -lm -lquicktime `Wand-config --ldflags --libs`
+./qtconverter
+*/
+
+/*
+int main(void){
+ pathimage imatge = "/usr/lib/pd/extra/videogrid/videos/dscn0243.mov";
+ tipus_format fo = "ppm";
+ int flauta;
+ flauta = convertir(imatge,fo,60,40,2);
+ printf("\n%d FET\n", flauta);
+ return(0);
+}
+*/
+
+
diff --git a/videogrid/qtconverter.h b/videogrid/qtconverter.h
new file mode 100644
index 0000000..da70f40
--- /dev/null
+++ b/videogrid/qtconverter.h
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+//#include <quicktime/lqt.h>
+//#include <quicktime/colormodels.h>
+#include <lqt/lqt.h>
+#include <lqt/colormodels.h>
+
+/* 8bits clamp rgb values */
+
+#define CLAMP8(x) (((x)<0) ? 0 : ((x>255)? 255 : (x)))
+
+#define BYTESNOMFITXERIMATGE 512
+#define BYTESTIPUSFROMAT 4
+
+#define FORMAT_MINIATURA "ppm"
+#define PATH_TEMPORAL "/tmp/vigrid_"
+#define BYTES_NUM_TEMP 4
+
+typedef char pathimage[BYTESNOMFITXERIMATGE];
+
+typedef char tipus_format[BYTESTIPUSFROMAT];
+
+int convertir_img(pathimage pathFitxer, tipus_format f, int W, int H, int posi);
+/* void post(char args[]); */
+
diff --git a/videogrid/tk2c.sh b/videogrid/tk2c.sh
new file mode 100644
index 0000000..1b1dc09
--- /dev/null
+++ b/videogrid/tk2c.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#set -x
+
+while read line
+do
+ for word in $line
+ do
+ if [ "X"$word != "X"${word#\#} ]
+ then
+ echo // ${line#\#}
+ break
+ else
+ line=${line//\'/\\\'}
+#useless, slashes never gets in
+ line=${line//\\/\\\\}
+#this one's dirty, i know
+ line=${line//;/\\\\;}
+ line=${line//\"/\\\"}
+ echo 'sys_gui("'$line'\n");'
+ break
+ fi
+ done
+done
+
diff --git a/videogrid/videogrid.c b/videogrid/videogrid.c
new file mode 100644
index 0000000..b2b6587
--- /dev/null
+++ b/videogrid/videogrid.c
@@ -0,0 +1,827 @@
+/*
+videogrid external for Puredata
+Copyright (C) 2007 Sergi Lario
+sll :: slario-at-gmail.com
+
+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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+#include <dirent.h>
+#include <string.h>
+#include <unistd.h>
+#include <math.h>
+
+/* incloure les definicions de variables i
+ prototipus de dades i de funcions de puredata */
+#include "m_pd.h"
+/* incloure estructures de dades i capceleres de funcions gàfiques bàsiques de pd */
+#include "g_canvas.h"
+/* incloure estructures de dades i capceleres de funcions per a gestionar una cua */
+#include "cua.h"
+/* incloure estructures de dades i capceleres de funcions per convertir imatges a diferents formats */
+/* #include "magickconverter.h" */
+/* incloure estructures de dades i capceleres de funcions per tractar frames de vídeo */
+#include "qtconverter.h"
+/* incloure estructures de dades i capceleres de funcions per traballar amb threads */
+#include "pthread.h"
+
+/* &&&&&&&&&&&&&&&&&&&&&&&&&&&&& VIDEOGRID &&&&&&&&&&&&&&&&&&&&&&&&&&&&& */
+
+/* definició de l'amplada i l'alçada d'una casella */
+#define W_CELL 60
+#define H_CELL 40
+
+/* crear un apuntador al nou objecte */
+static t_class *videogrid_class;
+/* indica el nombre de videogrid creats - utilitzat per diferenciar el nom d'instàncies d'objectes del mateix tipus */
+static int videogridcount = 0;
+
+/* definició de la classe i la seva estructura de dades */
+
+typedef struct _videogrid {
+ t_object x_obj;
+ /* declaració de la sortida de l'objecte */
+ t_outlet *x_sortida;
+ /* llista d'objectes gràfics */
+ t_glist *x_glist;
+ /* nombre de files */
+ int x_num_fil;
+ /* nombre de columnes */
+ int x_num_col;
+ /* posició de la última imatge en el tauler */
+ int x_ultima_img;
+ /* path del directori actual */
+ path x_dir_actual;
+ /* path del directori a canviar */
+ path x_dir_canvi;
+ /* posicio ultim al directori actual */
+ int x_dir_pos;
+ /* apuntador al primer element posicionat al tauler */
+ Node *x_tauler_primer;
+ /* cua d'imatges */
+ Cua x_cua;
+ /* nom de l'objecte */
+ t_symbol *x_name;
+ /* color de fons */
+ t_symbol *x_color_fons;
+ /* color del marge */
+ t_symbol *x_color_marc;
+ /* mutex per evitar concurrencia sobre la cua al accedir diferents threads*/
+ pthread_mutex_t x_lock;
+
+} t_videogrid;
+
+
+/* calcula la posició x del tauler a partir de la posició de l'element de la cua (d'esquerra a dreta) */
+int getX(t_videogrid* x, int posCua){
+ int c = x->x_num_col;
+ int xpos = (posCua % c) * W_CELL;
+ return(xpos + 1);
+}
+
+/* calcula la posició y del tauler a partir de la posició de l'element de la cua (de dalt a baix) */
+int getY(t_videogrid* x, int posCua){
+ int c = x->x_num_col;
+ int ypos = (posCua / c) * H_CELL;
+ return(ypos + 1);
+}
+
+/* elimina les imatges temporals */
+void eliminar_imatges_temporals(int maxim){
+ FILE *fitxer;
+ path path_total;
+ int contador = 0;
+ char contador_str[BYTES_NUM_TEMP];
+ while(contador < maxim){
+ strcpy(path_total,PATH_TEMPORAL);
+ sprintf(contador_str,"%d", contador);
+ strcat(path_total,contador_str);
+ strcat(path_total,".");
+ strcat(path_total,FORMAT_MINIATURA);
+ /* elimina el fitxer si no hi ha cap problema */
+ if(unlink(path_total)){
+ /* post("Imatge temporal %s eliminada\n",path_total); */
+ }
+ contador++;
+ }
+ post("Videogrid: Imatges temporals eliminades\n",path_total);
+}
+
+int format_adequat_v(path nomF){
+ int retorn = 0;
+ path ig_path = "";
+ strcat(ig_path,nomF);
+ char *t1;
+ path extensio = "";
+ for ( t1 = strtok(ig_path,".");
+ t1 != NULL;
+ t1 = strtok(NULL,".") )
+ strcpy(extensio,t1);
+ if(strcmp(extensio,"mov")==0) retorn = 1;
+ /*
+ if(strcmp(extensio,"eps")==0) retorn = 1;
+ if(strcmp(extensio,"gif")==0) retorn = 1;
+ if(strcmp(extensio,"jpg")==0) retorn = 1;
+ if(strcmp(extensio,"jpeg")==0) retorn = 1;
+ if(strcmp(extensio,"png")==0) retorn = 1;
+ if(strcmp(extensio,"ppm")==0) retorn = 1;
+ if(strcmp(extensio,"tif")==0) retorn = 1;
+ if(strcmp(extensio,"tiff")==0) retorn = 1;
+ */
+
+ return (retorn);
+}
+
+/* afegir una imatge al grid */
+void videogrid_afegir_imatge(t_videogrid *x, path entrada)
+{
+ int maxim;
+ char nNstr[BYTES_NUM_TEMP];
+ int pos = 0;
+ /* escriu l'argument entrat */
+ if (format_adequat_v(entrada) == 1){
+ /* post("Afegint la imatge %s ...",entrada); */
+ maxim = x->x_num_fil * x->x_num_col;
+ path ig_path = PATH_TEMPORAL;
+
+ /* si hi ha tants nodes a la cua com el maxim */
+ if((numNodes(&x->x_cua)) >= maxim){
+ /* desencua */
+ int extret;
+ extret = desencuar(&x->x_cua);
+ /* obtenir la posició en la cua del nou node */
+ if(x->x_ultima_img == maxim-1) {
+ pos = 0;
+ }else{
+ pos = x->x_ultima_img+1;
+ }
+ sys_vgui(".x%x.c delete %xS%d\n", glist_getcanvas(x->x_glist), x, pos);
+ }
+ /* encua el nou node */
+ encuar(&x->x_cua, entrada);
+ /* si no és el primer element a encuar incrementem la posicio de la última imatge insertada */
+ if(numNodes(&x->x_cua) != 1) x->x_ultima_img ++;
+ /* si assoleix el maxim torna a començar, inicialitzant la posició en el tauler de la última imatge insertada */
+ if(x->x_ultima_img == maxim) x->x_ultima_img = 0;
+
+ /*
+ Quicktime per les conversions
+ */
+ int nN = x->x_ultima_img;
+ convertir_img(entrada,FORMAT_MINIATURA, W_CELL, H_CELL, nN);
+ sprintf(nNstr, "%d", nN);
+ strcat(ig_path,nNstr);
+ strcat(ig_path,".");
+ strcat(ig_path,FORMAT_MINIATURA);
+ /*printf("Creacio de la imatge %s ...",ig_path);*/
+ sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path);
+ /* printf("1. Creacio de la imatge %s ...",ig_path); */
+ sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n",
+ glist_getcanvas(x->x_glist),
+ text_xpix(&x->x_obj, x->x_glist) + getX(x,nN) + (W_CELL/2),
+ text_ypix(&x->x_obj, x->x_glist) + getY(x,nN) + (H_CELL/2),
+ x,nN,x,nN);
+ /* printf("2. Creacio de la imatge %s ...",ig_path); */
+ if(nN == 0){
+ x->x_tauler_primer = x->x_cua.final;
+ /* post("Ara el primer del tauler es %s\n",x->x_tauler_primer->pathFitxer); */
+ }
+ /* printf("SURT de la creacio de la imatge %s ...",ig_path); */
+ }else{
+ post("Videogrid: El format del fitxer %s és incompatible.",entrada);
+ }
+ /*
+ sys_vgui("image create photo img%x -file %s\n",x,entrada);
+ sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n",
+ glist_getcanvas(glist),text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x,x);
+ */
+}
+
+/* dibuixa videogrid */
+void videogrid_drawme(t_videogrid *x, t_glist *glist, int firsttime)
+{
+ /* post("Entra a drawme amb firsttime: %d", firsttime); */
+ if (firsttime) {
+ char name[MAXPDSTRING];
+ canvas_makefilename(glist_getcanvas(x->x_glist), x->x_name->s_name, name, MAXPDSTRING);
+ sys_vgui(".x%x.c create rectangle %d %d %d %d -fill %s -tags %xGRID -outline %s\n",
+ glist_getcanvas(glist),
+ text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
+ text_xpix(&x->x_obj, glist) + (x->x_num_col * W_CELL) + 1, text_ypix(&x->x_obj, glist) + (x->x_num_fil * H_CELL) + 1,
+ x->x_color_fons->s_name, x,x->x_color_marc->s_name);
+
+ canvas_fixlinesfor(glist_getcanvas(glist), (t_text*)x);
+ /* si hi elements a la cua els afegeix (redimensió) */
+ if(!cuaBuida(&x->x_cua))
+ {
+ path ig_path;
+ int nN = 0;
+ char nNstr[BYTES_NUM_TEMP];
+ Node *actual;
+ actual=x->x_cua.davanter;
+ do{
+ strcpy(ig_path,PATH_TEMPORAL);
+ sprintf(nNstr, "%d", nN);
+ strcat(ig_path,nNstr);
+ strcat(ig_path,".");
+ strcat(ig_path,FORMAT_MINIATURA);
+ /* post("reestablint la imatge %s", actual->pathFitxer); */
+ // videogrid_afegir_imatge(x,actual->pathFitxer);
+ convertir_img(actual->pathFitxer,FORMAT_MINIATURA, W_CELL, H_CELL, nN);
+ sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path);
+ sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n",
+ glist_getcanvas(x->x_glist),text_xpix(&x->x_obj, x->x_glist) + getX(x,nN) + (W_CELL/2), text_ypix(&x->x_obj, x->x_glist) + getY(x,nN) + (H_CELL/2),x,nN,x,nN);
+ actual = actual->seguent;
+ nN++;
+ }while(actual);
+ }
+ }
+ else {
+ sys_vgui(".x%x.c coords %xGRID %d %d %d %d\n", glist_getcanvas(glist), x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),text_xpix(&x->x_obj, glist) + (x->x_num_col*W_CELL) + 1, text_ypix(&x->x_obj, glist) + (x->x_num_fil*H_CELL) + 1);
+ if(!cuaBuida(&x->x_cua))
+ {
+ int contador = 0;
+ while(contador < numNodes(&x->x_cua)){
+ sys_vgui(".x%x.c coords %xS%d \
+ %d %d\n",
+ glist_getcanvas(glist), x, contador,
+ text_xpix(&x->x_obj, x->x_glist) + getX(x,contador) + (W_CELL/2), text_ypix(&x->x_obj, x->x_glist) + getY(x,contador) + (H_CELL/2));
+ contador++;
+ }
+
+ /* char buf[800];
+ sprintf(buf, "pdtk_videogrid_table %%s %s %d %d\n", x->x_name->s_name, x->x_num_fil, x->x_num_col);
+ gfxstub_new(&x->x_obj.ob_pd, x, buf); */
+ }
+ }
+}
+
+/* borra videogrid */
+void videogrid_erase(t_videogrid* x,t_glist* glist)
+{
+ int maxim = x->x_num_fil * x->x_num_col;
+ path path_total;
+ char contador_str[2];
+ /* post("Entra a erase"); */
+ /* elimina les imatges */
+ int contador = 0;
+ while(contador < numNodes(&x->x_cua)){
+ sys_vgui(".x%x.c delete %xS%d\n", glist_getcanvas(x->x_glist), x, contador);
+ strcpy(path_total,PATH_TEMPORAL);
+ sprintf(contador_str,"%d", contador);
+ strcat(path_total,contador_str);
+ strcat(path_total,".");
+ strcat(path_total,FORMAT_MINIATURA);
+ if(unlink(path_total)){
+ /* post("Imatge temporal %s eliminada\n",path_total); */
+ }
+ contador++;
+ }
+
+ /* elimina el grid */
+ sys_vgui(".x%x.c delete %xGRID\n", glist_getcanvas(glist), x);
+ eliminar_imatges_temporals(maxim);
+}
+
+/* mètode de la clase que escriu un missatge al rebre un bang */
+void videogrid_bang(t_videogrid *x)
+{
+ /* post("Hello videogrid !!"); */
+ escriuCua(&x->x_cua);
+}
+
+/* mètode de la classe que es dispara al rebre una entrada de missatge amb [putvideo +string( com a paràmetre */
+void videogrid_putvideo(t_videogrid *x, t_symbol *entrada)
+{
+ /* comprova que existeixi el fitxer */
+ FILE *fitxer;
+ path e;
+ strcpy(e,entrada->s_name);
+ /* post("putvideo de %s\n", e); */
+
+ fitxer = fopen(e,"r");
+ if (!fitxer) {
+ post("Videogrid: Problema amb l'obertura del fitxer %s\n",e);
+ }
+ else {
+ /* post("s'encua la imatge %s\n", e); */
+ videogrid_afegir_imatge(x,e);
+ /*outlet_symbol(x->x_sortida, entrada);*/
+ }
+ /* post("putvideo amb img = %s\n", e); */
+}
+
+/* mètode de la classe que es dispara al rebre una entrada de missatge amb [putvideodir +string( com a paràmetre */
+void *videogrid_putvideodir_thread(t_videogrid *x)
+{
+ DIR *dirp;
+ struct dirent * direntp;
+ path nomImatge, directoriAnterior, pathActual;
+ int numEncuats = 0, numPosDir = 0;
+ int maxim;
+ if ((dirp = opendir(x->x_dir_canvi)) == NULL)
+ {
+ post("Videogrid: No es pot obrir el directori %s\n", x->x_dir_canvi);
+ }else{
+ maxim = x->x_num_fil * x->x_num_col;
+ strcpy(directoriAnterior, x->x_dir_actual);
+ strcpy(x->x_dir_actual, x->x_dir_canvi);
+ /* si es el mateix directori entrat l'ultim busca la ultima imatge afegida per a seguir a encuant a partir d'ella en endavant */
+ if(strcmp(directoriAnterior, x->x_dir_actual) == 0){
+ post("Videogrid: Repeteix directori %s\n", x->x_dir_actual);
+ while ( (direntp = readdir( dirp )) != NULL ){
+ /* es descarta el mateix directori, el directori anterior i tot el que no sigui un fitxer regular */
+ if((strcmp(direntp->d_name,"..") != 0)&&(strcmp(direntp->d_name,".") != 0)&&(direntp->d_type == DT_REG)){
+ /* incrementa la posició en el directori */
+ numPosDir++;
+ /* assolir la posició anterior en el directori */
+ if(numPosDir > x->x_dir_pos){
+ /* si el nombre de nodes encuats per aquest directori no supera el màxim encua el nou node */
+ if(numEncuats < maxim){
+ /* post("s'encua la imatge %s\n", direntp->d_name); */
+ /* concatena el path i el nom de la imatge */
+ strcpy(nomImatge,direntp->d_name);
+ strcpy(pathActual,x->x_dir_actual);
+ strcat(pathActual,"/");
+ strcat(pathActual,nomImatge);
+ pthread_mutex_lock(&x->x_lock);
+ videogrid_afegir_imatge(x, pathActual);
+ pthread_mutex_unlock(&x->x_lock);
+ /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */
+ numEncuats++;
+ /* es desa la posició en el directori de l'últim node encuat */
+ x->x_dir_pos = numPosDir;
+ }
+ }
+ }
+ }
+ }else{
+ /* directori diferent omple la cua començant pel primer fitxer */
+ post("Videogrid: Nou directori %s \n", x->x_dir_actual);
+ while ( (direntp = readdir( dirp )) != NULL ){
+ /* es descarta el mateix directori, el directori anterior i tot el que no sigui un fitxer regular */
+ if((strcmp(direntp->d_name,"..") != 0)&&(strcmp(direntp->d_name,".") != 0)&&(direntp->d_type == DT_REG)){
+ /* incrementa la posició en el directori */
+ numPosDir++;
+ /* si el nombre de nodes encuats per aquest directori no supera el màxim enca el nou node */
+ if(numEncuats < maxim){
+ /* post("s'encua la imatge %s\n", direntp->d_name); */
+ /* concatena el path i el nom de la imatge */
+ strcpy(nomImatge,direntp->d_name);
+ strcpy(pathActual,x->x_dir_actual);
+ strcat(pathActual,"/");
+ strcat(pathActual,nomImatge);
+ pthread_mutex_lock(&x->x_lock);
+ videogrid_afegir_imatge(x, pathActual);
+ pthread_mutex_unlock(&x->x_lock);
+ /* incrementa en 1 per indicar el nombre de nodes encuats per aquest directori */
+ numEncuats++;
+ /* es desa la posició en el directori de l'últim node encuat */
+ x->x_dir_pos = numPosDir;
+ }
+ }
+ }
+ }
+ /* si la posicio de l'actual es la de l'utim fitxer del directori, inicialitza la posició */
+ if(x->x_dir_pos >= numPosDir) x->x_dir_pos = 0;
+ closedir(dirp);
+ }
+ /* escriu l'argument entrat */
+ /* post("Obtenint imatges del directori: %s ...",x->x_dir_canvi); */
+ /* envia a la sorida l'argument entrat */
+ /* outlet_symbol(x->x_sortida, entrada); */
+ pthread_exit(NULL);
+}
+
+void videogrid_putvideodir(t_videogrid *x, t_symbol *entrada)
+{
+
+ pthread_t unthread;
+ pthread_attr_t unatribut;
+ pthread_attr_init( &unatribut );
+
+ strcpy(x->x_dir_canvi,entrada->s_name);
+
+ // ---------------- THREAD CREAT -------------------------
+ pthread_mutex_init(&x->x_lock, NULL);
+ pthread_create(&unthread,&unatribut,(void *)videogrid_putvideodir_thread, x);
+ pthread_mutex_destroy(&x->x_lock);
+}
+
+static int videogrid_click(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
+{
+ t_videogrid* x = (t_videogrid *)z;
+ int x_pos = xpix - text_xpix(&x->x_obj, x->x_glist);
+ int y_pos = ypix - text_ypix(&x->x_obj, x->x_glist);
+ int xa, ya, postauler, contador, maxim;
+ path pathSortida;
+ Node *actual;
+ if (doit)
+ {
+ /* obtenir la posicio en el tauler */
+ xa = x_pos / W_CELL;
+ ya = (y_pos / H_CELL) * x->x_num_col;
+ postauler = ya + xa;
+ /* obtenir el path per enviar a la sortida */
+ if((!cuaBuida(&x->x_cua))&&(postauler < numNodes(&x->x_cua))){
+ contador = 0;
+ maxim = x->x_num_fil * x->x_num_col;
+ if(x->x_tauler_primer){
+ actual = x->x_tauler_primer;
+ while(contador <= postauler){
+ if(contador == postauler){
+ strcpy(pathSortida,actual->pathFitxer);
+ }
+ if(actual->seguent == NULL){
+ actual = x->x_cua.davanter;
+ }else{
+ actual = actual->seguent;
+ }
+ contador++;
+ }
+ outlet_symbol(x->x_sortida, gensym(pathSortida));
+ }
+ }
+ }
+ return (1);
+}
+
+static void videogrid_getrect(t_gobj *z, t_glist *glist,int *xp1, int *yp1, int *xp2, int *yp2)
+{
+ int cols, fils;
+ t_videogrid* x = (t_videogrid*)z;
+ cols = x->x_num_col;
+ fils = x->x_num_fil;
+ *xp1 = text_xpix(&x->x_obj, glist);
+ *yp1 = text_ypix(&x->x_obj, glist);
+ *xp2 = text_xpix(&x->x_obj, glist) + (cols*W_CELL);
+ *yp2 = text_ypix(&x->x_obj, glist) + (fils*H_CELL);
+ /* post("Esta amb el ratoli en el punt %d %d %d %d o son els vetexs de la caixa... es/bd", xp1, yp1, xp2, yp2); */
+}
+
+static void videogrid_displace(t_gobj *z, t_glist *glist,int dx, int dy)
+{
+ /* post("Entra a displace amb dx %d i dy %d", dx, dy); */
+ t_videogrid *x = (t_videogrid *)z;
+ x->x_obj.te_xpix += dx;
+ x->x_obj.te_ypix += dy;
+ sys_vgui(".x%x.c coords %xGRID %d %d %d %d\n",
+ glist_getcanvas(glist), x,
+ text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
+ text_xpix(&x->x_obj, glist) + (x->x_num_col*W_CELL), text_ypix(&x->x_obj, glist) + (x->x_num_fil*H_CELL));
+ videogrid_drawme(x, glist, 0);
+ canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x);
+}
+
+static void videogrid_select(t_gobj *z, t_glist *glist, int state)
+{
+ /* post("Entra select amb state %d", state); */
+ t_videogrid *x = (t_videogrid *)z;
+ if (state) {
+ /* post("Videogrid seleccionat"); */
+ sys_vgui(".x%x.c itemconfigure %xGRID -outline #0000FF\n", glist_getcanvas(glist), x);
+ }
+ else {
+ /* post("Videogrid deseleccionat"); */
+ sys_vgui(".x%x.c itemconfigure %xGRID -outline %s\n", glist_getcanvas(glist), x, x->x_color_marc->s_name);
+ }
+}
+
+static void videogrid_delete(t_gobj *z, t_glist *glist)
+{
+ /* post("Entra a delete"); */
+ t_text *x = (t_text *)z;
+ canvas_deletelinesfor(glist_getcanvas(glist), x);
+}
+
+static void videogrid_vis(t_gobj *z, t_glist *glist, int vis)
+{
+ /* post("Entra a vist amb vis %d", vis); */
+ t_videogrid* s = (t_videogrid*)z;
+ if (vis)
+ videogrid_drawme(s, glist, 1);
+ else
+ videogrid_erase(s,glist);
+}
+
+
+static void videogrid_save(t_gobj *z, t_binbuf *b)
+{
+ /* post("Entra a save"); */
+ t_videogrid *x = (t_videogrid *)z;
+ /* crea la cadena de paths per desar */
+ /* 100 possibles paths com a màxim a 512 cada path*/
+ /* char cadenaPaths[51200];*/
+ char *cadenaPaths, *cadenaPathsInicials;
+ path ultimPath = "";
+ cadenaPaths = (char *)malloc(51200*sizeof(char));
+ strcpy(cadenaPaths,"");
+ cadenaPathsInicials = (char *)malloc(51200*sizeof(char));
+ strcpy(cadenaPathsInicials,"");
+ /*strcpy(cadenaPaths,(char *)argv[5].a_w.w_symbol->s_name);*/
+ if(!cuaBuida(&x->x_cua))
+ {
+ Node *actual;
+ int maxim = x->x_num_fil * x->x_num_col;
+ int contador = x->x_ultima_img + 1;
+
+ if (contador > maxim) {
+ contador = 0;
+ }
+ /* printf("\n contador %d i maxim %d i laultimaPOS %d \n", contador, maxim, x->x_ultima_img); */
+ /*
+ strcat(cadenaPaths, actual->pathFitxer);
+ strcat(cadenaPaths, "1|\n");
+ contador ++;
+ */
+ /* prenem el davanter de la cua */
+ actual=x->x_cua.davanter;
+
+ while(contador < numNodes(&x->x_cua)){
+ /* afegim els paths del davanter fins a l'ultim node al tauler */
+ strcat(cadenaPaths, actual->pathFitxer);
+ strcat(cadenaPaths, "|");
+ actual = actual->seguent;
+ contador ++;
+ }
+ if(actual != x->x_cua.final){
+ /* ara resten els de de l'inici del tauler fins al final de la cua */
+ while(actual != x->x_cua.final){
+ strcat(cadenaPathsInicials, actual->pathFitxer);
+ strcat(cadenaPathsInicials, "|");
+ actual = actual->seguent;
+ }
+ /* afegeix l'últim */
+ strcat(ultimPath, actual->pathFitxer);
+ strcat(ultimPath, "|");
+ /* afegeix l'ultim de la cua */
+ strcat(cadenaPathsInicials, ultimPath);
+ }else{
+ if(x->x_ultima_img == 0){
+ strcat(ultimPath, actual->pathFitxer);
+ strcat(ultimPath, "|");
+ strcat(cadenaPathsInicials, ultimPath);
+ }
+ }
+ /* ordena el paths segons aparicio en el tauler */
+ strcat(cadenaPathsInicials, cadenaPaths);
+ /* DE MOMENT NO DESA ELS PATHS */
+ strcat(cadenaPathsInicials, "");
+ /* printf("%s",cadenaPathsInicials); */
+ }
+
+ binbuf_addv(b, "ssiissiisss", gensym("#X"),gensym("obj"),
+ x->x_obj.te_xpix, x->x_obj.te_ypix,
+ gensym("videogrid"),x->x_name,x->x_num_fil,x->x_num_col,x->x_color_fons,x->x_color_marc,gensym(cadenaPathsInicials));
+ binbuf_addv(b, ";");
+}
+
+static void videogrid_properties(t_gobj *z, t_glist *owner)
+{
+ char buf[800];
+ t_videogrid *x=(t_videogrid *)z;
+
+ /* post("Es crida a pdtk_videogrid dialog passant nom = %s\n fils = %d \t cols = %d \t color fons = %s \t color marc = %s\n", x->x_name->s_name, x->x_num_fil, x->x_num_col, x->x_color_fons->s_name, x->x_color_marc->s_name); */
+ sprintf(buf, "pdtk_videogrid_dialog %%s %s %d %d %s %s\n",
+ x->x_name->s_name, x->x_num_fil, x->x_num_col, x->x_color_fons->s_name, x->x_color_marc->s_name);
+ /* post("videogrid_properties : %s", buf ); */
+ gfxstub_new(&x->x_obj.ob_pd, x, buf);
+}
+
+static void videogrid_dialog(t_videogrid *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int maxim, nfil, ncol, maxdigit;
+ if ( !x ) {
+ post("Videogrid: error_ intent de modificar le propietats d'un objecte inexistent\n");
+ }
+ if ( argc != 5 )
+ {
+ post("Videogrid: error_ sobre el nombre d'arguments ( 5 enlloc de %d )\n",argc);
+ return;
+ }
+ if (argv[0].a_type != A_SYMBOL || argv[1].a_type != A_FLOAT || argv[2].a_type != A_FLOAT || argv[3].a_type != A_SYMBOL || argv[4].a_type != A_SYMBOL)
+ {
+ post("Videogrid: error_ algun dels arguments no es del tipus adequat\n");
+ return;
+ }
+ x->x_name = argv[0].a_w.w_symbol;
+ nfil = (int)argv[1].a_w.w_float;
+ ncol = (int)argv[2].a_w.w_float;
+ x->x_color_fons = argv[3].a_w.w_symbol;
+ x->x_color_marc = argv[4].a_w.w_symbol;
+ /* el màxim es fixa pel nombre de digits utilitzats pel nom de la imatge temporal */
+ maxdigit = pow(10,BYTES_NUM_TEMP);
+ if((nfil*ncol) <= maxdigit){
+ if((nfil*ncol) > 0){
+ x->x_num_fil = nfil;
+ x->x_num_col = ncol;
+ }else{
+ post("Videogrid: El nombre de files i columnes són inferiors al mímin permès: 1 casella\n",maxdigit);
+ }
+ }else{
+ post("Videogrid: El nombre de files i columnes excedeixen del màxim permès: un total de %d caselles\n",maxdigit);
+ }
+
+ post("Videogrid: Valors modificats_ nom = %s\n fils = %d \t cols = %d\n", x->x_name->s_name, x->x_num_fil, x->x_num_col);
+ /* elimina els nodes no representables amb la nova configuració */
+ maxim = x->x_num_fil * x->x_num_col;
+ int extret;
+ videogrid_erase(x, x->x_glist);
+ /* si hi ha més nodes a la cua que el maxim */
+ while((numNodes(&x->x_cua)) > maxim){
+ /* desencuem */
+ extret = desencuar(&x->x_cua);
+ }
+ /* al reestablir el tamany del tauler cal saber la posició de l'últim element */
+ x->x_ultima_img = numNodes(&x->x_cua) - 1;
+ if (x->x_ultima_img < 0) x->x_ultima_img = 0;
+ x->x_tauler_primer = x->x_cua.davanter;
+ videogrid_drawme(x, x->x_glist, 1);
+}
+
+t_widgetbehavior videogrid_widgetbehavior;
+
+static void videogrid_setwidget(void)
+{
+ /* post("Entra a setwidget"); */
+ videogrid_widgetbehavior.w_getrectfn = videogrid_getrect;
+ videogrid_widgetbehavior.w_displacefn = videogrid_displace;
+ videogrid_widgetbehavior.w_selectfn = videogrid_select;
+ videogrid_widgetbehavior.w_activatefn = NULL;
+ videogrid_widgetbehavior.w_deletefn = videogrid_delete;
+ videogrid_widgetbehavior.w_visfn = videogrid_vis;
+ /* clic del ratoli */
+ videogrid_widgetbehavior.w_clickfn = videogrid_click;
+
+#if PD_MINOR_VERSION < 37
+ videogrid_widgetbehavior.w_savefn = videogrid_save;
+ videogrid_widgetbehavior.w_propertiesfn = videogrid_properties;
+#endif
+
+}
+
+/* el constructor de la classe*/
+static void *videogrid_new(t_symbol* name, int argc, t_atom *argv)
+{
+ /* instanciació del nou objecte */
+ t_videogrid *x = (t_videogrid *)pd_new(videogrid_class);
+ /* crea una sortida per l'objecte*/
+ x->x_sortida = outlet_new(&x->x_obj,&s_symbol);
+ /* s'obté el canvas de pd */
+ x->x_glist = (t_glist*) canvas_getcurrent();
+
+ /* posició en el tauler de la última imatge afegida */
+ x->x_ultima_img = 0;
+ /* posició de l'últim fitxer del directori encuat */
+ x->x_dir_pos = 0;
+ /* apuntador al primer element en el tauler */
+ x->x_tauler_primer = NULL;
+ /* fixa el nom de l'objecte */
+ char nom[15];
+ sprintf(nom, "videogrid%d", ++videogridcount);
+ name = gensym(nom);
+ x->x_name = name;
+ /* amb aquest nom es prepara per poder rebre dades */
+ pd_bind(&x->x_obj.ob_pd, x->x_name);
+ /* crea la cua de nodes */
+ crearCua(&x->x_cua);
+ post("NOU videogrid: s'han entrat %d arguments\n", argc);
+
+ if (argc != 0)
+ {
+ post("NOU videogrid: s'obre un objecte existent o amb arguments definits\n");
+ /* x->x_name */
+ x->x_num_fil = (int)atom_getintarg(1, argc, argv);
+ x->x_num_col = (int)atom_getintarg(2, argc, argv);
+ x->x_color_fons = argv[3].a_w.w_symbol;
+ x->x_color_marc = argv[4].a_w.w_symbol;
+ post("!!!NOU videogrid: s'han entrat %d arguments\n", argc);
+ if(argc == 6){
+ /* llegir la cadena de paths | afegir els paths a la cua */
+ char *cadenaPaths;
+ cadenaPaths = (char *)malloc(51200*sizeof(char));
+ strcpy(cadenaPaths,(char *)argv[5].a_w.w_symbol->s_name);
+ /* printf("Es carreguen els paths %s --- %s **** %s\n", cadenaPaths, argv[5].a_w.w_symbol->s_name,argv[3].a_w.w_symbol->s_name); */
+ /* split */
+
+ char *token;
+ t_symbol *tt;
+ for ( token = strtok(argv[5].a_w.w_symbol->s_name,"|");
+ token != NULL;
+ token = strtok(NULL,"|") ){
+ tt = gensym(token);
+
+ /* printf("AFEGINT CARREGANT %s\n",tt->s_name); */
+ /* videogrid_putvideo(x,tt); */
+ /* DE MOMENT NO AFEGEIX ELS PATHS */
+ /* videogrid_afegir_imatge(x,tt->s_name); */
+ }
+ /*
+ token = strtok(cadenaPaths,"|");
+ while(token){
+ tt = gensym(token);
+ printf("AFEGINT CARREGANT %s\n",tt->s_name);
+ videogrid_putvideo(x,tt);
+ token = strtok(NULL,"|");
+ }
+ */
+ free(cadenaPaths);
+ }
+ }else{
+ /* crea un objecte nou */
+ post("NOU videogrid: es crea un objecte nou\n");
+ /* fixa el nombre de files */
+ x->x_num_fil = 3;
+ /* fixa el nombre de columnes */
+ x->x_num_col = 5;
+
+ /* colors de fons i de marc*/
+ x->x_color_fons = gensym("#F0F0F0");
+ x->x_color_marc = gensym("#0F0F0F");
+ }
+ /* printf("S'ha instanciat un videogrid anomenat %s amb les caracteristiques seguents:",x->x_name->s_name);
+ printf("Nombre de files %d - Nombre de columnes: %d", x->x_num_fil, x->x_num_col); */
+
+ return (x);
+}
+
+static void videogrid_destroy(t_videogrid *x){
+ /* elimina el contingut de la cua */
+ eliminarCua(&x->x_cua);
+ post("Videogrid eliminat");
+}
+
+/* generacio d'una nova classe */
+/* al carregar la nova llibreria my_lib pd intenta cridar la funció my_lib_setup */
+/* aquesta crea la nova classe i les seves propietats només un sol cop */
+
+void videogrid_setup(void)
+{
+ /* post("Entra a setup per generar la classe videogrid"); */
+ #include "videogrid.tk2c"
+ /*
+ sense pas d'arguments
+ videogrid_class = class_new(gensym("videogrid"),
+ (t_newmethod)videogrid_new,
+ (t_method)videogrid_destroy,
+ sizeof(t_videogrid),
+ CLASS_DEFAULT,
+ A_DEFSYM,
+ 0);
+ amb pas d'arguments:
+ */
+ videogrid_class = class_new(gensym("videogrid"),
+ (t_newmethod)videogrid_new,
+ (t_method)videogrid_destroy,
+ sizeof(t_videogrid),
+ CLASS_DEFAULT,
+ A_GIMME,
+ 0);
+ /* class_new crea la nova classe retornant un punter al seu prototipus,
+ el primer argument es el nom simbolic de la classe,
+ el segon i tercer corresponen al constructor i destructor de la classe respectivament,
+ (el constructor instancia un objecte i inicialitza les seves dades cada cop que es crea un objecte
+ el destructor allibera la memoria reservada al destruid l'objecte per qualsevol causa)
+ el quart correspon a la mida de l'estructura de dades, per tal de poder reservar la memoria necessària,
+ el cinquè influeix en el mòde de representació gràfica del objectes. Per defecte CLASS_DEFAULT o ``0',
+ la resta d'arguments defineixen els arguments de l'objecte i el seu tipus, la llista acaba amb 0
+ */
+
+ /* afegeix el mètode helloworld_bang a la classe helloworld_class */
+ class_addbang(videogrid_class, videogrid_bang);
+
+ /* afegeix el mètode videogrid_putvideo a la classe videogrid per a entrades de missatge
+ que inicien amb putvideo i una cadena string com a argument */
+ class_addmethod(videogrid_class,(t_method)videogrid_putvideo,gensym("putvideo"), A_DEFSYMBOL, 0);
+
+ /* afegeix el mètode videogrid_putvideodir a la classe videogrid per a entrades de missatge
+ que inicien amb putvideodir i una cadena string com a argument */
+ class_addmethod(videogrid_class,(t_method)videogrid_putvideodir,gensym("putvideodir"), A_DEFSYMBOL, 0);
+ /* afegeix un metode per a modificar el valor de les propietats de l'objecte */
+ class_addmethod(videogrid_class, (t_method)videogrid_dialog, gensym("dialog"), A_GIMME, 0);
+ /* afegeix un metode per l'obtencio de la posicio del clic del ratolí */
+ class_addmethod(videogrid_class, (t_method)videogrid_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
+ /* inicia el comportament de videogrid */
+ videogrid_setwidget();
+
+#if PD_MINOR_VERSION >= 37
+ class_setsavefn(videogrid_class,&videogrid_save);
+ class_setpropertiesfn(videogrid_class, videogrid_properties);
+#endif
+
+ /* afegeix el mètode videogrid_widgetbehavior al la classe videogrid per a la creació de l'element visual */
+ class_setwidget(videogrid_class,&videogrid_widgetbehavior);
+ class_sethelpsymbol(videogrid_class, gensym("videogrid.pd"));
+}
diff --git a/videogrid/videogrid.tk b/videogrid/videogrid.tk
new file mode 100644
index 0000000..9505b6b
--- /dev/null
+++ b/videogrid/videogrid.tk
@@ -0,0 +1,146 @@
+############ procediments per videogrid -- slario(at)gmail.com [a partir del codi del grid de l'Ives: ydegoyon(at)free.fr] #########
+
+proc videogrid_apply {id} {
+# strip "." from the TK id to make a variable name suffix
+ set vid [string trimleft $id .]
+
+# for each variable, make a local variable to hold its name...
+ set var_graph_name [concat graph_name_$vid]
+ global $var_graph_name
+ set var_graph_num_fil [concat graph_num_fil_$vid]
+ global $var_graph_num_fil
+ set var_graph_num_col [concat graph_num_col_$vid]
+ global $var_graph_num_col
+ set var_graph_color_fons [concat graph_color_fons_$vid]
+ global $var_graph_color_fons
+ set var_graph_color_marc [concat graph_color_marc_$vid]
+ global $var_graph_color_marc
+
+
+ set cmd [concat $id dialog \
+ [eval concat $$var_graph_name] \
+ [eval concat $$var_graph_num_fil] \
+ [eval concat $$var_graph_num_col] \
+ [eval concat $$var_graph_color_fons] \
+ [eval concat $$var_graph_color_marc] \
+ \;]
+#puts stderr $cmd
+ pd $cmd
+}
+
+proc videogrid_cancel {id} {
+ set cmd [concat $id cancel \;]
+#puts stderr $cmd
+ pd $cmd
+}
+
+proc videogrid_ok {id} {
+ videogrid_apply $id
+ videogrid_cancel $id
+}
+
+proc pdtk_videogrid_dialog {id name num_fil num_col color_fons color_marc} {
+ set vid [string trimleft $id .]
+ set var_graph_name [concat graph_name_$vid]
+ global $var_graph_name
+ set var_graph_num_fil [concat graph_num_fil_$vid]
+ global $var_graph_num_fil
+ set var_graph_num_col [concat graph_num_col_$vid]
+ global $var_graph_num_col
+ set var_graph_color_fons [concat graph_color_fons_$vid]
+ global $var_graph_color_fons
+ set var_graph_color_marc [concat graph_color_marc_$vid]
+ global $var_graph_color_marc
+
+ set $var_graph_name $name
+ set $var_graph_num_fil $num_fil
+ set $var_graph_num_col $num_col
+ set $var_graph_color_fons $color_fons
+ set $var_graph_color_marc $color_marc
+
+ toplevel $id
+ wm title $id {videogrid}
+ wm protocol $id WM_DELETE_WINDOW [concat videogrid_cancel $id]
+
+ label $id.label -text {VIDEOGRID PROPERTIES}
+ pack $id.label -side top
+
+ frame $id.buttonframe
+ pack $id.buttonframe -side bottom -fill x -pady 2m
+ button $id.buttonframe.cancel -text {Cancel}\
+ -command "videogrid_cancel $id"
+ button $id.buttonframe.apply -text {Apply}\
+ -command "videogrid_apply $id"
+ button $id.buttonframe.ok -text {OK}\
+ -command "videogrid_ok $id"
+ pack $id.buttonframe.cancel -side left -expand 1
+ pack $id.buttonframe.apply -side left -expand 1
+ pack $id.buttonframe.ok -side left -expand 1
+
+ frame $id.1rangef
+ pack $id.1rangef -side top
+ label $id.1rangef.lname -text "Nom :"
+ entry $id.1rangef.name -textvariable $var_graph_name -width 7
+ pack $id.1rangef.lname $id.1rangef.name -side left
+
+ frame $id.2rangef
+ pack $id.2rangef -side top
+ label $id.2rangef.lnum_fil -text "Fils :"
+ entry $id.2rangef.num_fil -textvariable $var_graph_num_fil -width 7
+ pack $id.2rangef.lnum_fil $id.2rangef.num_fil -side left
+
+ frame $id.3rangef
+ pack $id.3rangef -side top
+ label $id.3rangef.lnum_col -text "Cols :"
+ entry $id.3rangef.num_col -textvariable $var_graph_num_col -width 7
+ pack $id.3rangef.lnum_col $id.3rangef.num_col -side left
+
+ frame $id.4rangef
+ pack $id.4rangef -side top
+ label $id.4rangef.lcolor_fons -text "Color fons :"
+ entry $id.4rangef.color_fons -textvariable $var_graph_color_fons -width 7
+ pack $id.4rangef.lcolor_fons $id.4rangef.color_fons -side left
+
+ frame $id.5rangef
+ pack $id.5rangef -side top
+ label $id.5rangef.lcolor_marc -text "Color marc :"
+ entry $id.5rangef.color_marc -textvariable $var_graph_color_marc -width 7
+ pack $id.5rangef.lcolor_marc $id.5rangef.color_marc -side left
+
+
+ bind $id.1rangef.name <KeyPress-Return> [concat videogrid_ok $id]
+ bind $id.2rangef.num_fil <KeyPress-Return> [concat videogrid_ok $id]
+ bind $id.3rangef.num_col <KeyPress-Return> [concat videogrid_ok $id]
+ bind $id.4rangef.color_fons <KeyPress-Return> [concat videogrid_ok $id]
+ bind $id.5rangef.color_marc <KeyPress-Return> [concat videogrid_ok $id]
+
+ focus $id.1rangef.name
+}
+
+proc table {w content args} {
+ frame $w -bg black
+ set r 0
+ foreach row $content {
+ set fields {}
+ set c 0
+ foreach col $row {
+ # lappend fields [label $w.$r/$c -text $col]
+ set img [image create photo -file $col]
+ lappend fields [label $w.$r/$c -image $img]
+ incr c
+ }
+ eval grid $fields -sticky news -padx 1 -pady 1
+ incr r
+ }
+ set w
+}
+
+proc pdtk_videogrid_table {id name num_fil num_col} {
+ table .tauler {
+ {sll80x60.gif 3160x120.gif sll80x60.gif}
+ {sll80x60.gif sll80x60.gif sll80x60.gif}
+ {sll80x60.ppm sll80x60.gif 3160x120.gif}
+ }
+ pack .tauler
+}
+############ FINAL procediments per videogrid -- slario(at)gmail.com [a partir del codi del grid de l'Ives: ydegoyon(at)free.fr] ######### \ No newline at end of file
diff --git a/videogrid/videogrid.tk2c b/videogrid/videogrid.tk2c
new file mode 100644
index 0000000..69aa210
--- /dev/null
+++ b/videogrid/videogrid.tk2c
@@ -0,0 +1,115 @@
+// ########### procediments per videogrid -- slario(at)gmail.com [a partir del codi del grid de l'Ives: ydegoyon(at)free.fr] #########
+sys_gui("proc videogrid_apply {id} {\n");
+// strip "." from the TK id to make a variable name suffix
+sys_gui("set vid [string trimleft $id .]\n");
+// for each variable, make a local variable to hold its name...
+sys_gui("set var_graph_name [concat graph_name_$vid]\n");
+sys_gui("global $var_graph_name\n");
+sys_gui("set var_graph_num_fil [concat graph_num_fil_$vid]\n");
+sys_gui("global $var_graph_num_fil\n");
+sys_gui("set var_graph_num_col [concat graph_num_col_$vid]\n");
+sys_gui("global $var_graph_num_col\n");
+sys_gui("set var_graph_color_fons [concat graph_color_fons_$vid]\n");
+sys_gui("global $var_graph_color_fons\n");
+sys_gui("set var_graph_color_marc [concat graph_color_marc_$vid]\n");
+sys_gui("global $var_graph_color_marc\n");
+sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_name] [eval concat $$var_graph_num_fil] [eval concat $$var_graph_num_col] [eval concat $$var_graph_color_fons] [eval concat $$var_graph_color_marc] \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc videogrid_cancel {id} {\n");
+sys_gui("set cmd [concat $id cancel \\;]\n");
+// puts stderr $cmd
+sys_gui("pd $cmd\n");
+sys_gui("}\n");
+sys_gui("proc videogrid_ok {id} {\n");
+sys_gui("videogrid_apply $id\n");
+sys_gui("videogrid_cancel $id\n");
+sys_gui("}\n");
+sys_gui("proc pdtk_videogrid_dialog {id name num_fil num_col color_fons color_marc} {\n");
+sys_gui("set vid [string trimleft $id .]\n");
+sys_gui("set var_graph_name [concat graph_name_$vid]\n");
+sys_gui("global $var_graph_name\n");
+sys_gui("set var_graph_num_fil [concat graph_num_fil_$vid]\n");
+sys_gui("global $var_graph_num_fil\n");
+sys_gui("set var_graph_num_col [concat graph_num_col_$vid]\n");
+sys_gui("global $var_graph_num_col\n");
+sys_gui("set var_graph_color_fons [concat graph_color_fons_$vid]\n");
+sys_gui("global $var_graph_color_fons\n");
+sys_gui("set var_graph_color_marc [concat graph_color_marc_$vid]\n");
+sys_gui("global $var_graph_color_marc\n");
+sys_gui("set $var_graph_name $name\n");
+sys_gui("set $var_graph_num_fil $num_fil\n");
+sys_gui("set $var_graph_num_col $num_col\n");
+sys_gui("set $var_graph_color_fons $color_fons\n");
+sys_gui("set $var_graph_color_marc $color_marc\n");
+sys_gui("toplevel $id\n");
+sys_gui("wm title $id {videogrid}\n");
+sys_gui("wm protocol $id WM_DELETE_WINDOW [concat videogrid_cancel $id]\n");
+sys_gui("label $id.label -text {VIDEOGRID PROPERTIES}\n");
+sys_gui("pack $id.label -side top\n");
+sys_gui("frame $id.buttonframe\n");
+sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n");
+sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"videogrid_cancel $id\"\n");
+sys_gui("button $id.buttonframe.apply -text {Apply} -command \"videogrid_apply $id\"\n");
+sys_gui("button $id.buttonframe.ok -text {OK} -command \"videogrid_ok $id\"\n");
+sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.apply -side left -expand 1\n");
+sys_gui("pack $id.buttonframe.ok -side left -expand 1\n");
+sys_gui("frame $id.1rangef\n");
+sys_gui("pack $id.1rangef -side top\n");
+sys_gui("label $id.1rangef.lname -text \"Nom :\"\n");
+sys_gui("entry $id.1rangef.name -textvariable $var_graph_name -width 7\n");
+sys_gui("pack $id.1rangef.lname $id.1rangef.name -side left\n");
+sys_gui("frame $id.2rangef\n");
+sys_gui("pack $id.2rangef -side top\n");
+sys_gui("label $id.2rangef.lnum_fil -text \"Fils :\"\n");
+sys_gui("entry $id.2rangef.num_fil -textvariable $var_graph_num_fil -width 7\n");
+sys_gui("pack $id.2rangef.lnum_fil $id.2rangef.num_fil -side left\n");
+sys_gui("frame $id.3rangef\n");
+sys_gui("pack $id.3rangef -side top\n");
+sys_gui("label $id.3rangef.lnum_col -text \"Cols :\"\n");
+sys_gui("entry $id.3rangef.num_col -textvariable $var_graph_num_col -width 7\n");
+sys_gui("pack $id.3rangef.lnum_col $id.3rangef.num_col -side left\n");
+sys_gui("frame $id.4rangef\n");
+sys_gui("pack $id.4rangef -side top\n");
+sys_gui("label $id.4rangef.lcolor_fons -text \"Color fons :\"\n");
+sys_gui("entry $id.4rangef.color_fons -textvariable $var_graph_color_fons -width 7\n");
+sys_gui("pack $id.4rangef.lcolor_fons $id.4rangef.color_fons -side left\n");
+sys_gui("frame $id.5rangef\n");
+sys_gui("pack $id.5rangef -side top\n");
+sys_gui("label $id.5rangef.lcolor_marc -text \"Color marc :\"\n");
+sys_gui("entry $id.5rangef.color_marc -textvariable $var_graph_color_marc -width 7\n");
+sys_gui("pack $id.5rangef.lcolor_marc $id.5rangef.color_marc -side left\n");
+sys_gui("bind $id.1rangef.name <KeyPress-Return> [concat videogrid_ok $id]\n");
+sys_gui("bind $id.2rangef.num_fil <KeyPress-Return> [concat videogrid_ok $id]\n");
+sys_gui("bind $id.3rangef.num_col <KeyPress-Return> [concat videogrid_ok $id]\n");
+sys_gui("bind $id.4rangef.color_fons <KeyPress-Return> [concat videogrid_ok $id]\n");
+sys_gui("bind $id.5rangef.color_marc <KeyPress-Return> [concat videogrid_ok $id]\n");
+sys_gui("focus $id.1rangef.name\n");
+sys_gui("}\n");
+sys_gui("proc table {w content args} {\n");
+sys_gui("frame $w -bg black\n");
+sys_gui("set r 0\n");
+sys_gui("foreach row $content {\n");
+sys_gui("set fields {}\n");
+sys_gui("set c 0\n");
+sys_gui("foreach col $row {\n");
+// lappend fields [label $w.$r/$c -text $col]
+sys_gui("set img [image create photo -file $col]\n");
+sys_gui("lappend fields [label $w.$r/$c -image $img]\n");
+sys_gui("incr c\n");
+sys_gui("}\n");
+sys_gui("eval grid $fields -sticky news -padx 1 -pady 1\n");
+sys_gui("incr r\n");
+sys_gui("}\n");
+sys_gui("set w\n");
+sys_gui("}\n");
+sys_gui("proc pdtk_videogrid_table {id name num_fil num_col} {\n");
+sys_gui("table .tauler {\n");
+sys_gui("{sll80x60.gif 3160x120.gif sll80x60.gif}\n");
+sys_gui("{sll80x60.gif sll80x60.gif sll80x60.gif}\n");
+sys_gui("{sll80x60.ppm sll80x60.gif 3160x120.gif}\n");
+sys_gui("}\n");
+sys_gui("pack .tauler\n");
+sys_gui("}\n");