Update of /cvsroot/pure-data/externals/miXed/toxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3862/toxy
Modified Files: Makefile Makefile.sources build_counter widget.c widgettype.c Log Message: toxy alpha6
Index: Makefile =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/toxy/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 19 Feb 2004 22:23:18 -0000 1.2 --- Makefile 9 Mar 2004 12:41:22 -0000 1.3 *************** *** 1,6 **** ROOT_DIR = .. ! redefault: default.wiq default ! default.wiq: $(ROOT_DIR)/test/toxy/default.wid $(ROOT_DIR)/quoteinitializer $< \ ! '"puts [concat loading built-in widget definitions]\n"' > $@ include $(ROOT_DIR)/Makefile.common --- 1,6 ---- ROOT_DIR = .. ! redefault: setup.wiq default ! setup.wiq: $(ROOT_DIR)/test/toxy/setup.wid $(ROOT_DIR)/quoteinitializer $< \ ! '"puts stderr [concat loading built-in widget definitions]\n"' > $@ include $(ROOT_DIR)/Makefile.common
Index: Makefile.sources =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/toxy/Makefile.sources,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.sources 19 Feb 2004 22:23:18 -0000 1.2 --- Makefile.sources 9 Mar 2004 12:41:22 -0000 1.3 *************** *** 1,3 **** --- 1,8 ---- + # this conditional will make sense LATER, when TCL_LIB is ./configured + ifdef TCL_LIB TYPES = TOT TOW WIDGET PLUSTOT + else + TYPES = TOT TOW WIDGET + endif
TOT_SOURCES = tot.c
Index: build_counter =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/toxy/build_counter,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build_counter 29 Feb 2004 17:16:44 -0000 1.4 --- build_counter 9 Mar 2004 12:41:22 -0000 1.5 *************** *** 1,3 **** #define TOXY_VERSION "0.1" #define TOXY_RELEASE "alpha" ! #define TOXY_BUILD 4 --- 1,3 ---- #define TOXY_VERSION "0.1" #define TOXY_RELEASE "alpha" ! #define TOXY_BUILD 6
Index: widget.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/toxy/widget.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** widget.c 27 Feb 2004 13:38:26 -0000 1.5 --- widget.c 9 Mar 2004 12:41:22 -0000 1.6 *************** *** 1,6 **** ! /* Copyright (c) 2003 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
/* LATER think about reloading method for .wid files */
--- 1,8 ---- ! /* Copyright (c) 2003-2004 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+ /* LATER consider supporting a special @ini handler, also think about + differentiating 'ini' from 'vis' */ /* LATER think about reloading method for .wid files */
*************** *** 165,168 **** --- 167,174 ---- fires, the widget object creates, and glist_adds a 'makeshift' text object, then glist_deletes itself. */ + + /* this lock prevents glist_noselect() from reevaluating failure boxes */ + static int widget_transforming = 0; + /* LATER also bind this to F4 or something */ static void widget_transtick(t_widget *x) *************** *** 174,177 **** --- 180,185 ---- t_atom *hnd = props_getall(x->x_handlers, &nhnd); t_atom *arg = props_getall(x->x_arguments, &narg); + if (widget_transforming++) + bug("widget_transtick"); binbuf_addv(bb, "sss", gensym("widget"), x->x_type, x->x_name); if (narg) binbuf_add(bb, narg, arg); *************** *** 196,199 **** --- 204,208 ---- canvas_dirty(x->x_glist, 1); glist_delete(x->x_glist, (t_gobj *)x); + widget_transforming--; }
*************** *** 420,423 **** --- 429,438 ---- };
+ static void widget_novis(t_widget *x) + { + sys_vgui("::toxy::itemdestroy %s %s\n", + widget_getmypathname(x, x->x_glist)->s_name, x->x_varname->s_name); + } + static void widget_update(t_widget *x, t_props *op) { *************** *** 436,440 **** if (x->x_update == WIDGET_REVIS) { ! widget_vis((t_gobj *)x, x->x_glist, 0); widget_vis((t_gobj *)x, x->x_glist, 1); } --- 451,455 ---- if (x->x_update == WIDGET_REVIS) { ! widget_novis(x); widget_vis((t_gobj *)x, x->x_glist, 1); } *************** *** 476,482 **** { t_symbol *empty; ! if (!(empty = widget_addprops(x, x->x_options, 0, s, ac, av)) && !(empty = widget_addprops(x, x->x_handlers, 0, s, ac, av))) ! empty = widget_addprops(x, x->x_arguments, 0, s, ac, av); return (empty); } --- 491,497 ---- { t_symbol *empty; ! if (!(empty = widget_addprops(x, x->x_arguments, 0, s, ac, av)) && !(empty = widget_addprops(x, x->x_handlers, 0, s, ac, av))) ! empty = widget_addprops(x, x->x_options, 0, s, ac, av); return (empty); } *************** *** 489,493 **** { t_symbol *empty; ! x->x_update = WIDGET_PUSHVIS; if (empty = widget_addmessage(x, s, ac, av)) loud_errand((t_pd *)x, --- 504,514 ---- { t_symbol *empty; ! /* FIXME mixed messages */ ! if (*s->s_name == '-') ! x->x_update = WIDGET_PUSHVIS; ! else if (*s->s_name == '#') ! x->x_update = WIDGET_REVIS; ! else ! x->x_update = WIDGET_NOVIS; if (empty = widget_addmessage(x, s, ac, av)) loud_errand((t_pd *)x, *************** *** 673,679 **** --- 694,703 ---- static void widget__failure(t_widget *x, t_symbol *s, int ac, t_atom *av) { + #if 0 + /* moved to the gui side, in order to alow special chars in error message */ startpost("tcl error:"); postatom(ac, av); endpost(); + #endif loud_error((t_pd *)x, "creation failure"); x->x_vised = 0; *************** *** 860,865 **** static void widget_free(t_widget *x) { ! sys_vgui("::toxy::itemdestroy %s %s\n", ! widget_getmypathname(x, x->x_glist)->s_name, x->x_varname->s_name); gui_unbind((t_pd *)x, x->x_cbtarget); gui_unbind((t_pd *)x, x->x_rptarget); --- 884,888 ---- static void widget_free(t_widget *x) { ! widget_novis(x); gui_unbind((t_pd *)x, x->x_cbtarget); gui_unbind((t_pd *)x, x->x_rptarget); *************** *** 876,882 **** static void *widget_new(t_symbol *s, int ac, t_atom *av) { ! t_widget *x = (t_widget *)pd_new(widget_class); char buf[MAXPDSTRING]; masterwidget_initialize(); x->x_type = 0; x->x_name = 0; --- 899,908 ---- static void *widget_new(t_symbol *s, int ac, t_atom *av) { ! t_widget *x; char buf[MAXPDSTRING]; + if (widget_transforming) + return (0); masterwidget_initialize(); + x = (t_widget *)pd_new(widget_class); x->x_type = 0; x->x_name = 0; *************** *** 905,913 **** pd_bind((t_pd *)x, x->x_rptarget = gensym(buf));
x->x_typedef = widgettype_get(x->x_type); if (!(x->x_tkclass = widgettype_tkclass(x->x_typedef))) x->x_tkclass = x->x_type;
- x->x_glist = canvas_getcurrent(); sprintf(buf, ".x%x.c", (int)x->x_glist); x->x_cvpathname = gensym(buf); --- 931,939 ---- pd_bind((t_pd *)x, x->x_rptarget = gensym(buf));
+ x->x_glist = canvas_getcurrent(); x->x_typedef = widgettype_get(x->x_type); if (!(x->x_tkclass = widgettype_tkclass(x->x_typedef))) x->x_tkclass = x->x_type;
sprintf(buf, ".x%x.c", (int)x->x_glist); x->x_cvpathname = gensym(buf); *************** *** 932,938 ****
outlet_new((t_object *)x, &s_anything); ! /* LATER consider estimating these, based on widget class and options */ ! x->x_width = 50; ! x->x_height = 50; props_clone(x->x_arguments, widgettype_getarguments(x->x_typedef)); widget_addmessage(x, 0, ac, av); --- 958,967 ----
outlet_new((t_object *)x, &s_anything); ! /* LATER consider estimating these, based on widget class and options. ! The default used to be 50x50, which confused people wanting widgets ! in small gops, of size exactly as specified by the 'coords' message, ! but finding gops stretched, to accomodate the widget's default area. */ ! x->x_width = 5; ! x->x_height = 5; props_clone(x->x_arguments, widgettype_getarguments(x->x_typedef)); widget_addmessage(x, 0, ac, av);
Index: widgettype.c =================================================================== RCS file: /cvsroot/pure-data/externals/miXed/toxy/widgettype.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** widgettype.c 19 Feb 2004 22:23:18 -0000 1.3 --- widgettype.c 9 Mar 2004 12:41:22 -0000 1.4 *************** *** 1,3 **** ! /* Copyright (c) 2003 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ --- 1,3 ---- ! /* Copyright (c) 2003-2004 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ *************** *** 13,17 ****
static char masterwidget_builtin[] = ! #include "default.wiq" ;
--- 13,17 ----
static char masterwidget_builtin[] = ! #include "setup.wiq" ;
*************** *** 37,43 **** t_scriptlet *mw_setupscript; t_dict *mw_typemap; ! t_widgettype *mw_defaulttype; /* contains master iniscript */ ! t_widgettype *mw_parsedtype; /* the type currently parsed, if loading */ ! t_binbuf *mw_bb; /* auxiliary, LATER remove */ };
--- 37,43 ---- t_scriptlet *mw_setupscript; t_dict *mw_typemap; ! t_widgettype *mw_mastertype; /* contains master iniscript */ ! t_widgettype *mw_parsedtype; /* the type currently parsed, if loading */ ! t_binbuf *mw_bb; /* auxiliary, LATER remove */ };
*************** *** 96,103 **** typeval = (t_widgettype *)dict_value(mw->mw_typemap, typekey); if (caller == (t_pd *)mw) ! { /* default.wid or built-in defaults */ ! if (mw->mw_defaulttype) ! { /* no default type in default.wid, extracting built-in one */ ! if (typeval != mw->mw_defaulttype) return (SCRIPTLET_LOCK); } --- 96,103 ---- typeval = (t_widgettype *)dict_value(mw->mw_typemap, typekey); if (caller == (t_pd *)mw) ! { /* setup.wid or built-in defaults */ ! if (mw->mw_mastertype) ! { /* no master type in setup.wid, extracting built-in one */ ! if (typeval != mw->mw_mastertype) return (SCRIPTLET_LOCK); } *************** *** 169,174 **** { t_widgettype *wt; ! /* default.wid defs are NOT overridden by <type>.wid -- ! feature stability comes first, LATER rethink */ if (wt = (t_widgettype *)dict_value(masterwidget->mw_typemap, dict_key(masterwidget->mw_typemap, --- 169,174 ---- { t_widgettype *wt; ! /* Design decision: setup.wid defs are NOT overridden by <type>.wid ! (sacrificing flexibility for feature stability). */ if (wt = (t_widgettype *)dict_value(masterwidget->mw_typemap, dict_key(masterwidget->mw_typemap, *************** *** 177,181 **** else { ! /* first instance of a type not defined in default.wid */ wt = widgettype_new(masterwidget, s->s_name, 0, 0); masterwidget->mw_parsedtype = wt; --- 177,181 ---- else { ! /* first instance of a type not defined in setup.wid */ wt = widgettype_new(masterwidget, s->s_name, 0, 0); masterwidget->mw_parsedtype = wt; *************** *** 183,189 **** if (masterwidget->mw_parsedtype) { t_scriptlet *mwsp = scriptlet_new((t_pd *)masterwidget, masterwidget->mw_target, ! masterwidget->mw_target, 0, 0, 0); if (scriptlet_rcload(mwsp, (t_pd *)wt, s->s_name, ".wid", 0, masterwidget_cmnthook) --- 183,192 ---- if (masterwidget->mw_parsedtype) { + /* <type>.wid searched in the current patch's dir + pd_path, + but not in `pwd` */ t_scriptlet *mwsp = scriptlet_new((t_pd *)masterwidget, masterwidget->mw_target, ! masterwidget->mw_target, 0, ! canvas_getcurrent(), 0); if (scriptlet_rcload(mwsp, (t_pd *)wt, s->s_name, ".wid", 0, masterwidget_cmnthook) *************** *** 265,269 **** int ac, t_atom *av, t_props *argprops) { ! return (scriptlet_evaluate(masterwidget->mw_defaulttype->wt_iniscript, outsp, visedonly, ac, av, argprops)); } --- 268,272 ---- int ac, t_atom *av, t_props *argprops) { ! return (scriptlet_evaluate(masterwidget->mw_mastertype->wt_iniscript, outsp, visedonly, ac, av, argprops)); } *************** *** 289,292 **** --- 292,297 ---- masterwidget->mw_typemap = dict_new(0);
+ /* setup.wid searched in `pwd` + pd_path, but not in current patch's dir + (LATER only the pd_path should be searched) */ masterwidget->mw_setupscript = scriptlet_new((t_pd *)masterwidget, masterwidget->mw_target, *************** *** 294,306 **** masterwidget->mw_bb = binbuf_new(); masterwidget->mw_parsedtype = 0; ! masterwidget->mw_defaulttype = 0;
rcresult = ! scriptlet_rcload(masterwidget->mw_setupscript, 0, "default", ".wid", masterwidget_builtin, masterwidget_cmnthook); if (rcresult == SCRIPTLET_OK) { #ifdef WIDGETTYPE_VERBOSE ! post("using file 'default.wid'"); #endif } --- 299,311 ---- masterwidget->mw_bb = binbuf_new(); masterwidget->mw_parsedtype = 0; ! masterwidget->mw_mastertype = 0;
rcresult = ! scriptlet_rcload(masterwidget->mw_setupscript, 0, "setup", ".wid", masterwidget_builtin, masterwidget_cmnthook); if (rcresult == SCRIPTLET_OK) { #ifdef WIDGETTYPE_VERBOSE ! post("using file 'setup.wid'"); #endif } *************** *** 308,318 **** { loud_warning((t_pd *)masterwidget, ! "no file 'default.wid'... using built-in defaults"); } ! typekey = dict_key(masterwidget->mw_typemap, "default"); if ((typeval = (t_widgettype *)dict_value(masterwidget->mw_typemap, typekey)) && !scriptlet_isempty(masterwidget->mw_setupscript)) { ! masterwidget->mw_defaulttype = typeval; rcresult = SCRIPTLET_OK; } --- 313,323 ---- { loud_warning((t_pd *)masterwidget, ! "no file 'setup.wid'... using built-in defaults"); } ! typekey = dict_key(masterwidget->mw_typemap, "master"); if ((typeval = (t_widgettype *)dict_value(masterwidget->mw_typemap, typekey)) && !scriptlet_isempty(masterwidget->mw_setupscript)) { ! masterwidget->mw_mastertype = typeval; rcresult = SCRIPTLET_OK; } *************** *** 320,330 **** { /* LATER think about adding only missing part to existing local defs */ ! loud_warning((t_pd *)masterwidget, "%s missing in file 'default.wid'", (typeval ? "setup definitions" : "master initializer")); ! masterwidget->mw_defaulttype = ! widgettype_new(masterwidget, "default", 0, 0); scriptlet_reset(masterwidget->mw_setupscript); rcresult = ! scriptlet_rcparse(masterwidget->mw_setupscript, 0, "default", masterwidget_builtin, masterwidget_cmnthook); } --- 325,335 ---- { /* LATER think about adding only missing part to existing local defs */ ! loud_warning((t_pd *)masterwidget, "%s missing in file 'setup.wid'", (typeval ? "setup definitions" : "master initializer")); ! masterwidget->mw_mastertype = ! widgettype_new(masterwidget, "master", 0, 0); scriptlet_reset(masterwidget->mw_setupscript); rcresult = ! scriptlet_rcparse(masterwidget->mw_setupscript, 0, "master", masterwidget_builtin, masterwidget_cmnthook); }