[Gridflow-cvs] [svn] commit: r6120 - in /trunk: doc/flow_classes/gridflow-help.pd src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sun Aug 15 15:26:16 EDT 2010


Author: matju
Date: Sun Aug 15 15:26:14 2010
New Revision: 6120

Log:
[gridflow]: add 'os' attribute and add doc for 'folder' attribute

Modified:
    trunk/doc/flow_classes/gridflow-help.pd
    trunk/src/classes2.cxx

Modified: trunk/doc/flow_classes/gridflow-help.pd
==============================================================================
--- trunk/doc/flow_classes/gridflow-help.pd (original)
+++ trunk/doc/flow_classes/gridflow-help.pd Sun Aug 15 15:26:14 2010
@@ -1,15 +1,15 @@
-#N canvas 0 0 632 388 10;
+#N canvas 0 0 632 642 10;
 #X obj 101 75 gridflow;
 #X msg 101 56 get;
 #X obj 0 0 doc_h;
-#X obj 0 359 doc_f;
+#X obj 0 675 doc_f;
 #X obj 3 156 doc_c 0;
 #X obj 3 196 doc_i 1;
 #X obj 3 297 doc_o 1;
 #X obj 101 94 print;
 #X obj 14 226 doc_ii 0;
 #X obj 97 226 doc_m i0 get;
-#X text 232 226 get version: outputs a version message with three elements.
+#X text 232 584 get version: outputs a version message with three elements.
 the former leading 0 is not included. GridFlow 9.9 is reported as 9
 9 0 \, the trailing zero being there just in case there are any subreleases
 anytime in the future.;
@@ -19,9 +19,36 @@
 -lib option. (see also [import] \, the Path menu \, the Startup menu
 \, pdrc \, pdsettings \, etc.);
 #X obj 14 327 doc_oo 0;
-#X obj 97 327 doc_m o0 version;
-#X text 232 327 from "get".;
+#X obj 97 584 doc_m o0 version;
+#X obj 3 655 doc_also;
+#X text 232 226 get any attribute listed under "outlet 0". the name
+of the attribute can be given as a \$1 if only that attribute is wanted.
+if there are no arguments \, all attributes are output.;
+#X obj 97 327 doc_m o0 folder;
+#X text 232 327 the main folder of the currently loaded GridFlow library.
+this is a folder named 'gridflow' inside a folder found in -path. (unless
+you didn't install correctly \, in which case some things won't work
+correctly \, anyway).;
+#X obj 97 388 doc_m o0 os;
+#X text 232 388 "win32" indicates a MS Windows system (with MinGW layer
+for partial posix emulation);
+#X text 232 423 "darwin" indicates a MacOS 10 ("Darwin") system. This
+has native posix support except for some features that GF doesn't use
+directly (such as libdl). This does not normally run X11 (though some
+apps may... Pd-OSX does not require X11 since 2004 or so). Lots of
+typical linux components are available as part of the base OS \, or
+on the developers tools CD \, or in FINK \, or in MacPorts.;
+#X text 232 523 "linux" indicates a Linux system \, FreeBSD system
+\, or other. This is currently including anything except "win32" and
+"darwin". If you need this to be more specific \, contact gridflow-dev.
+;
+#X obj 103 655 gf/class_info;
 #X connect 0 0 7 0;
 #X connect 1 0 0 0;
-#X connect 9 1 10 0;
-#X connect 14 1 15 0;
+#X connect 9 1 16 0;
+#X connect 14 1 10 0;
+#X connect 15 1 23 0;
+#X connect 17 1 18 0;
+#X connect 19 1 20 0;
+#X connect 19 1 21 0;
+#X connect 19 1 22 0;

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Sun Aug 15 15:26:14 2010
@@ -110,11 +110,11 @@
 	int ac = env->ce_argc;
 	t_atom2 av[ac];
 	for (int i=0; i<ac; i++) av[i] = env->ce_argv[i];
-	//ac = handle_braces(ac,av);
+	//ac = handle_parens(ac,av);
 	t_symbol *comma = gensym(",");
 	int j;
 	for (j=0; j<ac; j++) if (av[j].a_type==A_SYMBOL && av[j]==comma) break;
-	int jj = handle_braces(j,av);
+	int jj = handle_parens(j,av);
 	process_args(jj,av);
 	while (j<ac) {
 		j++;
@@ -141,11 +141,9 @@
 		if (sargv[i].name==wildcard) {
 			if (argc-i>0) out[i](argc-i,argv+i); else out[i]();
 		} else {
-			if (v->a_type==A_LIST) {
-				t_binbuf *b = *v;
-				out[i](binbuf_getnatom(b),binbuf_getvec(b));
-			} else if (v->a_type==A_SYMBOL) out[i](*v);
-			else outlet_anything2(out[i],1,v);
+			if      (v->a_type==A_LIST)   {t_binbuf *b = *v; out[i](binbuf_getnatom(b),binbuf_getvec(b));}
+			else if (v->a_type==A_SYMBOL) out[i](*v);
+			else                          outlet_anything2(out[i],1,v);
 		}
 	}
 	if (argc>sargc && sargv[sargc-1].name!=wildcard) pd_error(canvas,"warning: too many args (got %d, want %d)", argc, sargc);
@@ -1142,12 +1140,18 @@
 \class GridFlowClass : FObject {
 	\constructor () {}
 	\decl 0 get (t_symbol *s=0) {
-		if (!s) {
-			_0_get(gensym("version"));
-			_0_get(gensym("folder"));
-		}
+		if (!s) {_0_get(gensym("version"));_0_get(gensym("folder"));_0_get(gensym("os"));}
 		if (s==gensym("version")) {t_atom2 a[3] = {GF_VERSION_A,GF_VERSION_B,GF_VERSION_C}; out[0](s,3,a);}
-		if (s==gensym("folder")) {t_atom2 a[1] = {gridflow_folder}; out[0](s,1,a);}
+		if (s==gensym("folder"))  {t_atom2 a[1] = {gridflow_folder}; out[0](s,1,a);}
+		#ifdef __WIN32__
+		if (s==gensym("os")) {t_atom2 a[1] = {"win32"};  out[0](s,1,a);}
+		#else
+		#ifdef MACOSX
+		if (s==gensym("os")) {t_atom2 a[1] = {"darwin"}; out[0](s,1,a);}
+		#else
+		if (s==gensym("os")) {t_atom2 a[1] = {"linux"}; out[0](s,1,a);} // or other
+		#endif
+		#endif
 	}
 };
 \end class {install("gridflow",1,1);}



More information about the Gridflow-cvs mailing list