/*
* Geeqie
- * Copyright (C) 2008 - 2010 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Author: Laurent Monin
*
GtkWidget *vd_pop_menu(ViewDir *vd, FileData *fd)
{
GtkWidget *menu;
- GtkWidget *item;
gboolean active;
gboolean rename_delete_active = FALSE;
gboolean new_folder_active = FALSE;
menu_item_add_divider(menu);
- item = menu_item_add_radio(menu, _("View as _List"), GINT_TO_POINTER(DIRVIEW_LIST), vd->type == DIRVIEW_LIST,
- G_CALLBACK(vd_pop_submenu_dir_view_as_cb), vd);
+ menu_item_add_radio(menu, _("View as _List"), GINT_TO_POINTER(DIRVIEW_LIST), vd->type == DIRVIEW_LIST,
+ G_CALLBACK(vd_pop_submenu_dir_view_as_cb), vd);
- item = menu_item_add_radio(menu, _("View as _Tree"), GINT_TO_POINTER(DIRVIEW_TREE), vd->type == DIRVIEW_TREE,
- G_CALLBACK(vd_pop_submenu_dir_view_as_cb), vd);
+ menu_item_add_radio(menu, _("View as _Tree"), GINT_TO_POINTER(DIRVIEW_TREE), vd->type == DIRVIEW_TREE,
+ G_CALLBACK(vd_pop_submenu_dir_view_as_cb), vd);
menu_item_add_divider(menu);
{
ViewDir *vd = data;
GList *list;
- gchar *uritext = NULL;
- gint length = 0;
if (!vd->click_fd) return;
case TARGET_URI_LIST:
case TARGET_TEXT_PLAIN:
list = g_list_prepend(NULL, vd->click_fd);
- uritext = uri_text_from_filelist(list, &length, (info == TARGET_TEXT_PLAIN));
+ uri_selection_data_set_uris_from_filelist(selection_data, list);
g_list_free(list);
break;
}
- if (uritext)
- {
- gtk_selection_data_set(selection_data, selection_data->target,
- 8, (guchar *)uritext, length);
- g_free(uritext);
- }
}
static void vd_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
vd_color_set(vd, vd->click_fd, FALSE);
- if (vd->type == DIRVIEW_LIST && context->action == GDK_ACTION_MOVE)
+ if (vd->type == DIRVIEW_LIST && gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
vd_refresh(vd);
}
gint active;
gboolean done = FALSE;
- list = uri_filelist_from_text((gchar *)selection_data->data, TRUE);
+ list = uri_filelist_from_gtk_selection_data(selection_data);
if (!list) return;
active = access_file(fd->path, W_OK | X_OK);
if (active)
{
- if (context->actions == GDK_ACTION_COPY)
+ if (gdk_drag_context_get_actions(context) == GDK_ACTION_COPY)
{
file_util_copy_simple(list, fd->path, vd->widget);
done = TRUE;
list = NULL;
}
- else if (context->actions == GDK_ACTION_MOVE)
+ else if (gdk_drag_context_get_actions(context) == GDK_ACTION_MOVE)
{
file_util_move_simple(list, fd->path, vd->widget);
done = TRUE;
gint x, y;
gint w, h;
- window = vd->view->window;
+ window = gtk_widget_get_window(vd->view);
gdk_window_get_pointer(window, &x, &y, NULL);
- gdk_drawable_get_size(window, &w, &h);
+ w = gdk_window_get_width(window);
+ h = gdk_window_get_height(window);
if (x >= 0 && x < w && y >= 0 && y < h)
{
vd_dnd_drop_update(vd, x, y);
}
else
{
- gdk_drag_status(context, context->suggested_action, time);
+ gdk_drag_status(context, gdk_drag_context_get_suggested_action(context), time);
}
vd_dnd_drop_update(vd, x, y);