[Gridflow-cvs] [svn] commit: r5967 - in /trunk/src: gridflow.cxx gridflow.hxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Thu Aug 5 01:42:54 EDT 2010


Author: matju
Date: Thu Aug  5 01:42:53 2010
New Revision: 5967

Log:
allow GF classes to specify flags; begin code for registering keyboard shortcuts for Put menu items

Modified:
    trunk/src/gridflow.cxx
    trunk/src/gridflow.hxx

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Thu Aug  5 01:42:53 2010
@@ -808,12 +808,12 @@
 	if (fclass->startup) fclass->startup(fclass);
 }
 
-void install2(FClass *fclass, const char *name, int inlets, int outlets) {
+void install2(FClass *fclass, const char *name, int inlets, int outlets, int flags) {
 	fclass->ninlets = inlets;
 	fclass->noutlets = outlets;
 	fclass->name = string(name);
 	fclass->bfclass = class_new(gensym((char *)name), (t_newmethod)BFObject_new, (t_method)BFObject_delete,
-		sizeof(BFObject), CLASS_DEFAULT, A_GIMME,0);
+		sizeof(BFObject), flags, A_GIMME,0);
 	fclasses[string(name)] = fclass;
 	fclasses_pd[fclass->bfclass] = fclass;
 	t_class *b = fclass->bfclass;
@@ -1123,15 +1123,21 @@
 		"proc gridflow_add_to_put {menu} {\n"
 		  "set c [regsub .m.put $menu \"\"]\n"
  		  "$menu add separator\n"
-		  "$menu add command -label {Display} -command [list pd $c put display \\;]\n"
+		  "$menu add command -label {Display} -command [list pd $c put display \\;]\n" //  -accelerator [accel_munge Shift+Ctrl+p]
 		  "$menu add command -label {GridSee} -command [list pd $c put \\#see  \\;]\n"
 		"}\n"
 		"catch {gridflow_add_to_help .mbar.help}\n"
 		"catch {gridflow_add_to_help $::pd_menus::menubar.help; proc pd {args} {pdsend [join $args " "]}}\n"
 		"catch {rename menu_addstd menu_addstd_old\n"
 		  "proc menu_addstd {mbar} {menu_addstd_old $mbar; gridflow_add_to_help $mbar.help\n"
-		  "gridflow_add_to_put $mbar.put"
-		"}}\n");
+		    "gridflow_add_to_put $mbar.put"
+		"}}\n"
+		/*"catch {rename pdtk_canvas_ctrlkey pdtk_canvas_ctrlkey_old\n"
+		  "proc pdtk_canvas_ctrlkey {name key shift} {"
+		    "if {$shift && ($key==\"p\"||$key==\"P\"} {}"
+		    "pdtk_canvas_ctrlkey_old $name $key $shift"
+		"}\n"*/
+		);
 	delete[] dirresult;
 	delete[] dirname;
     } catch (Barf &oozy) {oozy.error(0,-1,(char *)0);}

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Thu Aug  5 01:42:53 2010
@@ -829,8 +829,8 @@
 			RAISE("mismatch: left dim #%d is %d, right dim #%d is %d", ai+i, a[ai+i], bi+i, b[bi+i]);}
 
 void suffixes_are (const char *name, const char *suffixes);
-#define install(name,inlets,outlets) install2(fclass,name,inlets,outlets)
-void install2(FClass *fclass, const char *name, int inlets, int outlets);
+#define install(A,B,C...) install2(fclass,A,B,C)
+void install2(FClass *fclass, const char *name, int inlets, int outlets, int flags=CLASS_DEFAULT);
 #define add_creator(name) add_creator2(fclass,name)
 void add_creator2(FClass *fclass, const char *name);
 void add_creator3(FClass *fclass, const char *name);



More information about the Gridflow-cvs mailing list