From 6cf3b5ec3cc8b854fe24ecd8eeff2e094106913d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 27 Aug 2008 22:27:30 +0000 Subject: merged in relevant changes from the v0-40 pd-extended release branch svn path=/trunk/externals/bbogart/; revision=10266 --- entry/entry-help.pd | 215 +++++++++++++++++++++------------------------------- entry/entry.c | 26 ++++--- entry/makefile | 6 +- 3 files changed, 102 insertions(+), 145 deletions(-) (limited to 'entry') diff --git a/entry/entry-help.pd b/entry/entry-help.pd index be5309d..170e9d2 100644 --- a/entry/entry-help.pd +++ b/entry/entry-help.pd @@ -1,5 +1,5 @@ -#N canvas 172 88 801 700 10; -#X obj 72 208 entry 150 100 grey black; +#N canvas 216 22 793 604 10; +#X obj 72 208 entry 150 100 grey yellow; #X obj 11 84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 32 316 print; @@ -7,7 +7,7 @@ #X msg 127 94 set one two three four five six; #X msg 31 29 fgcolour yellow; #X msg 94 4 bgcolour purple; -#X obj 142 462 entry 100 50 grey70 purple; +#X obj 29 526 entry 155 48 grey70 purple; #X text 9 355 Creation arguments are: width height bgcolor fgcolor. The width and height are in pixels.; #X obj 251 254 select return; @@ -16,7 +16,7 @@ The width and height are in pixels.; #X msg 218 186 clear; #X symbolatom 216 319 10 0 0 1 last_key_typed - -; #X text 255 275 ^-- hit return to output; -#X msg 219 430 size 400 200; +#X msg 123 490 size 400 200; #X msg 6 4 bgcolour grey; #X msg 52 52 fgcolour black; #X text 12 396 The size message currently only takes affect after a @@ -29,87 +29,61 @@ save and reopen.; #X msg 85 429 98; #X obj 148 31 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/text.htm ; -#X obj 442 91 entry 300 50 grey70 black; -#X msg 572 67 option relief \$1; -#X obj 571 46 symbol; -#X msg 469 11 flat; -#X msg 504 11 groove; -#X msg 551 11 raised; -#X msg 599 10 ridge; -#X msg 640 10 solid; -#X msg 681 10 sunken; -#X obj 611 524 symbol; -#X obj 482 525 symbol; -#X msg 465 501 on; -#X msg 499 500 off; -#X msg 592 499 normal; -#X msg 638 499 disabled; -#X msg 610 547 option state \$1; -#X msg 482 547 option undo \$1; -#X msg 132 430 size 100 50; -#X text 664 526 disable editing; -#X text 525 526 turn on undo; -#X obj 572 217 entry 100 50 grey70 black; -#X obj 571 172 symbol; -#X obj 447 394 entry 250 80 grey70 black; -#X obj 501 349 symbol; -#X msg 572 193 option wrap \$1; -#X msg 529 147 none; -#X msg 564 147 char; -#X msg 601 147 word; -#X text 618 171 word wrapping; -#X msg 502 370 option selectbackground \$1; -#X msg 419 304 blue; -#X msg 454 304 purple; -#X msg 501 304 orange; -#X msg 549 303 magenta; -#X obj 425 281 pddp/pddplink http://en.wikipedia.org/wiki/X11_color_names -; -#X msg 603 303 DarkSlateBlue; -#X msg 603 342 limegreen; -#X msg 603 323 lightyellow; -#X obj 384 218 entry 100 50 grey70 black; -#X obj 386 167 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 +#X obj 395 132 entry 300 50 grey70 black; +#X msg 571 101 option relief \$1; +#X obj 570 80 symbol; +#X msg 468 45 flat; +#X msg 503 45 groove; +#X msg 550 45 raised; +#X msg 598 44 ridge; +#X msg 639 44 solid; +#X msg 680 44 sunken; +#X obj 610 233 symbol; +#X msg 591 208 normal; +#X msg 637 208 disabled; +#X msg 609 256 option state \$1; +#X msg 124 465 size 100 50; +#X text 663 235 disable editing; +#X obj 448 297 entry 250 80 grey70 black; +#X obj 440 200 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 -1 -1 0 1; -#X obj 52 601 entry 100 50 grey70 black; -#X obj 51 556 symbol; -#X obj 39 650 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm +#X obj 263 509 entry 100 50 grey70 black; +#X obj 262 464 symbol; +#X obj 210 559 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm ; -#X msg 49 521 boat; -#X msg 52 577 option cursor \$1; -#X msg 9 521 clock; -#X msg 145 521 dot; -#X msg 175 521 dotbox; -#X msg 222 521 gumby; -#X msg 265 521 gobbler; -#X msg 266 590 pirate; -#X msg 266 547 mouse; -#X msg 266 569 target; -#X msg 384 194 option insertwidth \$1; -#X obj 386 48 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 +#X msg 260 429 boat; +#X msg 263 485 option cursor \$1; +#X msg 220 429 clock; +#X msg 356 429 dot; +#X msg 386 429 dotbox; +#X msg 433 429 gumby; +#X msg 476 429 gobbler; +#X msg 477 498 pirate; +#X msg 477 455 mouse; +#X msg 477 477 target; +#X msg 438 227 option insertwidth \$1; +#X obj 385 82 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144 -1 -1 0 1; -#X msg 383 68 option borderwidth \$1; -#X msg 395 366 scrollbar \$1; -#X obj 395 346 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 +#X msg 382 102 option borderwidth \$1; +#X msg 456 269 scrollbar \$1; +#X obj 456 249 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 1; -#X msg 129 171 key a; -#X msg 170 171 key 32; -#X obj 342 510 keyup; -#X msg 342 549 key \$1; -#X floatatom 359 531 5 0 0 0 - - -; +#X obj 566 417 keyup; +#X msg 566 456 key \$1; +#X floatatom 583 438 5 0 0 0 - - -; #X msg 269 210 key 3322; -#X obj 550 586 entry 100 50 grey70 purple; -#X obj 342 584 entry 100 50 grey70 black; -#X text 337 488 type single chars:; -#X msg 411 535 key a; -#X msg 412 557 key 9; -#X obj 329 650 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm +#X obj 566 492 entry 166 54 grey70 black; +#X text 561 393 type single chars:; +#X msg 656 442 key a; +#X msg 657 464 key 9; +#X obj 500 559 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/cursors.htm ; -#X text 156 630 for more cursors:; -#X text 327 636 for more keynums:; -#X msg 403 516 key 65228; -#X msg 266 611 pencil; -#X msg 84 521 coffee_mug; +#X text 367 538 for more cursors:; +#X text 551 544 for more keynums:; +#X msg 648 423 key 65228; +#X msg 477 519 pencil; +#X msg 295 429 coffee_mug; +#X msg 700 464 key 32; #X connect 0 0 2 0; #X connect 0 0 10 0; #X connect 0 1 9 0; @@ -140,54 +114,35 @@ save and reopen.; #X connect 32 0 28 0; #X connect 33 0 28 0; #X connect 34 0 28 0; -#X connect 35 0 41 0; -#X connect 36 0 42 0; -#X connect 37 0 36 0; -#X connect 38 0 36 0; -#X connect 39 0 35 0; -#X connect 40 0 35 0; -#X connect 41 0 90 0; -#X connect 42 0 90 0; -#X connect 43 0 7 0; -#X connect 47 0 50 0; -#X connect 49 0 55 0; -#X connect 50 0 46 0; -#X connect 51 0 47 0; -#X connect 52 0 47 0; -#X connect 53 0 47 0; -#X connect 55 0 48 0; -#X connect 56 0 49 0; -#X connect 57 0 49 0; -#X connect 58 0 49 0; -#X connect 59 0 49 0; -#X connect 61 0 49 0; -#X connect 62 0 49 0; -#X connect 63 0 49 0; -#X connect 65 0 79 0; -#X connect 67 0 70 0; -#X connect 69 0 67 0; -#X connect 70 0 66 0; -#X connect 71 0 67 0; -#X connect 72 0 67 0; -#X connect 73 0 67 0; -#X connect 74 0 67 0; -#X connect 75 0 67 0; -#X connect 76 0 67 0; -#X connect 77 0 67 0; -#X connect 78 0 67 0; -#X connect 79 0 64 0; -#X connect 80 0 81 0; -#X connect 81 0 26 0; -#X connect 82 0 48 0; -#X connect 83 0 82 0; -#X connect 84 0 0 0; -#X connect 85 0 0 0; -#X connect 86 0 87 0; -#X connect 86 0 88 0; -#X connect 87 0 91 0; -#X connect 89 0 0 0; -#X connect 93 0 91 0; -#X connect 94 0 91 0; -#X connect 98 0 91 0; -#X connect 99 0 67 0; -#X connect 100 0 67 0; +#X connect 35 0 38 0; +#X connect 36 0 35 0; +#X connect 37 0 35 0; +#X connect 38 0 41 0; +#X connect 39 0 7 0; +#X connect 42 0 56 0; +#X connect 44 0 47 0; +#X connect 46 0 44 0; +#X connect 47 0 43 0; +#X connect 48 0 44 0; +#X connect 49 0 44 0; +#X connect 50 0 44 0; +#X connect 51 0 44 0; +#X connect 52 0 44 0; +#X connect 53 0 44 0; +#X connect 54 0 44 0; +#X connect 55 0 44 0; +#X connect 56 0 41 0; +#X connect 57 0 58 0; +#X connect 58 0 26 0; +#X connect 59 0 41 0; +#X connect 60 0 59 0; +#X connect 61 0 62 0; +#X connect 61 0 63 0; +#X connect 62 0 65 0; +#X connect 64 0 0 0; +#X connect 67 0 65 0; +#X connect 68 0 65 0; +#X connect 72 0 65 0; +#X connect 73 0 44 0; +#X connect 74 0 44 0; +#X connect 75 0 65 0; diff --git a/entry/entry.c b/entry/entry.c index 891e00c..bc4860f 100644 --- a/entry/entry.c +++ b/entry/entry.c @@ -1,3 +1,4 @@ + /* text entry widget for PD * * Based on button from GGEE by Guenter Geiger * * Copyright Ben Bogart 2004 ben@ekran.org * @@ -49,6 +50,7 @@ #define TOTAL_OUTLETS 2 #define DEBUG(x) +//#define DEBUG(x) x typedef struct _entry { @@ -133,32 +135,32 @@ static void set_tk_widget_ids(t_entry *x, t_canvas *canvas) /* Tk ID for the current canvas that this object is drawn in */ sprintf(buf,".x%lx.c", (long unsigned int) canvas); - x->canvas_id = getbytes(strlen(buf)); + x->canvas_id = getbytes(strlen(buf) + 1); strcpy(x->canvas_id, buf); /* Tk ID for the "frame" the other things are drawn in */ sprintf(buf,"%s.frame%lx", x->canvas_id, (long unsigned int)x); - x->frame_id = getbytes(strlen(buf)); + x->frame_id = getbytes(strlen(buf) + 1); strcpy(x->frame_id, buf); sprintf(buf,"%s.text%lx", x->frame_id, (long unsigned int)x); - x->text_id = getbytes(strlen(buf)); + x->text_id = getbytes(strlen(buf) + 1); strcpy(x->text_id, buf); /* Tk ID for the "text", the meat! */ sprintf(buf,"%s.window%lx", x->canvas_id, (long unsigned int)x); - x->window_tag = getbytes(strlen(buf)); + x->window_tag = getbytes(strlen(buf) + 1); strcpy(x->window_tag, buf); /* Tk ID for the resizing "window" */ sprintf(buf,"%s.handle%lx", x->canvas_id, (long unsigned int)x); - x->handle_id = getbytes(strlen(buf)); + x->handle_id = getbytes(strlen(buf) + 1); strcpy(x->handle_id, buf); /* Tk ID for the resizing "handle" */ sprintf(buf,"%s.scrollbar%lx", x->frame_id, (long unsigned int)x); - x->scrollbar_id = getbytes(strlen(buf)); + x->scrollbar_id = getbytes(strlen(buf) + 1); strcpy(x->scrollbar_id, buf); /* Tk ID for the optional "scrollbar" */ sprintf(buf,"all%lx", (long unsigned int)x); - x->all_tag = getbytes(strlen(buf)); + x->all_tag = getbytes(strlen(buf) + 1); strcpy(x->all_tag, buf); /* Tk ID for the optional "scrollbar" */ } @@ -475,7 +477,7 @@ static void entry_append(t_entry* x, t_symbol *s, int argc, t_atom *argv) } sys_vgui("append ::%s::list \" \"\n", x->tcl_namespace); sys_vgui("%s insert end $::%s::list ; unset ::%s::list \n", - x->canvas_id, x->tcl_namespace, x->tcl_namespace ); + x->text_id, x->tcl_namespace, x->tcl_namespace ); sys_vgui("%s yview end-2char \n", x->text_id ); } @@ -743,8 +745,8 @@ static void *entry_new(t_symbol *s, int argc, t_atom *argv) x->x_font_weight = gensym("normal"); x->x_have_scrollbar = 0; x->x_selected = 0; - - if (argc < 4) + + if (argc < 4) { post("entry: You must enter at least 4 arguments. Default values used."); x->x_width = ENTRY_DEFAULT_WIDTH; @@ -758,13 +760,13 @@ static void *entry_new(t_symbol *s, int argc, t_atom *argv) x->x_height = atom_getint(argv+1); x->x_bgcolour = atom_getsymbol(argv+2); x->x_fgcolour = atom_getsymbol(argv+3); - } + } x->x_data_outlet = outlet_new(&x->x_obj, &s_float); x->x_status_outlet = outlet_new(&x->x_obj, &s_symbol); sprintf(buf,"entry%lx",(long unsigned int)x); - x->tcl_namespace = getbytes(strlen(buf)); + x->tcl_namespace = getbytes(strlen(buf) + 1); strcpy(x->tcl_namespace, buf); sprintf(buf,"#%s", x->tcl_namespace); diff --git a/entry/makefile b/entry/makefile index f612434..85c7364 100644 --- a/entry/makefile +++ b/entry/makefile @@ -1,7 +1,7 @@ current: echo make pd_linux, pd_nt, pd_irix5, or pd_irix6 -clean: ; rm -f entry.pd_{linux,nt,irix?,darwin} *.o +clean: ; rm -f entry.pd_* *.dll *.o # ----------------------- NT ----------------------- @@ -51,7 +51,7 @@ pd_linux: entry.pd_linux .SUFFIXES: .pd_linux -LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \ +LINUXCFLAGS = -g -DPD -O2 -funroll-loops -fomit-frame-pointer \ -Wall -W -Wshadow -Wstrict-prototypes @@ -69,7 +69,7 @@ pd_darwin: entry.pd_darwin .SUFFIXES: .pd_darwin -DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes +DARWINCFLAGS = -g -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes .c.pd_darwin: cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c -- cgit v1.2.1