Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17784
Modified Files: Tag: impd_0_37 u_main.tk g_canvas.c g_rtext.c m_glob.c Log Message: object class name completion
Index: g_canvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v retrieving revision 1.1.1.4.2.7.2.4 retrieving revision 1.1.1.4.2.7.2.5 diff -C2 -d -r1.1.1.4.2.7.2.4 -r1.1.1.4.2.7.2.5 *** g_canvas.c 14 Mar 2004 22:33:54 -0000 1.1.1.4.2.7.2.4 --- g_canvas.c 16 Mar 2004 21:54:02 -0000 1.1.1.4.2.7.2.5 *************** *** 131,144 **** }
- void glob_redraw (void) { - t_canvas *x = canvas_list; - while (x) { - fprintf(stderr,"canvas=%08x\n",x); - canvas_redraw(x); - x->gl_mapped=0; canvas_map(x,1); - x=x->gl_next; - } - } - void canvas_setargs(int argc, t_atom *argv) { --- 131,134 ---- *************** *** 641,644 **** --- 631,644 ---- }
+ void glob_redraw (void) { + t_canvas *x = canvas_list; + while (x) { + fprintf(stderr,"canvas=%08x\n",x); + canvas_redraw(x); + x->gl_mapped=0; canvas_map(x,1); + x=x->gl_next; + } + } + void canvas_redraw(t_canvas *x) { *************** *** 982,986 **** { t_gobj *y; - t_symbol *s = gensym("loadbang"); for (y = x->gl_list; y; y = y->g_next) if (pd_class(&y->g_pd) == canvas_class) --- 982,985 ---- *************** *** 1011,1015 **** void canvas_loadbang(t_canvas *x) { - t_gobj *y; canvas_loadbangabstractions(x); canvas_loadbangsubpatches(x); --- 1010,1013 ---- *************** *** 1019,1023 **** you gave it to open it; perhaps there's a 1-pixel border all around it or something. Anyway, we just add the 2 pixels back here; seems we ! have to do this for linux but not MSW; not sure about MacOS. */
#ifdef MSW --- 1017,1021 ---- you gave it to open it; perhaps there's a 1-pixel border all around it or something. Anyway, we just add the 2 pixels back here; seems we ! have to do this for linux but not MSW; not sure about MacOS. */
#ifdef MSW *************** *** 1093,1097 **** int *xp1, int *yp1, int *xp2, int *yp2) { - t_gobj *y; *xp2 += 50; /* fake for now */ *yp2 += 50; --- 1091,1094 ---- *************** *** 1320,1324 **** for (g = gl->gl_list; g; g = g->g_next) { - t_class *cl; if (vis && g->g_pd == scalar_class) glist_redrawitem(gl, g); --- 1317,1320 ----
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.1.1.4.2.7.4.15 retrieving revision 1.1.1.4.2.7.4.16 diff -C2 -d -r1.1.1.4.2.7.4.15 -r1.1.1.4.2.7.4.16 *** u_main.tk 16 Mar 2004 08:13:52 -0000 1.1.1.4.2.7.4.15 --- u_main.tk 16 Mar 2004 21:54:02 -0000 1.1.1.4.2.7.4.16 *************** *** 20,23 **** --- 20,27 ---- option add *Button*borderWidth 1
+ # there are two palettes of 30 colours used in Pd + # when placed in a 3*10 grid, the difference is that + # the left corner of 3*3 (the greys) are transposed (matrixwise) + # here is the one used in the swatch color selector: set preset_colors { fcfcfc e0e0e0 bcbcbc fce0e0 fce0c0 fcfcc8 d8fcd8 d8fcfc dce4fc f8d8fc *************** *** 324,332 **** set cmd [lindex $e 1] set accel [accel_munge [lindex $e 2]] ! regsub %W $cmd $context cmd $menu add command -label [lindex $e 0] -command $cmd \ -accelerator $accel set accels([string tolower $accel]) $cmd } } } --- 328,344 ---- set cmd [lindex $e 1] set accel [accel_munge [lindex $e 2]] ! regsub -all %W $cmd $context cmd $menu add command -label [lindex $e 0] -command $cmd \ -accelerator $accel set accels([string tolower $accel]) $cmd } + 4 { + set cmd [lindex $e 1] + set accel [accel_munge [lindex $e 2]] + regsub -all %W $cmd $context cmd + $menu add checkbutton -label [lindex $e 0] -command $cmd \ + -accelerator $accel -indicatoron ??? + set accels([string tolower $accel]) $cmd + } } } *************** *** 575,580 **** $name.m add cascade -label View -menu $name.m.view populate_menu $name.m.view $name { ! {hello {} {}} }
menu $name.m.put -tearoff $pd_tearoff --- 587,593 ---- $name.m add cascade -label View -menu $name.m.view populate_menu $name.m.view $name { ! {hello {} ""} } + # {Crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle}
menu $name.m.put -tearoff $pd_tearoff *************** *** 766,769 **** --- 779,783 ---- # investigate this LATER... global pd_nt + hide_canvas_tooltip $name if {$pd_nt == 2} { if {$key=="BackSpace"} {set key 8; set keynum 8} *************** *** 2065,2069 ****
proc show_class_list {} { ! pd "pd update-path ; pd update-class-list ;" }
--- 2079,2083 ----
proc show_class_list {} { ! pd "pd update-path ; pd update-class-list class_list_callback ;" }
*************** *** 2145,2152 **** }
! # rendering: source $pd_guidir/bin/u_object.tk
! # theme: set look(objectfg) #000000 set look(objectbg) #ffffff --- 2159,2221 ---- }
! ############ tooltips ! ! proc show_canvas_tooltip {self canvas x y text} { ! set border 4 ! set x [expr $x+$border+4] ! hide_canvas_tooltip $canvas ! $canvas create text $x $y -text $text -anchor w -tags tooltip_fg ! foreach {x1 y1 x2 y2} [$canvas bbox tooltip_fg] {} ! set w 0 ! set h 0 ! $canvas create rectangle \ ! [expr $x1-$border] [expr $y1-$border] \ ! [expr $x2+$border] [expr $y2+$border] \ ! -fill "#ffffcc" -outline "#000000" -tags tooltip_bg ! $canvas lower tooltip_bg tooltip_fg ! } ! ! proc hide_canvas_tooltip {canvas} { ! $canvas delete tooltip_bg tooltip_fg ! } ! ! ############ completions ! ! set completion_closure {} ! ! proc propose_completions {self canvas x y text} { ! global class_list completion_closure ! set completion_closure [list $self $canvas $x $y $text] ! pd "pd update-class-list propose_completions2 ;" ! if {![info exists class_list]} { ! post_to_gui "loading class list..." ! ! } else { ! propose_completions2 ! } ! } ! ! proc propose_completions2 {} { ! global class_list completion_closure ! foreach {self canvas x y text} $completion_closure {} ! set r {} ! set n 0 ! foreach class [lsort $class_list] { ! if {[string length $text]==0 || [string first $text $class]>=0} { ! lappend r $class ! incr n ! } ! if {$n > 20} {lappend r ...; break} ! } ! #post_to_gui "$r\n" ! show_canvas_tooltip $self $canvas $x $y [string map {" " "\n"} $r] ! } ! ! ############ rendering ! source $pd_guidir/bin/u_object.tk
! ############ theming ! set look(objectfg) #000000 set look(objectbg) #ffffff
Index: g_rtext.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_rtext.c,v retrieving revision 1.1.1.2.2.6.2.1 retrieving revision 1.1.1.2.2.6.2.2 diff -C2 -d -r1.1.1.2.2.6.2.1 -r1.1.1.2.2.6.2.2 *** g_rtext.c 5 Mar 2004 19:27:52 -0000 1.1.1.2.2.6.2.1 --- g_rtext.c 16 Mar 2004 21:54:02 -0000 1.1.1.2.2.6.2.2 *************** *** 45,49 **** { t_rtext *x = (t_rtext *)getbytes(sizeof *x); - int w = 0, h = 0, indx; x->x_height = -1; x->x_text = who; --- 45,48 ---- *************** *** 274,278 **** char *decimal = 0, *nextchar, *ebuf = x->x_buf + bufsize, *s1, *s2; - int ndecimals; for (decimal = x->x_buf; decimal < ebuf; decimal++) if (*decimal == '.') --- 273,276 ---- *************** *** 320,324 **** int rtext_width(t_rtext *x) { ! int w = 0, h = 0, indx; rtext_senditup(x, SEND_CHECK, &w, &h, &indx); return (w); --- 318,322 ---- int rtext_width(t_rtext *x) { ! int w=0, h=0, indx; rtext_senditup(x, SEND_CHECK, &w, &h, &indx); return (w); *************** *** 387,394 **** --- 385,401 ---- int w = 0, h = 0, indx, i, newsize, ndel; char *s1, *s2; + t_glist *glist = x->x_glist; + t_canvas *canvas = glist_getcanvas(glist); if (keynum) { int n = keynum; if (n == '\r') n = '\n'; + if (n == '\t') { + post("TAB: «%s»",x->x_buf); + sys_vgui("propose_completions %x .x%x.c %d %d {%*s}\n", x, canvas, + text_xpix(x->x_text, x->x_glist) + x->x_drawnwidth, + text_ypix(x->x_text, x->x_glist) + x->x_drawnheight/2, + x->x_bufsize, x->x_buf); + } if (n == '\b') /* backspace */ {
Index: m_glob.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_glob.c,v retrieving revision 1.1.1.2.2.3.2.2 retrieving revision 1.1.1.2.2.3.2.3 diff -C2 -d -r1.1.1.2.2.3.2.2 -r1.1.1.2.2.3.2.3 *** m_glob.c 22 Feb 2004 18:00:47 -0000 1.1.1.2.2.3.2.2 --- m_glob.c 16 Mar 2004 21:54:02 -0000 1.1.1.2.2.3.2.3 *************** *** 63,66 **** --- 63,69 ---- }
+ EXTERN char *class_gethelpdir(t_class *c); + EXTERN void open_via_helppath(const char *name, const char *dir); + /* see also canvas_done_popup */ void glob_help(t_pd *bogus, t_symbol *s) { *************** *** 74,78 **** }
! void glob_update_class_list (void) { int i; int n = pd_objectmaker->c_nmethod; --- 77,81 ---- }
! void glob_update_class_list (t_pd *self, t_symbol *callback) { int i; int n = pd_objectmaker->c_nmethod; *************** *** 82,90 **** } sys_gui("}\n"); ! sys_vgui("class_list_callback\n"); }
EXTERN void glob_update_class_info (t_pd *bogus, t_symbol *s); EXTERN void glob_update_path (void);
void glob_init(void) --- 85,94 ---- } sys_gui("}\n"); ! sys_vgui("%s\n",callback->s_name); }
EXTERN void glob_update_class_info (t_pd *bogus, t_symbol *s); EXTERN void glob_update_path (void); + EXTERN void glob_redraw (void);
void glob_init(void) *************** *** 130,134 **** gensym("tooltips"), A_DEFFLOAT, 0); class_addmethod(glob_pdobject, (t_method)glob_update_class_list, ! gensym("update-class-list"), 0); class_addmethod(glob_pdobject, (t_method)glob_update_class_info, gensym("update-class-info"), A_SYMBOL, 0); --- 134,138 ---- gensym("tooltips"), A_DEFFLOAT, 0); class_addmethod(glob_pdobject, (t_method)glob_update_class_list, ! gensym("update-class-list"), A_SYMBOL, 0); class_addmethod(glob_pdobject, (t_method)glob_update_class_info, gensym("update-class-info"), A_SYMBOL, 0); *************** *** 137,140 **** --- 141,146 ---- class_addmethod(glob_pdobject, (t_method)glob_help, gensym("help"), A_SYMBOL, 0); + class_addmethod(glob_pdobject, (t_method)glob_redraw, + gensym("redraw"), 0); #ifdef UNIX class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0);