[PD-cvs] externals/grill/flext/source flatom_pr.cpp,1.15,1.16 flattr_ed.cpp,1.17,1.18 flstdc.h,1.18,1.19

xovo at users.sourceforge.net xovo at users.sourceforge.net
Sun Feb 8 04:36:27 CET 2004


Update of /cvsroot/pure-data/externals/grill/flext/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10893/source

Modified Files:
	flatom_pr.cpp flattr_ed.cpp flstdc.h 
Log Message:
 ""

Index: flatom_pr.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flatom_pr.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** flatom_pr.cpp	12 Dec 2003 22:46:40 -0000	1.15
--- flatom_pr.cpp	8 Feb 2004 03:36:25 -0000	1.16
***************
*** 3,7 ****
  flext - C++ layer for Max/MSP and pd (pure data) externals
  
! Copyright (c) 2001-2003 Thomas Grill (xovo at gmx.net)
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "license.txt," in this distribution.  
--- 3,7 ----
  flext - C++ layer for Max/MSP and pd (pure data) externals
  
! Copyright (c) 2001-2004 Thomas Grill (xovo at gmx.net)
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "license.txt," in this distribution.  
***************
*** 30,34 ****
  	}
  	else if(IsSymbol(a)) {
! 		STD::strcpy(buf,GetString(a));
  	}
  	else if(IsPointer(a)) {
--- 30,36 ----
  	}
  	else if(IsSymbol(a)) {
!         if(!FLEXT_ASSERT(GetSymbol(a))) *buf = 0;
!         else 
!             STD::strcpy(buf,GetString(a));
  	}
  	else if(IsPointer(a)) {

Index: flattr_ed.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flattr_ed.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** flattr_ed.cpp	20 Jan 2004 03:32:56 -0000	1.17
--- flattr_ed.cpp	8 Feb 2004 03:36:25 -0000	1.18
***************
*** 3,7 ****
  flext - C++ layer for Max/MSP and pd (pure data) externals
  
! Copyright (c) 2001-2003 Thomas Grill (xovo at gmx.net)
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "license.txt," in this distribution.  
--- 3,7 ----
  flext - C++ layer for Max/MSP and pd (pure data) externals
  
! Copyright (c) 2001-2004 Thomas Grill (xovo at gmx.net)
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "license.txt," in this distribution.  
***************
*** 84,99 ****
  
  			// make a list of the attribute values (including save flags)
  			"set lst {}\n"
  			"for {set ix 1} {$ix <= $alen} {incr ix} {\n"
  				"set var_attr_name [concat [concat var_name_$ix]_$vid ]\n"
- 				"global $var_attr_name\n"
  				"set var_attr_init [concat [concat var_init_$ix]_$vid ]\n"
- 				"global $var_attr_init\n"
  				"set var_attr_val [concat [concat var_val_$ix]_$vid ]\n"
- 				"global $var_attr_val\n"
  				"set var_attr_save [concat [concat var_save_$ix]_$vid ]\n"
- 				"global $var_attr_save\n"
  				"set var_attr_type [concat [concat var_type_$ix]_$vid ]\n"
! 				"global $var_attr_type\n"
  		
  				"if { [expr $$var_attr_type] != 0 } {\n"
--- 84,97 ----
  
  			// make a list of the attribute values (including save flags)
+ 
  			"set lst {}\n"
  			"for {set ix 1} {$ix <= $alen} {incr ix} {\n"
  				"set var_attr_name [concat [concat var_name_$ix]_$vid ]\n"
  				"set var_attr_init [concat [concat var_init_$ix]_$vid ]\n"
  				"set var_attr_val [concat [concat var_val_$ix]_$vid ]\n"
  				"set var_attr_save [concat [concat var_save_$ix]_$vid ]\n"
  				"set var_attr_type [concat [concat var_type_$ix]_$vid ]\n"
! 
! 				"global $var_attr_name $var_attr_init $var_attr_val $var_attr_save $var_attr_type\n"
  		
  				"if { [expr $$var_attr_type] != 0 } {\n"
***************
*** 103,123 ****
  
  					// process current value
! 					"set len [llength [expr $$var_attr_val]]\n"
  					"if { $len == 1 } {\n"
  						// it's an atom
! 						"lappend lst [expr $$var_attr_val]\n" 
  					"} else {\n"
  						// it's a list
! 						"set lst [concat $lst {list} $len [expr $$var_attr_val]]\n" 
  					"}\n"
  
  					// process init value
! 					"set len [llength [expr $$var_attr_init]]\n"
  					"if { $len == 1 } {\n"
  						// it's an atom
! 						"lappend lst [expr $$var_attr_init]\n" 
  					"} else {\n"
  						// it's a list
! 						"set lst [concat $lst {list} $len [expr $$var_attr_init]]\n" 
  					"}\n"
  
--- 101,131 ----
  
  					// process current value
!                     "set tmp [eval concat $$var_attr_val]\n"
! 					"set len [llength $tmp]\n"
  					"if { $len == 1 } {\n"
  						// it's an atom
!                         // if atom starts with $, replace it by # ($ can't be passed by TCL)
!                         "if { [string index $tmp 0] == \"$\" } {\n"
!                             "set tmp [string replace $tmp 0 0 #]\n" 
!                         "}\n"
!                         "lappend lst $tmp\n" 
  					"} else {\n"
  						// it's a list
! 						"set lst [concat $lst {list} $len $tmp]\n" 
  					"}\n"
  
  					// process init value
! 					"set tmp [eval concat $$var_attr_init]\n"
! 					"set len [llength $tmp]\n"
  					"if { $len == 1 } {\n"
  						// it's an atom
!                         // if atom starts with $, replace it by # ($ can't be passed by TCL)
!                         "if { [string index $tmp 0] == \"$\" } {\n"
!                             "set tmp [string replace $tmp 0 0 #]\n" 
!                         "}\n"
!                         "lappend lst $tmp\n" 
  					"} else {\n"
  						// it's a list
! 						"set lst [concat $lst {list} $len $tmp]\n" 
  					"}\n"
  
***************
*** 140,146 ****
  		"}\n"
  
  		"proc flext_copyval {dst src} {\n"
! 			"global $src\n"
! 			"global $dst\n"
  			"set $dst [expr $$src]\n"
  		"}\n"
--- 148,180 ----
  		"}\n"
  
+         "proc flext_help {id} {\n"
+         	"toplevel $id.hw\n"
+             "wm title $id.hw \"Flext attribute editor help\"\n"
+ 
+             "frame $id.hw.buttons\n"
+             "pack $id.hw.buttons -side bottom -fill x -pady 2m\n"
+ 
+             "text $id.hw.text -relief sunken -bd 2 -yscrollcommand \"$id.hw.scroll set\" -setgrid 1 -width 80 -height 10 -wrap word\n"
+             "scrollbar $id.hw.scroll -command \"$id.hw.text yview\"\n"
+             "pack $id.hw.scroll -side right -fill y\n"
+             "pack $id.hw.text -expand yes -fill both\n"
+ 
+             "button $id.hw.buttons.ok -text OK -command \"destroy $id.hw\"\n"
+             "pack $id.hw.buttons.ok -side left -expand 1\n"
+ 			"bind $id.hw {<KeyPress-Escape>} \"destroy $id.hw\"\n"
+ 
+             "$id.hw.text tag configure big -font {Arial 10 bold}\n"
+             "$id.hw.text configure -font {Arial 8 bold}\n"
+             "$id.hw.text insert end \""
+                 "The flext attribute editor lets you query or change attribute values exposed by an external object. \" big \"\n\n"
+                 "Local variable names ($-values) will only be saved as such for init values. "
+                 "Alternatively, # can be used instead of $.\n"
+                 "Ctrl-Button on a text field will open an editor window where text can be entered more comfortably.\n"
+             "\"\n"
+             "$id.hw.text configure -state disabled\n"
+ 		"}\n"
+ 
  		"proc flext_copyval {dst src} {\n"
! 			"global $src $dst\n"
  			"set $dst [expr $$src]\n"
  		"}\n"
***************
*** 162,183 ****
              "pack $id.w.buttons -side bottom -fill x -pady 2m\n"
  
! //            "if { $edit != 0 } {set st normal} {set st disabled}\n"
!             "text $id.w.text -relief sunken -bd 2 -yscrollcommand \"$id.w.scroll set\" -setgrid 1 -width 80 -height 20\n"  //  -state $st
              "scrollbar $id.w.scroll -command \"$id.w.text yview\"\n"
              "pack $id.w.scroll -side right -fill y\n"
              "pack $id.w.text -expand yes -fill both\n"
  
! 			"if { $edit != 0 } {\n"
                  "button $id.w.buttons.ok -text OK -command \"flext_textcopy $id.w $id.w.text $var\"\n"
                  "pack $id.w.buttons.ok -side left -expand 1\n"
  //    			"bind $id.w {<Shift-KeyPress-Return>} \"flext_textcopy $id.w $id.w.text $var\"\n"
!     		"}\n"
  
              "button $id.w.buttons.cancel -text Cancel -command \"destroy $id.w\"\n"
              "pack $id.w.buttons.cancel -side left -expand 1\n"
  			"bind $id.w {<KeyPress-Escape>} \"destroy $id.w\"\n"
- 
-             "$id.w.text insert 0.0 [expr $$var]\n"
-             "$id.w.text mark set insert 0.0\n"
          "}\n"
  
--- 196,217 ----
              "pack $id.w.buttons -side bottom -fill x -pady 2m\n"
  
!             "text $id.w.text -relief sunken -bd 2 -yscrollcommand \"$id.w.scroll set\" -setgrid 1 -width 80 -height 20\n"
              "scrollbar $id.w.scroll -command \"$id.w.text yview\"\n"
              "pack $id.w.scroll -side right -fill y\n"
              "pack $id.w.text -expand yes -fill both\n"
  
!             "$id.w.text insert 0.0 [expr $$var]\n"
!             "$id.w.text mark set insert 0.0\n"
! 
! 			"if { $edit != 0 } then {\n"
                  "button $id.w.buttons.ok -text OK -command \"flext_textcopy $id.w $id.w.text $var\"\n"
                  "pack $id.w.buttons.ok -side left -expand 1\n"
  //    			"bind $id.w {<Shift-KeyPress-Return>} \"flext_textcopy $id.w $id.w.text $var\"\n"
!             "} "
!             "else { $id.w.text configure -state disabled }\n"
  
              "button $id.w.buttons.cancel -text Cancel -command \"destroy $id.w\"\n"
              "pack $id.w.buttons.cancel -side left -expand 1\n"
  			"bind $id.w {<KeyPress-Escape>} \"destroy $id.w\"\n"
          "}\n"
  
***************
*** 349,356 ****
--- 383,392 ----
  				"button $id.buttonframe.apply -text {Apply} -width 20 -command \" flext_apply $id $alen \"\n"
  				"button $id.buttonframe.ok -text {OK} -width 20 -command \" flext_ok $id $alen \"\n"
+ 				"button $id.buttonframe.help -text {Help} -width 10 -command \" flext_help $id \"\n"
  
  				"pack $id.buttonframe.cancel -side left -expand 1\n"
  				"pack $id.buttonframe.apply -side left -expand 1\n"
  				"pack $id.buttonframe.ok -side left -expand 1\n"
+ 				"pack $id.buttonframe.help -side left -expand 1\n"
  
  //                "grid rowconfigure $id $row -weight 0\n"

Index: flstdc.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flstdc.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** flstdc.h	12 Nov 2003 03:35:19 -0000	1.18
--- flstdc.h	8 Feb 2004 03:36:25 -0000	1.19
***************
*** 200,206 ****
  
  #ifdef FLEXT_DEBUG
! #define FLEXT_ASSERT(b) ((void)(!(b)?(error("Assertion failed: " #b " - in " __FILE__ " line %i",(int)__LINE__),0):0)) 
  #else
! #define FLEXT_ASSERT(b) ((void)0)
  #endif
  
--- 200,206 ----
  
  #ifdef FLEXT_DEBUG
! #define FLEXT_ASSERT(b) (!(b)?(error("Assertion failed: " #b " - in " __FILE__ " line %i",(int)__LINE__),0):1)
  #else
! #define FLEXT_ASSERT(b) (1)
  #endif
  





More information about the Pd-cvs mailing list