[Gridflow-cvs] [svn] commit: r5801 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue Jul 27 21:10:56 EDT 2010


Author: matju
Date: Tue Jul 27 21:10:54 2010
New Revision: 5801

Log:
add [gf/propertybang]

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Tue Jul 27 21:10:54 2010
@@ -1529,7 +1529,6 @@
 	\decl void anything (...) {outlet_symbol(outlets[0],gensym(argv[0].a_symbol->s_name+3));}
 };
 \end class {install("gf/selector",1,1);}
-extern "C" void canvas_properties(t_gobj *z, t_glist *owner);
 
 \class FindFile : FObject {
 	int n;
@@ -1593,6 +1592,26 @@
 };
 \end class {install("gridflow",1,1);}
 
+std::map<t_canvas *, t_gobj *> propertybang_map;
+\class PropertyBang : FObject {
+	\constructor () {propertybang_map[mom] = (t_gobj *)bself;}
+	~PropertyBang () {propertybang_map.erase(mom);}
+	void properties () {outlet_bang(outlets[0]);}
+};
+extern "C" void canvas_properties(t_gobj *z, t_glist *owner);
+void canvas_properties2(t_gobj *z, t_glist *owner) {
+	typeof(propertybang_map.end()) it = propertybang_map.find((t_canvas *)z);
+	if (it == propertybang_map.end()) post("pas nous autres");
+	else {
+		BFObject *bf = (BFObject *)it->second;
+		((PropertyBang *)bf->self)->properties();
+	}
+}
+\end class {
+	install("gf/propertybang",1,1);
+	class_setpropertiesfn(canvas_class,canvas_properties2);
+}
+
 void startup_flow_objects2 () {
 	\startall
 }



More information about the Gridflow-cvs mailing list