[PD-cvs] pd/src g_all_guis.c,1.1.1.4.2.4.2.14,1.1.1.4.2.4.2.15 g_all_guis.h,1.1.1.4.2.2.2.7,1.1.1.4.2.2.2.8 g_bang.c,1.1.1.3.2.2.2.11,1.1.1.3.2.2.2.12 g_canvas.h,1.1.1.4.2.4,1.1.1.4.2.4.2.1 g_editor.c,1.1.1.4.2.3.2.9,1.1.1.4.2.3.2.10 g_hslider.c,1.1.1.3.2.2.2.11,1.1.1.3.2.2.2.12 g_rtext.c,1.1.1.2.2.6.2.6,1.1.1.2.2.6.2.7 g_text.c,1.1.1.4.2.2.2.8,1.1.1.4.2.2.2.9 g_toggle.c,1.1.1.3.2.2.2.8,1.1.1.3.2.2.2.9 u_main.tk,1.1.1.4.2.7.4.33,1.1.1.4.2.7.4.34 u_object.tk,1.1.2.14,1.1.2.15

Mathieu Bouchard matju at users.sourceforge.net
Sun Apr 4 01:10:30 CEST 2004


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv407

Modified Files:
      Tag: impd_0_37
	g_all_guis.c g_all_guis.h g_bang.c g_canvas.h g_editor.c 
	g_hslider.c g_rtext.c g_text.c g_toggle.c u_main.tk 
	u_object.tk 
Log Message:
fixed bugs (incl GOP)


Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.1.1.3.2.2.2.8
retrieving revision 1.1.1.3.2.2.2.9
diff -C2 -d -r1.1.1.3.2.2.2.8 -r1.1.1.3.2.2.2.9
*** g_toggle.c	30 Mar 2004 01:35:09 -0000	1.1.1.3.2.2.2.8
--- g_toggle.c	3 Apr 2004 23:10:26 -0000	1.1.1.3.2.2.2.9
***************
*** 32,35 ****
--- 32,36 ----
  else {
  	pd_upload((t_gobj *)x);
+ 	pd_upload2((t_gobj *)x,glist);
  	sys_mgui((t_iemgui *)x,"toggle","draw","");
  	if(glist_isvisible(glist)) sys_mgui((t_iemgui *)x,"toggle","set","i",x->x_on!=0.0);

Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.1.1.4.2.2.2.8
retrieving revision 1.1.1.4.2.2.2.9
diff -C2 -d -r1.1.1.4.2.2.2.8 -r1.1.1.4.2.2.2.9
*** g_text.c	2 Apr 2004 00:16:43 -0000	1.1.1.4.2.2.2.8
--- g_text.c	3 Apr 2004 23:10:26 -0000	1.1.1.4.2.2.2.9
***************
*** 17,28 ****
  #include <math.h>
  
! static t_class *text_class;
! static t_class *message_class;
! static t_class *gatom_class;
  static void text_vis(t_gobj *z, t_glist *glist, int vis);
! static void text_displace(t_gobj *z, t_glist *glist,
!     int dx, int dy);
! static void text_getrect(t_gobj *z, t_glist *glist,
!     int *xp1, int *yp1, int *xp2, int *yp2);
  
  void canvas_startmotion(t_canvas *x);
--- 17,24 ----
  #include <math.h>
  
! static t_class *text_class, *message_class, *gatom_class;
  static void text_vis(t_gobj *z, t_glist *glist, int vis);
! static void text_displace(t_gobj *z, t_glist *glist, int dx, int dy);
! static void text_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2);
  
  void canvas_startmotion(t_canvas *x);
***************
*** 889,893 ****
      rtext_select(y, state);
      if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! 	sys_vgui("%s_select %s .x%x.c %d\n", text_classname(x), rtext_gettag(y),glist,  state);
      }
  }
--- 885,890 ----
      rtext_select(y, state);
      if (glist_isvisible(glist) && text_shouldvis(x, glist)) {
! 	sys_vgui("%s_select %s .x%x.c %d\n", text_classname(x), rtext_gettag(y),
! 	    glist_getcanvas(glist),  state);
      }
  }
***************
*** 925,929 ****
      	    if (x->te_type == T_ATOM)
  	    	glist_retext(glist, x);
!     	    text_drawborder(x, glist, rtext_gettag(y),
  		rtext_width(y), rtext_height(y), 1);
  	    rtext_draw(y);
--- 922,926 ----
      	    if (x->te_type == T_ATOM)
  	    	glist_retext(glist, x);
!     	    text_drawborder(x, glist_getcanvas(glist), rtext_gettag(y),
  		rtext_width(y), rtext_height(y), 1);
  	    rtext_draw(y);
***************
*** 1009,1014 ****
      {
      	t_atomtype t = ((t_gatom *)x)->a_atom.a_type;
!     	t_symbol *sel = (t == A_SYMBOL ? gensym("symbolatom") :
!     	    (t == A_FLOAT ? gensym("floatatom") : gensym("intatom")));
  	t_symbol *label = gatom_escapit(((t_gatom *)x)->a_label);
  	t_symbol *symfrom = gatom_escapit(((t_gatom *)x)->a_symfrom);
--- 1006,1013 ----
      {
      	t_atomtype t = ((t_gatom *)x)->a_atom.a_type;
!     	t_symbol *sel =
! 	    t==A_SYMBOL ? gensym("symbolatom") :
!     	    t==A_FLOAT ? gensym("floatatom") :
! 	    gensym("BOOM");
  	t_symbol *label = gatom_escapit(((t_gatom *)x)->a_label);
  	t_symbol *symfrom = gatom_escapit(((t_gatom *)x)->a_symfrom);
***************
*** 1078,1083 ****
      text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
      ob = pd_checkobject(&x->te_pd);
!     sys_vgui("%s_draw %s .x%x.c %d %d %d %d %d %d\n",
! 	text_classname(x),tag,glist,x1,y1,x2-x1,y2-y1,
  	ob?obj_ninlets(ob):0, ob?obj_noutlets(ob):0);
  }
--- 1077,1084 ----
      text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2);
      ob = pd_checkobject(&x->te_pd);
!     pd_upload((t_gobj *)x);
!     pd_upload2((t_gobj *)x,glist);
!     sys_vgui("%s_draw %x .x%x.c %d %d %d %d\n",
! 	text_classname(x),x,glist_getcanvas(glist),x2-x1,y2-y1,
  	ob?obj_ninlets(ob):0, ob?obj_noutlets(ob):0);
  }

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.7.4.33
retrieving revision 1.1.1.4.2.7.4.34
diff -C2 -d -r1.1.1.4.2.7.4.33 -r1.1.1.4.2.7.4.34
*** u_main.tk	3 Apr 2004 14:28:15 -0000	1.1.1.4.2.7.4.33
--- u_main.tk	3 Apr 2004 23:10:26 -0000	1.1.1.4.2.7.4.34
***************
*** 3,10 ****
  # line is automatically munged by the relevant makefiles.)
  
  # Copyright (c) 1997-1999 Miller Puckette.
  # Copyright 2004 Mathieu Bouchard.
  # For information on usage and redistribution, and for a DISCLAIMER OF ALL
! # WARRANTIES, see the file, "LICENSE.txt," in this distribution.
  
  #option add *background pink widgetDefault
--- 3,12 ----
  # line is automatically munged by the relevant makefiles.)
  
+ # $Id$
+ 
  # Copyright (c) 1997-1999 Miller Puckette.
  # Copyright 2004 Mathieu Bouchard.
  # For information on usage and redistribution, and for a DISCLAIMER OF ALL
! # WARRANTIES, see the file, "LICENSE.txt", in this distribution.
  
  #option add *background pink widgetDefault
***************
*** 527,531 ****
  proc stat_pos_update {self x y} {
      set canvas $self.c
!     $self.stat.pos configure -text "([$canvas canvasx $x],[$canvas canvasy $y])"
      set stack [$canvas find overlapping [expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]]
      set tags [$canvas gettags [lindex $stack end]]
--- 529,535 ----
  proc stat_pos_update {self x y} {
      set canvas $self.c
!     set x [$canvas canvasx $x]
!     set y [$canvas canvasy $y]
!     $self.stat.pos configure -text "($x,$y)"
      set stack [$canvas find overlapping [expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]]
      set tags [$canvas gettags [lindex $stack end]]
***************
*** 751,756 ****
      	bind $name.c <Button-5> "$name.c yview scroll +1 units"
      }}
!     #image create photo mybackground -file "/home/matju/lena.ppm"
!     #$name.c create image 0 0  -anchor nw -image mybackground
  }
  
--- 755,762 ----
      	bind $name.c <Button-5> "$name.c yview scroll +1 units"
      }}
!     #catch {image create photo mybackground -file "test2.gif"}
!     #catch {$name.c create image -6 -39 -anchor nw -image mybackground -tag bg}
!     #scale $name.bbar.bg -orient horizontal -showvalue false -from 0 -to 255 -command {}
!     #pack $name.bbar.bg -side right
  }
  
***************
*** 780,797 ****
  
  proc pdtk_canvas_click {canvas x y b f} {
!     pd [canvastosym $canvas] mouse [$canvas canvasx $x] [$canvas canvasy $y] $b $f \;
!     set stack [$canvas find overlapping [expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]]
      set tags [$canvas gettags [lindex $stack end]]
!     puts stderr "(click) $canvas $x $y $b $f : $tags "
      if {[regexp {^(?:\.x)?([a-f0-9]{7})} $tags tag]} {
  	    global _
  	    if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
  	    puts stderr "(.....) $tag is a \[$class\] object"
! 	    pd "[canvastosym $canvas] click-on-object $tag $x $y $b $f;"
  	    return
      }
      if {[regexp {^l([a-f0-9]{7})} $tags tag]} {
  	    puts stderr "(.....) this is a wire"
! 	    pd "[canvastosym $canvas] click-on-wire $tag $x $y $b $f;"
  	    return
      }
--- 786,811 ----
  
  proc pdtk_canvas_click {canvas x y b f} {
!     set cx [$canvas canvasx $x]
!     set cy [$canvas canvasy $y]
!     pd [canvastosym $canvas] mouse $cx $cy $b $f \;
!     set stack [$canvas find overlapping [expr $cx-2] [expr $cy-2] [expr $cx+2] [expr $cy+2]]
      set tags [$canvas gettags [lindex $stack end]]
!     puts stderr "(click) $canvas $cx $cy $b $f : $tags "
      if {[regexp {^(?:\.x)?([a-f0-9]{7})} $tags tag]} {
  	    global _
  	    if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
  	    puts stderr "(.....) $tag is a \[$class\] object"
! 	    if {[llength [$canvas bbox ${tag}BASE]]} {
! 		    foreach {x1 y1 x2 y2} [$canvas bbox ${tag}BASE] {}
! 		    post "x=$cx y=$cy x1=$x1 y1=$y1 x2=$x2 y2=$y2"
! 	    } {
! 		post "BASEless object?"
! 	    }
! 	    pd "[canvastosym $canvas] click-on-object $tag $cx $cy $b $f;"
  	    return
      }
      if {[regexp {^l([a-f0-9]{7})} $tags tag]} {
  	    puts stderr "(.....) this is a wire"
! 	    pd "[canvastosym $canvas] click-on-wire $tag $cx $cy $b $f;"
  	    return
      }
***************
*** 799,802 ****
--- 813,833 ----
  }
  
+ proc pdtk_start_wire {canvas x y b f} {
+ 	if (ob && (noutlet = obj_noutlets(ob)) && ypos >= y2-4) {} {return}
+ #    	width = x2-x1
+ #    	nout1 = noutlet>1 ? noutlet-1 : 1
+ #    	closest = ((xpos-x1) * nout1 + width/2)/width
+ #    	hotspot = x1 + (width-IOWIDTH)*closest/nout1
+ #	if (closest < noutlet && xpos >= hotspot-1 && xpos <= hotspot + IOWIDTH+1) {
+ #    	    if (doit) {
+ #	   	issignal = obj_issignaloutlet(ob, closest)
+ #    	    	x->gl_editor->e_onmotion = MA_CONNECT
+ #    	    	x->gl_editor->e_xwas = xpos
+ #    	    	x->gl_editor->e_ywas = ypos
+ #    	    	wire_draw x .x%x.c %d %d %d %d %d\n", x, (issignal ? 2 : 1), xpos, ypos, xpos, ypos
+ #    	    } {canvas_setcursor(x, CURSOR_EDITMODE_CONNECT)}
+ #    	} {if (doit) goto nooutletafterall}
+ }
+ 
  set pdtk_canvas_mouseup(name) 0
  set pdtk_canvas_mouseup(xmin) 0
***************
*** 1185,1192 ****
      set popup_xpix $xpix
      set popup_ypix $ypix
!     if {$canprop == 0} {$name.popup entryconfigure 0 -state disabled}
!     if {$canprop == 1} {$name.popup entryconfigure 0 -state active}
!     if {$canopen == 0} {$name.popup entryconfigure 1 -state disabled}
!     if {$canopen == 1} {$name.popup entryconfigure 1 -state active}
      tk_popup $name.popup [expr $xpix + [winfo rootx $name.c]] \
      	 [expr $ypix + [winfo rooty $name.c]] 0
--- 1216,1227 ----
      set popup_xpix $xpix
      set popup_ypix $ypix
!     set xpix [expr 2*$xpix-round([$name.c canvasx $xpix])]
!     set ypix [expr 2*$ypix-round([$name.c canvasy $ypix])]
!     if {$canprop} {
! 	    $name.popup entryconfigure 0 -state active} {
! 	    $name.popup entryconfigure 0 -state disabled}
!     if {$canopen} {
! 	    $name.popup entryconfigure 1 -state active} {
! 	    $name.popup entryconfigure 1 -state disabled}
      tk_popup $name.popup [expr $xpix + [winfo rootx $name.c]] \
      	 [expr $ypix + [winfo rooty $name.c]] 0
***************
*** 1227,1231 ****
      set _($self:ypix) $ypix
      toplevel $id
!     wm title $id {graph}
      wm protocol $id WM_DELETE_WINDOW "graph_cancel $id"
      label $id.label -text "GRAPH BOUNDS"
--- 1262,1266 ----
      set _($self:ypix) $ypix
      toplevel $id
!     wm title $id "Graph"
      wm protocol $id WM_DELETE_WINDOW "graph_cancel $id"
      label $id.label -text "GRAPH BOUNDS"
***************
*** 1233,1240 ****
      cancel_apply_ok $self graph
      global properties
!     properties_dialog $self graph_ok $properties(graph)
!     $id.xrangef.x2 select from 0
!     $id.xrangef.x2 select adjust end
!     focus $id.xrangef.x2
  }
  
--- 1268,1275 ----
      cancel_apply_ok $self graph
      global properties
!     properties_dialog $self .$self graph_ok $properties(graph)
!     #$id.xrangef.x2 select from 0
!     #$id.xrangef.x2 select adjust end
!     #focus $id.xrangef.x2
  }
  
***************
*** 1972,1978 ****
  		text .log.1 -width 60 -height 10 -yscrollcommand ".log.2 set"
  		scrollbar .log.2 -command ".log.1 yview"
! 		global tcl_version tk_version pd_myversion
  		.log.1 insert end "$pd_myversion"
! 		.log.1 insert end "Tcl $tcl_version, Tk $tk_version\n"
  		pack .log.1 -side left -fill both -expand yes
  		pack .log.2 -side left -fill    y -expand no
--- 2007,2016 ----
  		text .log.1 -width 60 -height 10 -yscrollcommand ".log.2 set"
  		scrollbar .log.2 -command ".log.1 yview"
! 		global tcl_version tk_version pd_myversion tcl_platform pd_nt
  		.log.1 insert end "$pd_myversion"
! 		.log.1 insert end "Tcl $tcl_version, Tk $tk_version, pd_nt=$pd_nt\n"
! 		foreach k [array names tcl_platform] {
! 			.log.1 insert end "tcl_platform($k) = $tcl_platform($k)\n"
! 		}
  		pack .log.1 -side left -fill both -expand yes
  		pack .log.2 -side left -fill    y -expand no
***************
*** 2002,2005 ****
--- 2040,2048 ----
  }
  
+ proc post {args} {
+ 	post_to_gui [eval [linsert $args 0 format]]
+ 	post_to_gui "\n"
+ }
+ 
  ############ evaluator
  
***************
*** 2473,2477 ****
  
  global env
! #if [catch {source $env(HOME)/.pd.tk}] {post_to_gui ".pd.tk: $errorInfo\n"}
! if [catch {source $env(HOME)/.pd.tk}] {puts stderr ".pd.tk: $errorInfo"}
  
--- 2516,2520 ----
  
  global env
! #if [catch {source $env(HOME)/.pd.tk}] {puts stderr ".pd.tk: $errorInfo"}
! catch {source $env(HOME)/.pd.tk}
  

Index: g_canvas.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.h,v
retrieving revision 1.1.1.4.2.4
retrieving revision 1.1.1.4.2.4.2.1
diff -C2 -d -r1.1.1.4.2.4 -r1.1.1.4.2.4.2.1
*** g_canvas.h	25 Nov 2003 19:19:57 -0000	1.1.1.4.2.4
--- g_canvas.h	3 Apr 2004 23:10:25 -0000	1.1.1.4.2.4.2.1
***************
*** 198,202 ****
  
  
! /* T.Grill - changed t_pd member to t_pdobj to avoid name clashed */
  typedef struct _template
  {
--- 198,202 ----
  
  
! /* T.Grill - changed t_pd member to t_pdobj to avoid name clash */
  typedef struct _template
  {

Index: g_all_guis.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v
retrieving revision 1.1.1.4.2.4.2.14
retrieving revision 1.1.1.4.2.4.2.15
diff -C2 -d -r1.1.1.4.2.4.2.14 -r1.1.1.4.2.4.2.15
*** g_all_guis.c	2 Apr 2004 00:16:42 -0000	1.1.1.4.2.4.2.14
--- g_all_guis.c	3 Apr 2004 23:10:25 -0000	1.1.1.4.2.4.2.15
***************
*** 662,665 ****
--- 662,670 ----
  }
  
+ void pd_upload2(t_gobj *self, t_canvas *can) {
+ 	sys_vgui("global _; set _(%x:cx) %d; set _(%x:cy) %d\n",
+ 		self, text_xpix((t_object *)self,can), self, text_ypix((t_object *)self,can));
+ }
+ 
  void sys_mgui(t_iemgui *self, const char *qlass, const char *sel, const char *fmt, ...) {
  	char buf[4096];

Index: g_all_guis.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_all_guis.h,v
retrieving revision 1.1.1.4.2.2.2.7
retrieving revision 1.1.1.4.2.2.2.8
diff -C2 -d -r1.1.1.4.2.2.2.7 -r1.1.1.4.2.2.2.8
*** g_all_guis.h	30 Mar 2004 01:35:09 -0000	1.1.1.4.2.2.2.7
--- g_all_guis.h	3 Apr 2004 23:10:25 -0000	1.1.1.4.2.2.2.8
***************
*** 67,74 ****
  #define IEM_RADIO_MAX   128
  
! #define IEM_SYM_UNIQUE_SND  256
! #define IEM_SYM_UNIQUE_RCV  512
! #define IEM_SYM_UNIQUE_LAB  1024
! #define IEM_SYM_UNIQUE_ALL  1792
  #define IEM_FONT_STYLE_ALL  255
  
--- 67,74 ----
  #define IEM_RADIO_MAX   128
  
! #define IEM_SYM_UNIQUE_SND  (1<<8)
! #define IEM_SYM_UNIQUE_RCV  (1<<9)
! #define IEM_SYM_UNIQUE_LAB  (1<<10)
! #define IEM_SYM_UNIQUE_ALL  ((1<<10)|(1<<9)|(1<<8))
  #define IEM_FONT_STYLE_ALL  255
  
***************
*** 319,322 ****
--- 319,323 ----
  EXTERN int pd_scanargs(int argc, t_atom *argv, char *format, ...);
  EXTERN void pd_upload(t_gobj *self);
+ EXTERN void pd_upload2(t_gobj *self, t_canvas *can);
  EXTERN void sys_mgui(t_iemgui *self, const char *qlass, const char *sel, const char *fmt, ...);
  EXTERN void iemgui_set_font_style(t_iemgui *self, int font);

Index: g_rtext.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_rtext.c,v
retrieving revision 1.1.1.2.2.6.2.6
retrieving revision 1.1.1.2.2.6.2.7
diff -C2 -d -r1.1.1.2.2.6.2.6 -r1.1.1.2.2.6.2.7
*** g_rtext.c	1 Apr 2004 23:22:01 -0000	1.1.1.2.2.6.2.6
--- g_rtext.c	3 Apr 2004 23:10:26 -0000	1.1.1.2.2.6.2.7
***************
*** 146,151 ****
      int font = glist_getfont(x->x_glist);
      int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font);
!     int findx = (*widthp + (fontwidth/2)) / fontwidth,
!     	findy = *heightp / fontheight;
      int reportedindex = 0;
      t_canvas *canvas = glist_getcanvas(x->x_glist);
--- 146,150 ----
      int font = glist_getfont(x->x_glist);
      int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font);
!     int findx = (*widthp + fontwidth/2)/fontwidth, findy = *heightp/fontheight;
      int reportedindex = 0;
      t_canvas *canvas = glist_getcanvas(x->x_glist);
***************
*** 208,212 ****
      pixhigh = nlines * fontheight + (TMARGIN + BMARGIN);
      if (action == SEND_FIRST) {
! 	post("rtext_senditup pdtk_text_new");
      	sys_vgui("global look; pdtk_text_new .x%x.c %s %f %f {%.*s} %d %s\n",
  	    canvas, x->x_tag,
--- 207,211 ----
      pixhigh = nlines * fontheight + (TMARGIN + BMARGIN);
      if (action == SEND_FIRST) {
! /*	post("rtext_senditup pdtk_text_new: %.*s",outchars,tempbuf);*/
      	sys_vgui("global look; pdtk_text_new .x%x.c %s %f %f {%.*s} %d %s\n",
  	    canvas, x->x_tag,
***************
*** 218,222 ****
      else if (action == SEND_UPDATE)
      {
! 	post("rtext_senditup pdtk_text_set");
      	sys_vgui("pdtk_text_set .x%x.c %s {%.*s}\n",
      	    canvas, x->x_tag, outchars, tempbuf);
--- 217,221 ----
      else if (action == SEND_UPDATE)
      {
! /*	post("rtext_senditup pdtk_text_set: %.*s",outchars,tempbuf);*/
      	sys_vgui("pdtk_text_set .x%x.c %s {%.*s}\n",
      	    canvas, x->x_tag, outchars, tempbuf);
***************
*** 446,449 ****
--- 445,451 ----
  	x->x_selstart = x->x_selend;
      }
+     else {
+ 	post("<%s>: dropped",keysym->s_name);
+     }
      rtext_senditup(x, SEND_UPDATE, &w, &h, &indx);
  }

Index: u_object.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -C2 -d -r1.1.2.14 -r1.1.2.15
*** u_object.tk	1 Apr 2004 23:22:01 -0000	1.1.2.14
--- u_object.tk	3 Apr 2004 23:10:27 -0000	1.1.2.15
***************
*** 1,5 ****
  # Copyright 2004 Mathieu Bouchard.
  # For information on usage and redistribution, and for a DISCLAIMER OF ALL
! # WARRANTIES, see the file, "LICENSE.txt," in this distribution.
  
  ############ colouring
--- 1,6 ----
+ # $Id$
  # Copyright 2004 Mathieu Bouchard.
  # For information on usage and redistribution, and for a DISCLAIMER OF ALL
! # WARRANTIES, see the file, "LICENSE.txt", in this distribution.
  
  ############ colouring
***************
*** 41,44 ****
--- 42,46 ----
  
  # real classes
+ set fields(obj)    [eval list $fields1]
  set fields(tgl)    [eval list $fields1 w                  isa $fields2 on nonzero]
  set fields(bng)    [eval list $fields1 w hold break       isa $fields2]
***************
*** 55,59 ****
--- 57,63 ----
  	global _
  	global fields
+ 	set d [string trimright $d ";\n"]
  	set class [lindex $d 4]
+ 	if {![info exists fields($class)]} {set class obj}
  	#puts "${class} $x = $d"
  	#if {[llength $fields] != [llength $d]} {huh}
***************
*** 65,68 ****
--- 69,82 ----
  }
  
+ proc object_xy {self canvas} {
+ 	global _
+ 	if {[info exists _($self:cx)]} {
+ 		return [list $_($self:cx) $_($self:cy)]
+ 	} {
+ 		return [list $_($self:x1) $_($self:y1)]
+ 	}
+ 	return [list $x $y]
+ }
+ 
  ############ rendering
  
***************
*** 146,151 ****
  }
  
! proc objectbox_draw {self canvas x1 y1 xs ys ins outs} {
  	global look
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
--- 160,166 ----
  }
  
! proc objectbox_draw {self canvas xs ys ins outs} {
  	global look
+ 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
***************
*** 185,190 ****
  proc brokenbox_erase {self canvas} {objectbox_erase $self $canvas}
  
! proc message_draw {self canvas x1 y1 xs ys ins outs} {
  	global look
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
--- 200,206 ----
  proc brokenbox_erase {self canvas} {objectbox_erase $self $canvas}
  
! proc message_draw {self canvas xs ys ins outs} {
  	global look
+ 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
***************
*** 213,221 ****
  #proc message_tick {self canvas} {}
  
! proc atom_draw {self canvas x1 y1 xs ys ins outs} {
  	global look
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
  	set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
  	if {[llength [$canvas gettags ${self}BASE]] != 0} {
  		$canvas coords ${self}BASE $points
--- 229,242 ----
  #proc message_tick {self canvas} {}
  
! proc atom_draw {self canvas xs ys ins outs} {
  	global look
+ 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
  	set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2]
+ 	if {[catch {$canvas canvasx $x1}]} {
+ 		post "atom_draw: canvas $canvas does not exist"
+ 		return
+ 	}
  	if {[llength [$canvas gettags ${self}BASE]] != 0} {
  		$canvas coords ${self}BASE $points
***************
*** 240,245 ****
  	global look
  	global _
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set xs [expr 10*$_($self:w)]
  	set ys $_($self:h)
--- 261,265 ----
  	global look
  	global _
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set xs [expr 10*$_($self:w)]
  	set ys $_($self:h)
***************
*** 333,338 ****
  }
  
! proc comment_draw {self canvas x1 y1 xs ys ins outs} {
  	if {[llength [$canvas gettags $self]] != 0} {}
  }
  proc comment_select {self canvas flag} {}
--- 353,359 ----
  }
  
! proc comment_draw {self canvas xs ys ins outs} {
  	if {[llength [$canvas gettags $self]] != 0} {}
+ 	foreach {x1 y1} [object_xy $self $canvas] {}
  }
  proc comment_select {self canvas flag} {}
***************
*** 385,390 ****
  		vradio {set orient 1} vdl {set orient 1}
  	}
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set n $_($self:n)
  	set xs [expr $_($self:w)*($orient?1:$n)]
--- 406,410 ----
  		vradio {set orient 1} vdl {set orient 1}
  	}
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set n $_($self:n)
  	set xs [expr $_($self:w)*($orient?1:$n)]
***************
*** 431,436 ****
  	set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
  	global _
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set xs $_($self:w)
  	set ys $_($self:h)
--- 451,455 ----
  	set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
  	global _
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set xs $_($self:w)
  	set ys $_($self:h)
***************
*** 456,461 ****
  	global _
  	set pos [$canvas coords ${self}BASE]
! 	set x1 [lindex $pos 0]
! 	set y1 [lindex $pos 1]
  	switch $_($self:class) {
  		hsl { set orient 0 }
--- 475,479 ----
  	global _
  	set pos [$canvas coords ${self}BASE]
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	switch $_($self:class) {
  		hsl { set orient 0 }
***************
*** 491,496 ****
  	global _
  	set isnew [expr [llength [$canvas gettags ${self}LABEL]] == 0]
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set lx [expr $x1+$_($self:ldx)]
  	set ly [expr $y1+$_($self:ldy)]
--- 509,513 ----
  	global _
  	set isnew [expr [llength [$canvas gettags ${self}LABEL]] == 0]
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set lx [expr $x1+$_($self:ldx)]
  	set ly [expr $y1+$_($self:ldy)]
***************
*** 516,521 ****
  	global _
  	set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set xs $_($self:w)
  	set ys $_($self:w)
--- 533,537 ----
  	global _
  	set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set xs $_($self:w)
  	set ys $_($self:w)
***************
*** 556,561 ****
  proc toggle_draw {self canvas} {
  	global _
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set xs $_($self:w)
  	set ys $_($self:w)
--- 572,576 ----
  proc toggle_draw {self canvas} {
  	global _
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set xs $_($self:w)
  	set ys $_($self:w)
***************
*** 618,623 ****
  	global _
  	set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set xs $_($self:w)
  	set ys $_($self:h)
--- 633,637 ----
  	global _
  	set isnew [expr [llength [$canvas gettags ${self}BASE]] == 0]
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set xs $_($self:w)
  	set ys $_($self:h)
***************
*** 669,674 ****
  proc vu_set {self canvas i} {
  	global _
! 	set x1 $_($self:x1)
! 	set y1 $_($self:y1)
  	set xs $_($self:w)
  	set ys $_($self:h)
--- 683,687 ----
  proc vu_set {self canvas i} {
  	global _
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set xs $_($self:w)
  	set ys $_($self:h)
***************
*** 682,686 ****
  proc vu_peak {self canvas i} {
  	global _ vu_col
! 	set x1 $_($self:x1)
  	set y1 $_($self:y1)
  	set xs $_($self:w)
--- 695,699 ----
  proc vu_peak {self canvas i} {
  	global _ vu_col
! 	foreach {x1 y1} [object_xy $self $canvas] {}
  	set y1 $_($self:y1)
  	set xs $_($self:w)

Index: g_editor.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v
retrieving revision 1.1.1.4.2.3.2.9
retrieving revision 1.1.1.4.2.3.2.10
diff -C2 -d -r1.1.1.4.2.3.2.9 -r1.1.1.4.2.3.2.10
*** g_editor.c	2 Apr 2004 00:16:42 -0000	1.1.1.4.2.3.2.9
--- g_editor.c	3 Apr 2004 23:10:25 -0000	1.1.1.4.2.3.2.10
***************
*** 885,894 ****
  	t_linetraverser t;
  	t_glist *g = glist_getcanvas(self);
! 	if (sscanf(linesym->s_name,"l%x",(unsigned*)&oc)<1) {
! 		bug("%s:%d BERSERK!\n",__FILE__,__LINE__);
  	}
      	linetraverser_start(&t, g);
  	while (0!=(w=linetraverser_next(&t))) if (*oc==w) break;
! 	if (!w) bug("%s:%d BERSERK!\n",__FILE__,__LINE__);
  	*obj1 = canvas_getindex(g,  &t.tr_ob->ob_g); *port1 = t.tr_outno;
  	*obj2 = canvas_getindex(g, &t.tr_ob2->ob_g); *port2 = t.tr_inno;
--- 885,895 ----
  	t_linetraverser t;
  	t_glist *g = glist_getcanvas(self);
! 	if (sscanf(linesym->s_name,"l%x",(unsigned*)oc)<1) {
! 		bug("%s:%d BERSERK! linesym=%s sscanf error\n",__FILE__,__LINE__,linesym->s_name);
! 		return;
  	}
      	linetraverser_start(&t, g);
  	while (0!=(w=linetraverser_next(&t))) if (*oc==w) break;
! 	if (!w) bug("%s:%d BERSERK! linesym=%s not found\n",__FILE__,__LINE__,linesym->s_name);
  	*obj1 = canvas_getindex(g,  &t.tr_ob->ob_g); *port1 = t.tr_outno;
  	*obj2 = canvas_getindex(g, &t.tr_ob2->ob_g); *port2 = t.tr_inno;

Index: g_hslider.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v
retrieving revision 1.1.1.3.2.2.2.11
retrieving revision 1.1.1.3.2.2.2.12
diff -C2 -d -r1.1.1.3.2.2.2.11 -r1.1.1.3.2.2.2.12
*** g_hslider.c	2 Apr 2004 00:16:43 -0000	1.1.1.3.2.2.2.11
--- g_hslider.c	3 Apr 2004 23:10:26 -0000	1.1.1.3.2.2.2.12
***************
*** 46,49 ****
--- 46,50 ----
      } else {
  	pd_upload((t_gobj *)x);
+ 	pd_upload2((t_gobj *)x,glist);
  	sys_mgui((t_iemgui *)x,"slider","draw","");
  	sys_mgui((t_iemgui *)x,"slider","set","i",x->x_val);

Index: g_bang.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v
retrieving revision 1.1.1.3.2.2.2.11
retrieving revision 1.1.1.3.2.2.2.12
diff -C2 -d -r1.1.1.3.2.2.2.11 -r1.1.1.3.2.2.2.12
*** g_bang.c	2 Apr 2004 00:16:42 -0000	1.1.1.3.2.2.2.11
--- g_bang.c	3 Apr 2004 23:10:25 -0000	1.1.1.3.2.2.2.12
***************
*** 31,35 ****
  else if (mode==IEM_GUI_DRAW_MODE_SELECT)
  	sys_mgui((t_iemgui *)x,"bang","select","i",x->x_gui.x_fsf.x_selected);
! else {pd_upload((t_gobj *)x); sys_mgui((t_iemgui *)x,"bang","draw","");}
  }
  
--- 31,38 ----
  else if (mode==IEM_GUI_DRAW_MODE_SELECT)
  	sys_mgui((t_iemgui *)x,"bang","select","i",x->x_gui.x_fsf.x_selected);
! else {
! 	pd_upload((t_gobj *)x);
! 	pd_upload2((t_gobj *)x,glist);
! 	sys_mgui((t_iemgui *)x,"bang","draw","");}
  }
  





More information about the Pd-cvs mailing list