rio: implement "look" (thanks lf94)
This commit is contained in:
parent
784e6ff8cd
commit
7c503e6f49
3 changed files with 29 additions and 0 deletions
|
@ -210,6 +210,7 @@ void wmousectl(Window*);
|
||||||
void wmovemouse(Window*, Point);
|
void wmovemouse(Window*, Point);
|
||||||
void wpaste(Window*);
|
void wpaste(Window*);
|
||||||
void wplumb(Window*);
|
void wplumb(Window*);
|
||||||
|
void wlook(Window*);
|
||||||
void wrefresh(Window*, Rectangle);
|
void wrefresh(Window*, Rectangle);
|
||||||
void wrepaint(Window*);
|
void wrepaint(Window*);
|
||||||
void wresize(Window*, Image*, int);
|
void wresize(Window*, Image*, int);
|
||||||
|
|
|
@ -62,6 +62,7 @@ enum
|
||||||
Paste,
|
Paste,
|
||||||
Snarf,
|
Snarf,
|
||||||
Plumb,
|
Plumb,
|
||||||
|
Look,
|
||||||
Send,
|
Send,
|
||||||
Scroll,
|
Scroll,
|
||||||
};
|
};
|
||||||
|
@ -71,6 +72,7 @@ char *menu2str[] = {
|
||||||
[Paste] "paste",
|
[Paste] "paste",
|
||||||
[Snarf] "snarf",
|
[Snarf] "snarf",
|
||||||
[Plumb] "plumb",
|
[Plumb] "plumb",
|
||||||
|
[Look] "look",
|
||||||
[Send] "send",
|
[Send] "send",
|
||||||
[Scroll] "scroll",
|
[Scroll] "scroll",
|
||||||
nil
|
nil
|
||||||
|
@ -816,6 +818,10 @@ button2menu(Window *w)
|
||||||
wplumb(w);
|
wplumb(w);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Look:
|
||||||
|
wlook(w);
|
||||||
|
break;
|
||||||
|
|
||||||
case Send:
|
case Send:
|
||||||
getsnarf();
|
getsnarf();
|
||||||
wsnarf(w);
|
wsnarf(w);
|
||||||
|
|
|
@ -889,6 +889,28 @@ wplumb(Window *w)
|
||||||
plumbfree(m);
|
plumbfree(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
wlook(Window *w)
|
||||||
|
{
|
||||||
|
int i, n, e;
|
||||||
|
|
||||||
|
i = w->q1;
|
||||||
|
n = i - w->q0;
|
||||||
|
e = w->nr - n;
|
||||||
|
if(n <= 0 || e < n)
|
||||||
|
return;
|
||||||
|
|
||||||
|
while(runestrncmp(w->r+w->q0, w->r+i, n) != 0){
|
||||||
|
if(i < e)
|
||||||
|
i++;
|
||||||
|
else
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wsetselect(w, i, i+n);
|
||||||
|
wshow(w, i);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
winborder(Window *w, Point xy)
|
winborder(Window *w, Point xy)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue