FileData *dir_fd;
GList *list;
+ FileData *click_fd;
+
SortType sort_method;
gboolean sort_ascend;
gboolean sort_case;
struct ViewFileInfoList
{
- FileData *click_fd;
FileData *select_fd;
gboolean thumbs_enabled;
guint tip_delay_id; /**< event source id */
FileData *tip_fd;
- FileData *click_fd;
-
FileData *focus_fd;
gint focus_row;
gint focus_column;
GList *vficon_pop_menu_file_list(ViewFile *vf)
{
- if (!VFICON(vf)->click_fd) return nullptr;
+ if (!vf->click_fd) return nullptr;
- if (VFICON(vf)->click_fd->selected & SELECTION_SELECTED)
+ if (vf->click_fd->selected & SELECTION_SELECTED)
{
return vf_selection_get_list(vf);
}
- return vficon_selection_get_one(vf, VFICON(vf)->click_fd);
+ return vficon_selection_get_one(vf, vf->click_fd);
}
void vficon_pop_menu_view_cb(GtkWidget *, gpointer data)
{
auto vf = static_cast<ViewFile *>(data);
- if (!VFICON(vf)->click_fd) return;
+ if (!vf->click_fd) return;
- if (VFICON(vf)->click_fd->selected & SELECTION_SELECTED)
+ if (vf->click_fd->selected & SELECTION_SELECTED)
{
GList *list;
}
else
{
- view_window_new(VFICON(vf)->click_fd);
+ view_window_new(vf->click_fd);
}
}
void vficon_popup_destroy_cb(GtkWidget *, gpointer data)
{
auto vf = static_cast<ViewFile *>(data);
- vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, nullptr);
- VFICON(vf)->click_fd = nullptr;
+ vficon_selection_remove(vf, vf->click_fd, SELECTION_PRELIGHT, nullptr);
+ vf->click_fd = nullptr;
vf->popup = nullptr;
}
auto vf = static_cast<ViewFile *>(data);
GList *list = nullptr;
- if (!VFICON(vf)->click_fd) return;
+ if (!vf->click_fd) return;
- if (VFICON(vf)->click_fd->selected & SELECTION_SELECTED)
+ if (vf->click_fd->selected & SELECTION_SELECTED)
{
list = vf_selection_get_list(vf);
}
else
{
- list = g_list_append(nullptr, file_data_ref(VFICON(vf)->click_fd));
+ list = g_list_append(nullptr, file_data_ref(vf->click_fd));
}
if (!list) return;
tip_unschedule(vf);
- if (VFICON(vf)->click_fd && VFICON(vf)->click_fd->thumb_pixbuf)
+ if (vf->click_fd && vf->click_fd->thumb_pixbuf)
{
gint items;
- if (VFICON(vf)->click_fd->selected & SELECTION_SELECTED)
+ if (vf->click_fd->selected & SELECTION_SELECTED)
items = g_list_length(VFICON(vf)->selection);
else
items = 1;
- dnd_set_drag_icon(widget, context, VFICON(vf)->click_fd->thumb_pixbuf, items);
+ dnd_set_drag_icon(widget, context, vf->click_fd->thumb_pixbuf, items);
}
}
{
auto vf = static_cast<ViewFile *>(data);
- vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, nullptr);
+ vficon_selection_remove(vf, vf->click_fd, SELECTION_PRELIGHT, nullptr);
if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
fd = vficon_find_data(vf, VFICON(vf)->focus_row, VFICON(vf)->focus_column, nullptr);
if (fd)
{
- VFICON(vf)->click_fd = fd;
+ vf->click_fd = fd;
if (event->state & GDK_CONTROL_MASK)
{
gint selected;
break;
case GDK_KEY_Menu:
fd = vficon_find_data(vf, VFICON(vf)->focus_row, VFICON(vf)->focus_column, nullptr);
- VFICON(vf)->click_fd = fd;
+ vf->click_fd = fd;
- vficon_selection_add(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, nullptr);
+ vficon_selection_add(vf, vf->click_fd, SELECTION_PRELIGHT, nullptr);
tip_unschedule(vf);
vf->popup = vf_pop_menu(vf);
}
else
{
- vficon_select_region_util(vf, VFICON(vf)->click_fd, old_fd, FALSE);
+ vficon_select_region_util(vf, vf->click_fd, old_fd, FALSE);
}
- vficon_select_region_util(vf, VFICON(vf)->click_fd, new_fd, TRUE);
+ vficon_select_region_util(vf, vf->click_fd, new_fd, TRUE);
vficon_send_layout_select(vf, new_fd);
}
else if (event->state & GDK_CONTROL_MASK)
{
- VFICON(vf)->click_fd = new_fd;
+ vf->click_fd = new_fd;
}
else
{
- VFICON(vf)->click_fd = new_fd;
+ vf->click_fd = new_fd;
vf_select_none(vf);
vficon_select(vf, new_fd);
vficon_send_layout_select(vf, new_fd);
if (fd)
{
- VFICON(vf)->click_fd = fd;
- vficon_selection_add(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, &iter);
+ vf->click_fd = fd;
+ vficon_selection_add(vf, vf->click_fd, SELECTION_PRELIGHT, &iter);
switch (bevent->button)
{
if (bevent->type == GDK_2BUTTON_PRESS && vf->layout)
{
- if (VFICON(vf)->click_fd->format_class == FORMAT_CLASS_COLLECTION)
+ if (vf->click_fd->format_class == FORMAT_CLASS_COLLECTION)
{
- collection_window_new(VFICON(vf)->click_fd->path);
+ collection_window_new(vf->click_fd->path);
}
else
{
- vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, &iter);
+ vficon_selection_remove(vf, vf->click_fd, SELECTION_PRELIGHT, &iter);
layout_image_full_screen_start(vf->layout);
}
}
fd = vficon_find_data_by_coord(vf, static_cast<gint>(bevent->x), static_cast<gint>(bevent->y), &iter);
}
- if (VFICON(vf)->click_fd)
+ if (vf->click_fd)
{
- vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, nullptr);
+ vficon_selection_remove(vf, vf->click_fd, SELECTION_PRELIGHT, nullptr);
}
- if (!fd || VFICON(vf)->click_fd != fd) return TRUE;
+ if (!fd || vf->click_fd != fd) return TRUE;
was_selected = !!(fd->selected & SELECTION_SELECTED);
GList *to_delete = work;
work = work->next;
if (fd == VFICON(vf)->prev_selection) VFICON(vf)->prev_selection = nullptr;
- if (fd == VFICON(vf)->click_fd) VFICON(vf)->click_fd = nullptr;
+ if (fd == vf->click_fd) vf->click_fd = nullptr;
file_data_unref(fd);
vf->list = g_list_delete_link(vf->list, to_delete);
}
auto vf = static_cast<ViewFile *>(data);
GList *list = nullptr;
- if (!VFLIST(vf)->click_fd) return;
+ if (!vf->click_fd) return;
- if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
+ if (vflist_row_is_selected(vf, vf->click_fd))
{
list = vf_selection_get_list(vf);
}
else
{
- list = g_list_append(nullptr, file_data_ref(VFLIST(vf)->click_fd));
+ list = g_list_append(nullptr, file_data_ref(vf->click_fd));
}
if (!list) return;
{
auto vf = static_cast<ViewFile *>(data);
- vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
+ vflist_color_set(vf, vf->click_fd, TRUE);
if (VFLIST(vf)->thumbs_enabled &&
- VFLIST(vf)->click_fd && VFLIST(vf)->click_fd->thumb_pixbuf)
+ vf->click_fd && vf->click_fd->thumb_pixbuf)
{
guint items;
- if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
+ if (vflist_row_is_selected(vf, vf->click_fd))
items = vf_selection_count(vf, nullptr);
else
items = 1;
- dnd_set_drag_icon(widget, context, VFLIST(vf)->click_fd->thumb_pixbuf, items);
+ dnd_set_drag_icon(widget, context, vf->click_fd->thumb_pixbuf, items);
}
}
{
auto vf = static_cast<ViewFile *>(data);
- vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
+ vflist_color_set(vf, vf->click_fd, FALSE);
if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
GList *vflist_pop_menu_file_list(ViewFile *vf)
{
- if (!VFLIST(vf)->click_fd) return nullptr;
+ if (!vf->click_fd) return nullptr;
- if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
+ if (vflist_row_is_selected(vf, vf->click_fd))
{
return vf_selection_get_list(vf);
}
- return vflist_selection_get_one(vf, VFLIST(vf)->click_fd);
+ return vflist_selection_get_one(vf, vf->click_fd);
}
{
auto vf = static_cast<ViewFile *>(data);
- if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
+ if (vflist_row_is_selected(vf, vf->click_fd))
{
GList *list;
}
else
{
- view_window_new(VFLIST(vf)->click_fd);
+ view_window_new(vf->click_fd);
}
}
list = vf_pop_menu_file_list(vf);
if (options->file_ops.enable_in_place_rename &&
- list && !list->next && VFLIST(vf)->click_fd)
+ list && !list->next && vf->click_fd)
{
GtkTreeModel *store;
GtkTreeIter iter;
filelist_free(list);
store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
- if (vflist_find_row(vf, VFLIST(vf)->click_fd, &iter) >= 0)
+ if (vflist_find_row(vf, vf->click_fd, &iter) >= 0)
{
GtkTreePath *tpath;
tpath = gtk_tree_model_get_path(store, &iter);
tree_edit_by_path(GTK_TREE_VIEW(vf->listview), tpath,
- FILE_VIEW_COLUMN_FORMATTED, VFLIST(vf)->click_fd->name,
- vflist_row_rename_cb, vf);
+ FILE_VIEW_COLUMN_FORMATTED, vf->click_fd->name,
+ vflist_row_rename_cb, vf);
gtk_tree_path_free(tpath);
}
return;
{
auto vf = static_cast<ViewFile *>(data);
- vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
+ vflist_color_set(vf, vf->click_fd, FALSE);
if (vf->layout)
{
layout_thumb_set(vf->layout, !VFLIST(vf)->thumbs_enabled);
{
vflist_populate_view(vf, TRUE);
- vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
+ vflist_color_set(vf, vf->click_fd, FALSE);
vflist_star_rating_set(vf, options->show_star_rating);
}
{
auto vf = static_cast<ViewFile *>(data);
- vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
+ vflist_color_set(vf, vf->click_fd, FALSE);
vf_refresh(vf);
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview));
}
void vflist_popup_destroy_cb(GtkWidget *, gpointer data)
{
auto vf = static_cast<ViewFile *>(data);
- vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
- VFLIST(vf)->click_fd = nullptr;
+ vflist_color_set(vf, vf->click_fd, FALSE);
+ vf->click_fd = nullptr;
vf->popup = nullptr;
}
store = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
gtk_tree_model_get_iter(store, &iter, tpath);
- gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &VFLIST(vf)->click_fd, -1);
+ gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &vf->click_fd, -1);
gtk_tree_path_free(tpath);
}
else
{
- VFLIST(vf)->click_fd = nullptr;
+ vf->click_fd = nullptr;
}
vf->popup = vf_pop_menu(vf);
gtk_tree_path_free(tpath);
}
- VFLIST(vf)->click_fd = fd;
+ vf->click_fd = fd;
if (bevent->button == MOUSE_BUTTON_RIGHT)
{
if (bevent->button == MOUSE_BUTTON_LEFT && bevent->type == GDK_2BUTTON_PRESS)
{
- if (VFLIST(vf)->click_fd->format_class == FORMAT_CLASS_COLLECTION)
+ if (vf->click_fd->format_class == FORMAT_CLASS_COLLECTION)
{
- collection_window_new(VFLIST(vf)->click_fd->path);
+ collection_window_new(vf->click_fd->path);
}
else
{
if (bevent->button == MOUSE_BUTTON_MIDDLE)
{
- vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
+ vflist_color_set(vf, vf->click_fd, FALSE);
}
if (bevent->button != MOUSE_BUTTON_LEFT && bevent->button != MOUSE_BUTTON_MIDDLE)
if (bevent->button == MOUSE_BUTTON_MIDDLE)
{
- if (fd && VFLIST(vf)->click_fd == fd)
+ if (fd && vf->click_fd == fd)
{
GtkTreeSelection *selection;
return TRUE;
}
- if (fd && VFLIST(vf)->click_fd == fd &&
+ if (fd && vf->click_fd == fd &&
!(bevent->state & GDK_SHIFT_MASK ) &&
!(bevent->state & GDK_CONTROL_MASK ) &&
vflist_row_is_selected(vf, fd))
{
auto vf = static_cast<ViewFile *>(data);
LayoutWindow *lw_new;
- FileData *fd = nullptr;
gchar *dest_dir;
- switch (vf->type)
- {
- case FILEVIEW_LIST:
- fd = (VFLIST(vf)->click_fd);
- break;
- case FILEVIEW_ICON:
- fd = (VFICON(vf)->click_fd);
- break;
- }
-
- dest_dir = open_archive(fd);
+ dest_dir = open_archive(vf->click_fd);
if (dest_dir)
{
lw_new = layout_new_from_default();
gboolean class_archive = FALSE;
GtkAccelGroup *accel_group;
- switch (vf->type)
- {
- case FILEVIEW_LIST:
- vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
- active = (VFLIST(vf)->click_fd != nullptr);
- class_archive = (VFLIST(vf)->click_fd != nullptr && VFLIST(vf)->click_fd->format_class == FORMAT_CLASS_ARCHIVE);
- break;
- case FILEVIEW_ICON:
- active = (VFICON(vf)->click_fd != nullptr);
- class_archive = (VFICON(vf)->click_fd != nullptr && VFICON(vf)->click_fd->format_class == FORMAT_CLASS_ARCHIVE);
- break;
- }
+ if (vf->type == FILEVIEW_LIST)
+ {
+ vflist_color_set(vf, vf->click_fd, TRUE);
+ }
+
+ active = (vf->click_fd != nullptr);
+ class_archive = (vf->click_fd != nullptr && vf->click_fd->format_class == FORMAT_CLASS_ARCHIVE);
menu = popup_menu_short_lived();