Exemplo n.º 1
0
Arquivo: tree.c Projeto: ebichu/dd-wrt
static void tree_move_to_child (WTree *tree)
{
    tree_entry *current;

    /* Do we have a starting point? */
    if (!tree->selected_ptr)
	return;
    /* Take the next entry */
    current = tree->selected_ptr->next;
    /* Is it the child of the selected entry */
    if (current && current->sublevel > tree->selected_ptr->sublevel){
	/* Yes -> select this entry */
	tree->selected_ptr = current;
	tree->topdiff++;
	check_focus (tree);
    } else {
	/* No -> rescan and try again */
	tree_rescan_cmd (tree);
	current = tree->selected_ptr->next;
	if (current && current->sublevel > tree->selected_ptr->sublevel){
	    tree->selected_ptr = current;
	    tree->topdiff++;
	    check_focus (tree);
	}
    }
}
Exemplo n.º 2
0
Arquivo: tree.c Projeto: ebichu/dd-wrt
/* Search tree for text */
static int search_tree (WTree *tree, char *text)
{
    tree_entry *current;
    int len;
    int wrapped = 0;
    int found = 0;

    len = strlen (text);
    current = tree->selected_ptr;
    found = 0;
    while (!wrapped || current != tree->selected_ptr){
	if (strncmp (current->subname, text, len) == 0){
	    tree->selected_ptr = current;
	    found = 1;
	    break;
	}
	current = current->next;
	if (!current){
	    current = tree->store->tree_first;
	    wrapped = 1;
	}
	tree->topdiff++;
    }
    check_focus (tree);
    return found;
}
Exemplo n.º 3
0
void lclick_taskbutton(Client *old_c, Client *c)
{
	if (old_c != NULL)
	{
		if (old_c->was_hidden)
		{
			hide(old_c);
		}
	}

	if (c->hidden)
	{
		unhide(c);
	}
	else
	{
		if (c->was_hidden)
		{
			hide(c);
		}
		else
		{
			raise_lower(c);
		}
	}
	check_focus(c);
}
Exemplo n.º 4
0
static void
on_focus_changed_cb(nux::Area* area,
                    bool has_focus,
                    nux::KeyNavDirection direction,
                    AtkObject* accessible)
{
  check_focus(NUX_AREA_ACCESSIBLE(accessible));
}
Exemplo n.º 5
0
Arquivo: tree.c Projeto: ebichu/dd-wrt
void tree_chdir (WTree *tree, const char *dir)
{
    tree_entry *current;

    current = tree_store_whereis (dir);
    if (current){
	tree->selected_ptr = current;
	check_focus (tree);
    }
}
Exemplo n.º 6
0
/* parent input interface */
static void
input_handle_pointer_enter(void *data, struct wl_pointer *pointer,
			   uint32_t serial, struct wl_surface *surface,
			   wl_fixed_t x, wl_fixed_t y)
{
	struct wayland_input *input = data;

	/* XXX: If we get a modifier event immediately before the focus,
	 *      we should try to keep the same serial. */
	input->enter_serial = serial;
	input->output = wl_surface_get_user_data(surface);
	check_focus(input, x, y);
}
Exemplo n.º 7
0
static void
input_handle_motion(void *data, struct wl_pointer *pointer,
		    uint32_t time, wl_fixed_t x, wl_fixed_t y)
{
	struct wayland_input *input = data;
	struct wayland_compositor *c = input->compositor;

	check_focus(input, x, y);
	if (input->focus)
		notify_motion(&input->base, time,
			      x - wl_fixed_from_int(c->border.left) -
			      input->base.pointer->x,
			      y - wl_fixed_from_int(c->border.top) -
			      input->base.pointer->y);
}
Exemplo n.º 8
0
Arquivo: tree.c Projeto: ebichu/dd-wrt
static int tree_move_to_parent (WTree *tree)
{
    tree_entry *current;
    tree_entry *old;

    if (!tree->selected_ptr)
	return 0;
    old = tree->selected_ptr;
    current = tree->selected_ptr->prev;
    while (current && current->sublevel >= tree->selected_ptr->sublevel){
	current = current->prev;
	tree->topdiff--;
    }
    if (!current)
	current = tree->store->tree_first;
    tree->selected_ptr = current;
    check_focus (tree);
    return tree->selected_ptr != old;
}
Exemplo n.º 9
0
Arquivo: tree.c Projeto: ebichu/dd-wrt
static void tree_move_forward (WTree *tree, int i)
{
    tree_entry *current;
    int j = 0;

    if (tree_navigation_flag){
	current = tree->selected_ptr;
	while (j < i && current->next
	       && current->next->sublevel >= tree->selected_ptr->sublevel){
	    current = current->next;
	    if (current->sublevel == tree->selected_ptr->sublevel){
		tree->selected_ptr = current;
		j ++;
	    }
	}
	i = j;
    } else
	tree->selected_ptr = forw_ptr (tree->selected_ptr, &i);
    tree->topdiff += i;
    check_focus (tree);
}