void (*select_func)(ViewDir *vd, const gchar *path, gpointer data);
gpointer select_data;
+ void (*dnd_drop_update_func)(ViewDir *vd);
+ void (*dnd_drop_leave_func)(ViewDir *vd);
+
LayoutWindow *layout;
GtkWidget *popup;
vd->popup = NULL;
+ vd->dnd_drop_leave_func = NULL;
+ vd->dnd_drop_update_func = NULL;
+
vd->widget = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(vd->widget), GTK_SHADOW_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vd->widget),
}
}
-static void vd_drop_update(ViewDir *vd, gint x, gint y)
+static void vd_dnd_drop_update(ViewDir *vd, gint x, gint y)
{
GtkTreePath *tpath;
FileData *fd = NULL;
{
vd_color_set(vd, vd->drop_fd, FALSE);
vd_color_set(vd, fd, TRUE);
- if (vd->type == DIRVIEW_TREE && fd) vdtree_dnd_drop_expand(vd);
+ if (fd && vd->dnd_drop_update_func) vd->dnd_drop_update_func(vd);
}
vd->drop_fd = fd;
gdk_drawable_get_size(window, &w, &h);
if (x >= 0 && x < w && y >= 0 && y < h)
{
- vd_drop_update(vd, x, y);
+ vd_dnd_drop_update(vd, x, y);
}
}
gdk_drag_status(context, context->suggested_action, time);
}
- vd_drop_update(vd, x, y);
+ vd_dnd_drop_update(vd, x, y);
if (vd->drop_fd)
{
vd->drop_fd = NULL;
- if (vd->type == DIRVIEW_TREE) vdtree_dnd_drop_expand_cancel(vd);
+ if (vd->dnd_drop_leave_func) vd->dnd_drop_leave_func(vd);
}
void vd_dnd_init(ViewDir *vd)
return FALSE;
}
-void vdtree_dnd_drop_expand_cancel(ViewDir *vd)
+static void vdtree_dnd_drop_expand_cancel(ViewDir *vd)
{
if (VDTREE_INFO(vd, drop_expand_id) != -1) g_source_remove(VDTREE_INFO(vd, drop_expand_id));
VDTREE_INFO(vd, drop_expand_id) = -1;
}
-void vdtree_dnd_drop_expand(ViewDir *vd)
+static void vdtree_dnd_drop_expand(ViewDir *vd)
{
vdtree_dnd_drop_expand_cancel(vd);
VDTREE_INFO(vd, drop_expand_id) = g_timeout_add(1000, vdtree_dnd_drop_expand_cb, vd);
vd->type = DIRVIEW_TREE;
VDTREE_INFO(vd, drop_expand_id) = -1;
-
VDTREE_INFO(vd, busy_ref) = 0;
+
+ vd->dnd_drop_leave_func = vdtree_dnd_drop_expand_cancel;
+ vd->dnd_drop_update_func = vdtree_dnd_drop_expand;
store = gtk_tree_store_new(4, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
vd->view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
FileData *vdtree_populate_path(ViewDir *vd, const gchar *path, gint expand, gint force);
void vdtree_rename_by_data(ViewDir *vd, FileData *fd);
-void vdtree_dnd_drop_expand_cancel(ViewDir *vd);
-void vdtree_dnd_drop_expand(ViewDir *vd);
-
gint vdtree_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
gint vdtree_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);