/* event can enterkey, then it opens/closes */ static int outliner_item_activate(bContext *C, wmOperator *op, const wmEvent *event) { bool extend = RNA_boolean_get(op->ptr, "extend"); bool recursive = RNA_boolean_get(op->ptr, "recursive"); int x = event->mval[0]; int y = event->mval[1]; return outliner_item_do_activate(C, x, y, extend, recursive); }
static void object_select_hierarchy_cb(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *UNUSED(tselem)) { /* From where do i get the x,y coordinate of the mouse event ? */ wmWindow *win = CTX_wm_window(C); int x = win->eventstate->mval[0]; int y = win->eventstate->mval[1]; outliner_item_do_activate(C, x, y, true, true); }