Commit d6adb925 authored by Ivica Bukvic's avatar Ivica Bukvic Committed by Hans-Christoph Steiner
Browse files

Pd-0.42.5-extended-l2ork-dev-20101228.tar.bz2

parent 601b74f6
......@@ -134,6 +134,8 @@ struct _garray
char x_saveit; /* true if we should save this with parent */
char x_listviewing; /* true if list view window is open */
char x_hidename; /* don't print name above graph */
int x_style; /* so much simpler to keep it here */
t_symbol *x_send; /* send_changed hook */
};
static t_pd *garray_arraytemplatecanvas;
......@@ -199,6 +201,9 @@ static t_garray *graph_scalar(t_glist *gl, t_symbol *s, t_symbol *templatesym,
x->x_listviewing = 0;
glist_add(gl, &x->x_gobj);
x->x_glist = gl;
char buf[MAXPDSTRING];
sprintf(buf, "%s_changed", x->x_realname->s_name);
x->x_send = gensym(buf);
return (x);
}
......@@ -255,7 +260,7 @@ int garray_getname(t_garray *x, t_symbol **namep)
/* if there is one garray in a graph, reset the graph's coordinates
to fit a new size and style for the garray */
static void garray_fittograph(t_garray *x, int n, int style)
void garray_fittograph(t_garray *x, int n)
{
t_array *array = garray_getarray(x);
t_glist *gl = x->x_glist;
......@@ -263,7 +268,7 @@ static void garray_fittograph(t_garray *x, int n, int style)
{
vmess(&gl->gl_pd, gensym("bounds"), "ffff",
0., gl->gl_y1, (double)
(style == PLOTSTYLE_POINTS || n == 1 ? n : n-1),
(x->x_style == PLOTSTYLE_POINTS || n == 1 ? n : n-1),
gl->gl_y2);
/* close any dialogs that might have the wrong info now... */
gfxstub_deleteforkey(gl);
......@@ -323,15 +328,16 @@ t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templateargsym,
saveit = ((flags & 1) != 0);
x = graph_scalar(gl, s, templatesym, saveit);
x->x_hidename = ((flags & 8) >> 3);
x->x_style = style;
if (n <= 0)
n = 100;
array_resize(x->x_scalar->sc_vec[zonset].w_array, n);
template_setfloat(template, gensym("style"), x->x_scalar->sc_vec,
style, 1);
x->x_style, 1);
template_setfloat(template, gensym("linewidth"), x->x_scalar->sc_vec,
((style == PLOTSTYLE_POINTS) ? 2 : 1), 1);
((x->x_style == PLOTSTYLE_POINTS) ? 2 : 1), 1);
if (x2 = pd_findbyclass(gensym("#A"), garray_class))
pd_unbind(x2, gensym("#A"));
......@@ -394,7 +400,8 @@ void glist_arraydialog(t_glist *parent, t_symbol *s, int argc, t_atom *argv)
(size > 1 ? size-1 : size), -1, xdraw+30, ydraw+30, xdraw+30+GLIST_DEFGRAPHWIDTH, ydraw+30+GLIST_DEFGRAPHHEIGHT);
a = graph_array(gl, sharptodollar(name), &s_float, size, flags);
canvas_dirty(parent, 1);
canvas_redraw(glist_getcanvas(parent));
//canvas_redraw(glist_getcanvas(parent));
garray_fittograph(a, (int)size);
sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", (long unsigned int)glist_getcanvas(parent));
}
......@@ -405,9 +412,9 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize,
int flags = fflags;
int saveit = ((flags & 1) != 0);
int style = ((flags & 6) >> 1);
t_float stylewas = template_getfloat(
/*t_float stylewas = template_getfloat(
template_findbyname(x->x_scalar->sc_template),
gensym("style"), x->x_scalar->sc_vec, 1);
gensym("style"), x->x_scalar->sc_vec, 1);*/
if (deleteit != 0)
{
glist_delete(x->x_glist, &x->x_gobj);
......@@ -457,10 +464,16 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize,
size = 1;
if (size != a->a_n)
garray_resize(x, size);
else if (style != stylewas)
garray_fittograph(x, size, style);
else if (style != x->x_style) {
x->x_style = style;
garray_fittograph(x, size);
}
template_setfloat(scalartemplate, gensym("style"),
x->x_scalar->sc_vec, (t_float)style, 0);
x->x_scalar->sc_vec, (t_float)x->x_style, 0);
char buf[MAXPDSTRING];
sprintf(buf, "%s_changed", x->x_realname->s_name);
x->x_send = gensym(buf);
garray_setsaveit(x, (saveit != 0));
garray_redraw(x);
......@@ -504,6 +517,7 @@ void garray_arrayviewlist_fillpage(t_garray *x,
t_float page,
t_float fTopItem)
{
//fprintf(stderr,"garray_fillpage\n");
int i, xonset=0, yonset=0, type=0, elemsize=0, topItem;
t_float yval;
char cmdbuf[200];
......@@ -634,6 +648,7 @@ static t_float array_motion_xperpix;
static t_float array_motion_yperpix;
static int array_motion_lastx;
static int array_motion_fatten;
static t_garray* array_garray;
/* LATER protect against the template changing or the scalar disappearing
probably by attaching a gpointer here ... */
......@@ -642,6 +657,9 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
{
array_motion_xcumulative += dx * array_motion_xperpix;
array_motion_ycumulative += dy * array_motion_yperpix;
t_glist *graph = array_garray->x_glist;
if (array_motion_xfield)
{
/* it's an x, y plot */
......@@ -690,6 +708,15 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
(t_word *)(((char *)array_motion_wp) +
array_motion_elemsize * array_motion_lastx),
1);
if (graph->gl_y1 > graph->gl_y2) {
if (newy > graph->gl_y1) newy = graph->gl_y1;
if (newy < graph->gl_y2) newy = graph->gl_y2;
}
else {
if (newy < graph->gl_y1) newy = graph->gl_y1;
if (newy > graph->gl_y2) newy = graph->gl_y2;
}
//fprintf(stderr, "y = %f\n", newy);
t_float ydiff = newy - oldy;
if (thisx < 0) thisx = 0;
else if (thisx >= array_motion_npoints)
......@@ -708,10 +735,15 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy)
}
array_motion_lastx = thisx;
}
//fprintf(stderr, "%f %f\n", graph->gl_y1, graph->gl_y2);
if (array_motion_scalar)
scalar_redraw(array_motion_scalar, array_motion_glist);
if (array_motion_array)
array_redraw(array_motion_array, array_motion_glist);
/* send a bang to the associated send to reflect the change via mouse click/drag */
if (array_garray->x_send->s_thing) pd_bang(array_garray->x_send->s_thing);
}
int scalar_doclick(t_word *data, t_template *template, t_scalar *sc,
......@@ -1011,14 +1043,19 @@ static void garray_delete(t_gobj *z, t_glist *glist)
static void garray_vis(t_gobj *z, t_glist *glist, int vis)
{
//fprintf(stderr,"garray_vis %d\n", vis);
t_garray *x = (t_garray *)z;
gobj_vis(&x->x_scalar->sc_gobj, glist, vis);
gobj_vis(&x->x_scalar->sc_gobj, glist, vis);
//if (((t_glist *)z)->gl_isgraph)
// fprintf(stderr,"garray_vis am_graph\n");
}
static int garray_click(t_gobj *z, t_glist *glist,
int xpix, int ypix, int shift, int alt, int dbl, int doit)
{
//fprintf(stderr,"garray_click\n");
t_garray *x = (t_garray *)z;
array_garray = x;
return (gobj_click(&x->x_scalar->sc_gobj, glist,
xpix, ypix, shift, alt, dbl, doit));
}
......@@ -1044,10 +1081,10 @@ static void garray_save(t_gobj *z, t_binbuf *b)
x->x_scalar->sc_template->s_name);
return;
}
style = template_getfloat(scalartemplate, gensym("style"),
x->x_scalar->sc_vec, 0);
filestyle = (style == PLOTSTYLE_POINTS ? 1 :
(style == PLOTSTYLE_POLY ? 0 : style));
/* style = template_getfloat(scalartemplate, gensym("style"),
x->x_scalar->sc_vec, 0); */
filestyle = (x->x_style == PLOTSTYLE_POINTS ? 1 :
(x->x_style == PLOTSTYLE_POLY ? 0 : x->x_style));
binbuf_addv(b, "sssisi;", gensym("#X"), gensym("array"),
x->x_name, array->a_n, &s_float,
x->x_saveit + 2 * filestyle + 8*x->x_hidename);
......@@ -1091,6 +1128,7 @@ void garray_usedindsp(t_garray *x)
static void garray_doredraw(t_gobj *client, t_glist *glist)
{
//fprintf(stderr,"garray_doredraw\n");
t_garray *x = (t_garray *)client;
if (glist_isvisible(x->x_glist))
{
......@@ -1101,6 +1139,7 @@ static void garray_doredraw(t_gobj *client, t_glist *glist)
void garray_redraw(t_garray *x)
{
//fprintf(stderr,"garray_redraw\n");
if (glist_isvisible(x->x_glist))
sys_queuegui(&x->x_gobj, x->x_glist, garray_doredraw);
/* jsarlo { */
......@@ -1108,6 +1147,7 @@ void garray_redraw(t_garray *x)
performance reasons */
else
{
//fprintf(stderr,"garray_redraw_listviewing\n");
if (x->x_listviewing)
sys_vgui("pdtk_array_listview_fillpage %s\n",
x->x_realname->s_name);
......@@ -1389,7 +1429,16 @@ static void garray_rename(t_garray *x, t_symbol *s)
}
/* } jsarlo */
pd_unbind(&x->x_gobj.g_pd, x->x_realname);
pd_bind(&x->x_gobj.g_pd, x->x_realname = x->x_name = s);
x->x_name = s;
x->x_realname = canvas_realizedollar(x->x_glist, x->x_name);
pd_bind(&x->x_gobj.g_pd, x->x_realname);
char buf[MAXPDSTRING];
sprintf(buf, "%s_changed", x->x_realname->s_name);
x->x_send = gensym(buf);
garray_redraw(x);
}
......@@ -1476,9 +1525,9 @@ void garray_resize(t_garray *x, t_floatarg f)
t_array *array = garray_getarray(x);
t_glist *gl = x->x_glist;
int n = (f < 1 ? 1 : f);
garray_fittograph(x, n, template_getfloat(
garray_fittograph(x, n);/*template_getfloat(
template_findbyname(x->x_scalar->sc_template),
gensym("style"), x->x_scalar->sc_vec, 1));
gensym("style"), x->x_scalar->sc_vec, 1));*/
array_resize_and_redraw(array, x->x_glist, n);
if (x->x_usedindsp)
canvas_update_dsp();
......
......@@ -1004,6 +1004,12 @@ void canvas_closebang(t_canvas *x)
}
}
/* needed for readjustment of garrays */
extern t_array *garray_getarray(t_garray *x);
extern void garray_fittograph(t_garray *x, int n);
extern t_rtext *glist_findrtext(t_glist *gl, t_text *who);
extern void rtext_gettext(t_rtext *x, char **buf, int *bufsize);
static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom,
t_symbol *topgeom)
{
......@@ -1017,6 +1023,26 @@ static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom,
if (cw > 5 && ch > 5)
canvas_setbounds(x, txpix, typix,
txpix + cw, typix + ch);
/* readjust garrays (if any) */
t_gobj *g, *gg = NULL;
t_garray *ga = NULL;
t_array *a = NULL;
int num_elem = 0;
for (g = x->gl_list; g; g = g->g_next) {
//fprintf(stderr, "searching\n");
//for subpatch garrays
if (pd_class(&g->g_pd) == garray_class) {
//fprintf(stderr,"found ya\n");
ga = (t_garray *)g;
if (ga) {
a = garray_getarray(ga);
num_elem = a->a_n;
garray_fittograph(ga, num_elem);
}
}
}
}
void canvas_popabstraction(t_canvas *x)
......
......@@ -1125,8 +1125,14 @@ void canvas_map(t_canvas *x, t_floatarg f);
/* we call this when we want the window to become visible, mapped, and
in front of all windows; or with "f" zero, when we want to get rid of
the window. */
//extern t_array *garray_getarray(t_garray *x);
//extern void garray_fittograph(t_garray *x, int n);
//extern t_rtext *glist_findrtext(t_glist *gl, t_text *who);
//extern void rtext_gettext(t_rtext *x, char **buf, int *bufsize);
void canvas_vis(t_canvas *x, t_floatarg f)
{
//fprintf(stderr,"canvas_vis %f\n", f);
char buf[30];
int flag = (f != 0);
if (x != glist_getcanvas(x))
......@@ -1145,11 +1151,12 @@ void canvas_vis(t_canvas *x, t_floatarg f)
#else
sys_vgui("raise .x%lx\n", x);
sys_vgui("focus .x%lx.c\n", x);
sys_vgui("wm deiconify .x%lx\n", x);
sys_vgui("wm deiconify .x%lx\n", x);
#endif
}
else
{
//fprintf(stderr,"new window\n");
canvas_create_editor(x);
sys_vgui("pdtk_canvas_new .x%lx %d %d +%d+%d %d\n", x,
(int)(x->gl_screenx2 - x->gl_screenx1),
......@@ -1158,6 +1165,57 @@ void canvas_vis(t_canvas *x, t_floatarg f)
x->gl_edit);
canvas_reflecttitle(x);
x->gl_havewindow = 1;
/*
//newly opened arrays created prior to pd-l2ork require fittograph
t_gobj *g, *gg = NULL;
t_garray *ga = NULL;
t_array *a = NULL;
int num_elem = 0;
t_text *t = NULL;
int objnamesize;
char *objname;
for (g = x->gl_list; g; g = g->g_next) {
//fprintf(stderr, "searching\n");
//for subpatch garrays
if (pd_class(&g->g_pd) == garray_class) {
//fprintf(stderr,"found ya\n");
ga = (t_garray *)g;
if (ga) {
a = garray_getarray(ga);
num_elem = a->a_n;
garray_fittograph(ga, num_elem);
}
}
//for garrays in gop inside a newly opened patch window
else {
t_text *t = (t_text *)g;
t_rtext *y = glist_findrtext(x, t);
if (y) {
rtext_gettext(y, &objname, &objnamesize);
//fprintf(stderr,"objname %s\n", objname);
if (!strcmp(objname, "graph ")) {
//fprintf(stderr,"got a graph\n");
for (gg = ((t_glist *)g)->gl_list; gg; gg = gg->g_next) {
//fprintf(stderr, "sub-searching\n");
if (pd_class(&gg->g_pd) == garray_class) {
//fprintf(stderr,"sub found ya\n");
ga = (t_garray *)gg;
if (ga) {
a = garray_getarray(ga);
num_elem = a->a_n;
garray_fittograph(ga, num_elem);
canvas_dirty(x, 2);
}
}
}
}
//else fprintf(stderr,"fail %d >%s< >graph<\n", strcmp(objname, "graph"), objname);
}
}
}
*/
canvas_updatewindowlist();
}
}
......@@ -1918,7 +1976,7 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit)
{
sys_vgui(".x%x.c itemconfigure %s -outline %s -fill %s -width 1\n",
x, canvas_cnct_inlet_tag,
(last_inlet_filter ? "black" : (outlet_issignal ? "$signal_cord" : "$msg_cord")),
(last_inlet_filter ? "black" : (obj_issignaloutlet(ob1, closest1) ? "$signal_cord" : "$msg_cord")),
(inlet_issignal ? "$signal_nlet" : "$msg_nlet"));
canvas_cnct_inlet_tag[0] = 0;
}
......@@ -1962,7 +2020,7 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit)
//sys_vgui(".x%x.c raise %s\n",
// x,
// canvas_cnct_inlet_tag);
inlet_issignal = obj_issignaloutlet(ob2, closest2);
inlet_issignal = obj_issignalinlet(ob2, closest2);
}
canvas_setcursor(x, CURSOR_EDITMODE_CONNECT);
}
......
......@@ -561,7 +561,7 @@ t_float glist_pixelstoy(t_glist *x, t_float ypix)
{
int x1, y1, x2, y2;
if (!x->gl_owner)
bug("glist_pixelstox");
bug("glist_pixelstoy");
graph_graphrect(&x->gl_gobj, x->gl_owner, &x1, &y1, &x2, &y2);
return (x->gl_y1 + (x->gl_y2 - x->gl_y1) *
(ypix - y1) / (y2 - y1));
......@@ -859,8 +859,9 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
glist_getfont(x), sys_fontweight, tag);
/* draw contents of graph as glist */
for (g = x->gl_list; g; g = g->g_next)
for (g = x->gl_list; g; g = g->g_next) {
gobj_vis(g, x, 1);
}
}
else
{
......@@ -897,6 +898,7 @@ static void graph_graphrect(t_gobj *z, t_glist *glist,
static void graph_getrect(t_gobj *z, t_glist *glist,
int *xp1, int *yp1, int *xp2, int *yp2)
{
//fprintf(stderr,"graph_getrect\n");
int x1 = 0x7fffffff, y1 = 0x7fffffff, x2 = -0x7fffffff, y2 = -0x7fffffff;
t_glist *x = (t_glist *)z;
if (x->gl_isgraph)
......@@ -907,6 +909,12 @@ static void graph_getrect(t_gobj *z, t_glist *glist,
int x21, y21, x22, y22;
graph_graphrect(z, glist, &x1, &y1, &x2, &y2);
/* fix visibility of edge items */
x1 -= 1;
y1 -= 1;
//x2 += 1;
y2 += 1;
if (canvas_showtext(x))
{
text_widgetbehavior.w_getrectfn(z, glist, &x21, &y21, &x22, &y22);
......
......@@ -157,142 +157,144 @@ extern int sys_oldtclversion;
static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp,
int *indexp)
{
t_float dispx, dispy;
char smallbuf[200], *tempbuf;
int outchars = 0, nlines = 0, ncolumns = 0,
pixwide, pixhigh, font, fontwidth, fontheight, findx, findy;
int reportedindex = 0;
t_canvas *canvas = glist_getcanvas(x->x_glist);
int widthspec = x->x_text->te_width;
int widthlimit = (widthspec ? widthspec : BOXWIDTH);
int inindex = 0;
int selstart = 0, selend = 0;
/* if we're a GOP (the new, "goprect" style) borrow the font size
from the inside to preserve the spacing */
if (pd_class(&x->x_text->te_pd) == canvas_class &&
((t_glist *)(x->x_text))->gl_isgraph &&
((t_glist *)(x->x_text))->gl_goprect)
font = glist_getfont((t_glist *)(x->x_text));
else font = glist_getfont(x->x_glist);
fontwidth = sys_fontwidth(font);
fontheight = sys_fontheight(font);
findx = (*widthp + (fontwidth/2)) / fontwidth;
findy = *heightp / fontheight;
if (x->x_bufsize >= 100)
tempbuf = (char *)t_getbytes(2 * x->x_bufsize + 1);
else tempbuf = smallbuf;
while (x->x_bufsize - inindex > 0)
{
int inchars = x->x_bufsize - inindex;
int maxindex = (inchars > widthlimit ? widthlimit : inchars);
int eatchar = 1;
int foundit = firstone(x->x_buf + inindex, '\n', maxindex);
if (foundit < 0)
{
if (inchars > widthlimit)
{
foundit = lastone(x->x_buf + inindex, ' ', maxindex);
if (foundit < 0)
{
foundit = maxindex;
eatchar = 0;
}
}
else
{
foundit = inchars;
eatchar = 0;
}
}
if (nlines == findy)
{
int actualx = (findx < 0 ? 0 :
(findx > foundit ? foundit : findx));
*indexp = inindex + actualx;
reportedindex = 1;
}
strncpy(tempbuf+outchars, x->x_buf + inindex, foundit);
if (x->x_selstart >= inindex &&
x->x_selstart <= inindex + foundit + eatchar)
selstart = x->x_selstart + outchars - inindex;
if (x->x_selend >= inindex &&
x->x_selend <= inindex + foundit + eatchar)
selend = x->x_selend + outchars - inindex;
outchars += foundit;
inindex += (foundit + eatchar);
if (inindex < x->x_bufsize)
tempbuf[outchars++] = '\n';
if (foundit > ncolumns)
ncolumns = foundit;
nlines++;
}
if (!reportedindex)
*indexp = outchars;
dispx = text_xpix(x->x_text, x->x_glist);
dispy = text_ypix(x->x_text, x->x_glist);
if (nlines < 1) nlines = 1;
if (!widthspec)
{
while (ncolumns < 3)
{
tempbuf[outchars++] = ' ';
ncolumns++;
}
}
else ncolumns = widthspec;
pixwide = ncolumns * fontwidth + (LMARGIN + RMARGIN);
pixhigh = nlines * fontheight + (TMARGIN + BMARGIN);
if (action == SEND_FIRST)
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n",
canvas, x->x_tag,
dispx + LMARGIN, dispy + TMARGIN,
outchars, tempbuf, sys_hostfontsize(font),
(glist_isselected(x->x_glist,
&x->x_glist->gl_gobj)? "$select_color" : "$text_color"));
else if (action == SEND_UPDATE)
{
/*fprintf(stderr, "SEND_UPDATE canvas_class=%d isgraph=%d goprect=%d\n",
(pd_class(&x->x_text->te_pd) == canvas_class ? 1 : 0),
((t_glist *)(x->x_text))->gl_isgraph,
((t_glist *)(x->x_text))->gl_goprect );*/
sys_vgui("pdtk_text_set .x%lx.c %s {%.*s}\n",
canvas, x->x_tag, outchars, tempbuf);
/*if ( pd_class(&x->x_text->te_pd) == canvas_class &&
((t_glist *)(x->x_text))->gl_isgraph &&
(((t_glist *)(x->x_text))->gl_goprect) ) {
fprintf(stderr, "do not update outlets\n");
if (x) {
t_float dispx, dispy;
char smallbuf[200], *tempbuf;
int outchars = 0, nlines = 0, ncolumns = 0,
pixwide, pixhigh, font, fontwidth, fontheight, findx, findy;
int reportedindex = 0;
t_canvas *canvas = glist_getcanvas(x->x_glist);
int widthspec = x->x_text->te_width;
int widthlimit = (widthspec ? widthspec : BOXWIDTH);
int inindex = 0;
int selstart = 0, selend = 0;
/* if we're a GOP (the new, "goprect" style) borrow the font size
from the inside to preserve the spacing */
if (pd_class(&x->x_text->te_pd) == canvas_class &&
((t_glist *)(x->x_text))->gl_isgraph &&
((t_glist *)(x->x_text))->gl_goprect)
font = glist_getfont((t_glist *)(x->x_text));
else font = glist_getfont(x->x_glist);
fontwidth = sys_fontwidth(font);
fontheight = sys_fontheight(font);
findx = (*widthp + (fontwidth/2)) / fontwidth;
findy = *heightp / fontheight;
if (x->x_bufsize >= 100)
tempbuf = (char *)t_getbytes(2 * x->x_bufsize + 1);
else tempbuf = smallbuf;
while (x->x_bufsize - inindex > 0)
{
int inchars = x->x_bufsize - inindex;
int maxindex = (inchars > widthlimit ? widthlimit : inchars);
int eatchar = 1;
int foundit = firstone(x->x_buf + inindex, '\n', maxindex);
if (foundit < 0)
{
if (inchars > widthlimit)
{
foundit = lastone(x->x_buf + inindex, ' ', maxindex);
if (foundit < 0)
{
foundit = maxindex;
eatchar = 0;
}
}
else
{
foundit = inchars;
eatchar = 0;
}
}
if (nlines == findy)
{
int actualx = (findx < 0 ? 0 :
(findx > foundit ? foundit : findx));
*indexp = inindex + actualx;
reportedindex = 1;
}
strncpy(tempbuf+outchars, x->x_buf + inindex, foundit);
if (x->x_selstart >= inindex &&
x->x_selstart <= inindex + foundit + eatchar)
selstart = x->x_selstart + outchars - inindex;
if (x->x_selend >= inindex &&
x->x_selend <= inindex + foundit + eatchar)
selend = x->x_selend + outchars - inindex;
outchars += foundit;
inindex += (foundit + eatchar);
if (inindex < x->x_bufsize)
tempbuf[outchars++] = '\n';
if (foundit > ncolumns)
ncolumns = foundit;
nlines++;
}
else */
if (pixwide != x->x_drawnwidth || pixhigh != x->x_drawnheight)
text_drawborder(x->x_text, x->x_glist, x->x_tag,
pixwide, pixhigh, 0);
if (x->x_active)
{
if (selend > selstart)
{
sys_vgui(".x%lx.c select from %s %d\n", canvas,
x->x_tag, selstart);
sys_vgui(".x%lx.c select to %s %d\n", canvas,
x->x_tag, selend + (sys_oldtclversion ? 0 : -1));
sys_vgui(".x%lx.c focus \"\"\n", canvas);
}
else
{