Update of /cvsroot/pure-data/externals/tkwidgets/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10569/shared
Modified Files: tkwidgets.c tkwidgets.h Log Message: moved inlet/outlet counts to tkwidgets.h
Index: tkwidgets.c =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tkwidgets.c 24 Nov 2007 00:33:42 -0000 1.10 --- tkwidgets.c 24 Nov 2007 04:07:23 -0000 1.11 *************** *** 170,177 **** }
void tkwidgets_draw_iolets(t_object *x, t_glist *glist, t_symbol *canvas_id, t_symbol *iolets_tag, t_symbol *all_tag, ! int width, int height, ! int total_inlets, int total_outlets) { int i, onset; --- 170,180 ---- }
+ /* standard method for drawing inlets and outlets. Currently, the number of + * inlets and outlets is set in tkwidgets.h since I think all of the + * objectclasses will have the same ones. If that needs to change, then this + * function can use obj_ninlets() and obj_noutlets() */ void tkwidgets_draw_iolets(t_object *x, t_glist *glist, t_symbol *canvas_id, t_symbol *iolets_tag, t_symbol *all_tag, ! int width, int height) { int i, onset; *************** *** 180,186 ****
/* TODO: make inlets draw on top of widget */ ! for (i = 0; i < total_inlets; i++) /* inlets */ { ! onset = calculate_onset(x_location, width, i, total_inlets); sys_vgui("%s create rectangle %d %d %d %d -tags {%s %s}\n", canvas_id->s_name, onset, y_location - 2, --- 183,189 ----
/* TODO: make inlets draw on top of widget */ ! for (i = 0; i < TOTAL_INLETS; i++) /* inlets */ { ! onset = calculate_onset(x_location, width, i, TOTAL_INLETS); sys_vgui("%s create rectangle %d %d %d %d -tags {%s %s}\n", canvas_id->s_name, onset, y_location - 2, *************** *** 189,195 **** sys_vgui("%s raise %s\n", canvas_id->s_name, iolets_tag->s_name); } ! for (i = 0; i < total_outlets; i++) /* outlets */ { ! onset = calculate_onset(x_location, width, i, total_outlets); sys_vgui("%s create rectangle %d %d %d %d -tags {%s %s}\n", canvas_id->s_name, onset, y_location + height, --- 192,198 ---- sys_vgui("%s raise %s\n", canvas_id->s_name, iolets_tag->s_name); } ! for (i = 0; i < TOTAL_OUTLETS; i++) /* outlets */ { ! onset = calculate_onset(x_location, width, i, TOTAL_OUTLETS); sys_vgui("%s create rectangle %d %d %d %d -tags {%s %s}\n", canvas_id->s_name, onset, y_location + height,
Index: tkwidgets.h =================================================================== RCS file: /cvsroot/pure-data/externals/tkwidgets/shared/tkwidgets.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tkwidgets.h 24 Nov 2007 00:33:42 -0000 1.9 --- tkwidgets.h 24 Nov 2007 04:07:23 -0000 1.10 *************** *** 34,37 **** --- 34,41 ---- #endif
+ /* so far, all of the tkwidgets objects have the same inlets/outlets */ + #define TOTAL_INLETS 1 + #define TOTAL_OUTLETS 2 + /* size and offset for the resizing handle */ #define TKW_HANDLE_HEIGHT 15 *************** *** 93,98 **** void tkwidgets_draw_iolets(t_object *x, t_glist *glist, t_symbol *canvas_id, t_symbol *iolets_tag, t_symbol *all_tag, ! int width, int height, ! int total_inlets, int total_outlets); void tkwidgets_erase_iolets(t_symbol* canvas_id, t_symbol* iolets_tag);
--- 97,101 ---- void tkwidgets_draw_iolets(t_object *x, t_glist *glist, t_symbol *canvas_id, t_symbol *iolets_tag, t_symbol *all_tag, ! int width, int height); void tkwidgets_erase_iolets(t_symbol* canvas_id, t_symbol* iolets_tag);