pane_close(p);
}
-void pane_focus(struct pane *focus)
+void pane_take_focus(struct pane *focus)
{
struct pane *p = focus;
struct mark *pt;
bool do_pane_has_focus(struct pane *focus, struct pane *root)
{
- /* Would pane_focus change anything */
+ /* Test inf pane_take_focus() would change anything. */
struct pane *p = focus;
if (!p)
void pane_subsume(struct pane *p safe, struct pane *parent safe);
void pane_close(struct pane *p safe);
bool pane_resize(struct pane *p safe, int x, int y, int w, int h);
-void pane_focus(struct pane *p);
+void pane_take_focus(struct pane *p);
bool do_pane_has_focus(struct pane *p, struct pane *root);
#define pane_has_focus(...) VFUNC(pane_has_focus, __VA_ARGS__)
#define pane_has_focus1(p) do_pane_has_focus(p, NULL)
if (other) {
par = home_call_ret(pane, focus, "DocPane", p);
if (par) {
- pane_focus(par);
+ pane_take_focus(par);
return 1;
}
par = call_ret(pane, "OtherPane", focus);
par = call_ret(pane, "ThisPane", focus);
if (par) {
p = home_call_ret(pane, p, "doc:attach-view", par);
- pane_focus(p);
+ pane_take_focus(p);
}
return 1;
}
p = home_call_ret(pane, doc, "doc:attach-view", p, 1);
}
free(fname);
- pane_focus(p);
+ pane_take_focus(p);
return 1;
}
if (other) {
par = home_call_ret(pane, focus, "DocPane", dp);
if (par) {
- pane_focus(par);
+ pane_take_focus(par);
return 1;
}
par = call_ret(pane, "OtherPane", focus);
if (par)
p = home_call_ret(pane, dp, "doc:attach-view", par, 1);
if (p) {
- pane_focus(p);
+ pane_take_focus(p);
return 1;
} else {
return Efail;
return Efail;
p = home_call_ret(pane, dp, "doc:attach-view", par, 1, NULL, buf+5);
if (p) {
- pane_focus(p);
+ pane_take_focus(p);
return 1;
} else {
return Efail;
if (esi->replace_pane && strcmp(ci->key, "K:Enter") == 0) {
/* if there is a replace pane, switch to it instead of closing */
- pane_focus(esi->replace_pane);
+ pane_take_focus(esi->replace_pane);
return 1;
}
str = call_ret(str, "doc:get-str", ci->focus);
struct es_info *esi = ci->home->data;
if (esi->replace_pane) {
- pane_focus(esi->replace_pane);
+ pane_take_focus(esi->replace_pane);
return 1;
}
home_call(esi->target, "highlight:set-popup", p, 1);
}
if (strcmp(ci->key, "K:A-%") == 0)
- pane_focus(ci->focus);
+ pane_take_focus(ci->focus);
else
- pane_focus(p);
+ pane_take_focus(p);
return 1;
}
{
struct pane *sp = ci->home->_data;
- pane_focus(sp);
+ pane_take_focus(sp);
return 1;
}
return Py_None;
}
-static PyObject *Pane_focus(Pane *self safe, PyObject *args)
+static PyObject *Pane_take_focus(Pane *self safe, PyObject *args)
{
if (!pane_valid(self))
return NULL;
- pane_focus(self->pane);
+ pane_take_focus(self->pane);
Py_INCREF(Py_None);
return Py_None;
}
"provides an iterator which will iterate over all children"},
{"clone_children", (PyCFunction)Pane_clone_children, METH_VARARGS,
"Clone all children onto the target"},
- {"take_focus", (PyCFunction)Pane_focus, METH_NOARGS,
+ {"take_focus", (PyCFunction)Pane_take_focus, METH_NOARGS,
"Claim the focus for this pane"},
{"has_focus", (PyCFunction)Pane_has_focus, METH_VARARGS,
"Check if pane is focus of display"},
struct mbinfo *mbi = home->data;
if (mbi->child)
- pane_focus(mbi->child);
+ pane_take_focus(mbi->child);
call("Keystroke-sequence", home, 0, NULL, ci->str);
return 1;
}
attr_set_str(&mlp->attrs, "render:wrap", "yes");
pane_damaged(ret, DAMAGED_VIEW);
mli->line = mlp;
- pane_focus(ret);
+ pane_take_focus(ret);
if (!edlib_testing(p))
/* This can introduce unwanted variablitiy in tests */
call_comm("event:timer", ret, &force_refresh, 15000);
if (ci->num)
/* Pane had focus, so give to target */
- pane_focus(ppi->target);
+ pane_take_focus(ppi->target);
command_put(ppi->done);
ppi->done = NULL;
free(ppi->style);
const char *aux;
struct command *done = ppi->done;
- pane_focus(target);
+ pane_take_focus(target);
key = pane_attr_get(focus, "done-key");
if (!key)
key = "PopupDone";
p = call_ret(pane, "OtherPane", ci->focus);
if (p) {
home_call(ci->home->focus, "doc:attach-view", p);
- pane_focus(p);
+ pane_take_focus(p);
}
return 1;
}
p = call_ret(pane, "OtherPane", p);
if (p) {
home_call(ci->home->focus, "doc:attach-view", p);
- pane_focus(p);
+ pane_take_focus(p);
}
return 1;
}
if (ppi->parent_popup)
pane_add_notify(p, ppi->parent_popup, "Notify:resize");
- pane_focus(p);
+ pane_take_focus(p);
if (ci->str2) {
struct pane *doc =
if (p->focus && p->focus->z) {
p2 = next_child(p, p->focus, 1);
if (p2) {
- pane_focus(p2);
+ pane_take_focus(p2);
return 1;
} else if (ti->leaf) {
- pane_focus(ti->content);
+ pane_take_focus(ti->content);
return 1;
}
t2 = tile_first(ti);
t2 = tile_next_named(ti, ci->str2);
if (tile_is_first(t2) &&
(p2 = tile_root_popup(t2)) != NULL) {
- pane_focus(p2);
+ pane_take_focus(p2);
return 1;
}
} else
t2 = tile_first(ti);
}
if (t2) {
- pane_focus(t2->p);
+ pane_take_focus(t2->p);
p2 = next_child(t2->p, NULL, 1);
if (p2)
- pane_focus(p2);
+ pane_take_focus(p2);
}
return 1;
}
if (wrong_pane(ci))
return Efallthrough;
t2 = list_prev_entry(ti, tiles);
- pane_focus(t2->p);
+ pane_take_focus(t2->p);
return 1;
}
struct pane *this = call_ret(pane, "ThisPane", ci->focus);
par = home_call_ret(pane, ci->focus, "DocPane", p);
if (par && par != this) {
- pane_focus(par);
+ pane_take_focus(par);
return 1;
}
par = call_ret(pane, "OtherPane", ci->focus);
p = home_call_ret(pane, p, "doc:attach-view", par, 1);
if (p)
- pane_focus(p);
+ pane_take_focus(p);
return p ? 1 : Efail;
}
struct pane *this = call_ret(pane, "ThisPane", ci->focus);
par = home_call_ret(pane, ci->focus, "DocPane", p);
if (par && par != this) {
- pane_focus(par);
+ pane_take_focus(par);
return 1;
}
par = call_ret(pane, "OtherPane", ci->focus);
p = home_call_ret(pane, p, "doc:attach-view", par, 1);
if (p)
- pane_focus(p);
+ pane_take_focus(p);
return p ? 1 : Efail;
}
struct pane *this = call_ret(pane, "ThisPane", ci->focus);
par = home_call_ret(pane, ci->focus, "DocPane", docs);
if (par && par != this) {
- pane_focus(par);
+ pane_take_focus(par);
return 1;
}
par = call_ret(pane, "OtherPane", ci->focus);
clear_selection(ci->focus, pt, mk, 0);
call("Move-to", ci->focus, 0, m);
- pane_focus(ci->focus);
+ pane_take_focus(ci->focus);
if (m2 && strcmp(ci->key, "M:DPress-1") == 0) {
type = attr_find(m2->attrs, "emacs:selection-type");
call("Replace", ci->focus, 0, NULL, str);
- pane_focus(ci->focus);
+ pane_take_focus(ci->focus);
return 1;
}
if (ci->key[0] == 'M') {
call("Move-CursorXY", ci->focus,
0, NULL, NULL, 0, NULL, NULL, ci->x, ci->y);
- pane_focus(ci->focus);
+ pane_take_focus(ci->focus);
}
s = call_ret(str, "Paste:get", ci->focus);