#include "ui_fileops.h"
#include "ui_menu.h"
#include "ui_tree_edit.h"
-
+#include "view_file.h"
#include <gdk/gdkkeysyms.h> /* for keyboard values */
IconData *idb = b;
return filelist_sort_compare_filedata(ida->fd, idb->fd);
}
+
GList *iconlist_sort(GList *list, SortType method, gint ascend)
{
return filelist_sort_full(list, method, ascend, (GCompareFunc) iconlist_sort_file_cb);
if (VFICON_INFO(vf, click_id)->selected & SELECTION_SELECTED)
{
- return vficon_selection_get_list(vf);
+ return vf_selection_get_list(vf);
}
return g_list_append(NULL, file_data_ref(VFICON_INFO(vf, click_id)->fd));
{
GList *list;
- list = vficon_selection_get_list(vf);
+ list = vf_selection_get_list(vf);
view_window_new_from_list(list);
filelist_free(list);
}
}
else
{
- vficon_sort_set(vf, type, vf->sort_ascend);
+ vf_sort_set(vf, type, vf->sort_ascend);
}
}
}
else
{
- vficon_sort_set(vf, vf->sort_method, !vf->sort_ascend);
+ vf_sort_set(vf, vf->sort_method, !vf->sort_ascend);
}
}
{
ViewFile *vf = data;
- vficon_refresh(vf);
+ vf_refresh(vf);
}
static void vficon_popup_destroy_cb(GtkWidget *widget, gpointer data)
*-------------------------------------------------------------------
*/
-static void vficon_send_update(ViewFile *vf)
-{
- if (vf->func_status) vf->func_status(vf, vf->data_status);
-}
-
static void vficon_send_layout_select(ViewFile *vf, IconData *id)
{
FileData *read_ahead_fd = NULL;
row = g_list_index(vf->list, id);
if (row > vficon_index_by_fd(vf, cur_fd) &&
- row + 1 < vficon_count(vf, NULL))
+ row + 1 < vf_count(vf, NULL))
{
- read_ahead_fd = vficon_index_get_data(vf, row + 1);
+ read_ahead_fd = vf_index_get_data(vf, row + 1);
}
else if (row > 0)
{
- read_ahead_fd = vficon_index_get_data(vf, row - 1);
+ read_ahead_fd = vf_index_get_data(vf, row - 1);
}
}
if (VFICON_INFO(vf, click_id)->selected & SELECTION_SELECTED)
{
- list = vficon_selection_get_list(vf);
+ list = vf_selection_get_list(vf);
}
else
{
if (context->action == GDK_ACTION_MOVE)
{
- vficon_refresh(vf);
+ vf_refresh(vf);
}
tip_unschedule(vf);
vficon_selection_add(vf, id, SELECTION_SELECTED, NULL);
}
- vficon_send_update(vf);
+ vf_send_update(vf);
}
void vficon_select_none(ViewFile *vf)
g_list_free(VFICON_INFO(vf, selection));
VFICON_INFO(vf, selection) = NULL;
- vficon_send_update(vf);
+ vf_send_update(vf);
}
void vficon_select_invert(ViewFile *vf)
}
}
- vficon_send_update(vf);
+ vf_send_update(vf);
}
static void vficon_select(ViewFile *vf, IconData *id)
VFICON_INFO(vf, selection) = g_list_append(VFICON_INFO(vf, selection), id);
vficon_selection_add(vf, id, SELECTION_SELECTED, NULL);
- vficon_send_update(vf);
+ vf_send_update(vf);
}
static void vficon_unselect(ViewFile *vf, IconData *id)
VFICON_INFO(vf, selection) = g_list_remove(VFICON_INFO(vf, selection), id);
vficon_selection_remove(vf, id, SELECTION_SELECTED, NULL);
- vficon_send_update(vf);
+ vf_send_update(vf);
}
static void vficon_select_util(ViewFile *vf, IconData *id, gint select)
if (!(id->selected & SELECTION_SELECTED))
{
- vficon_select_none(vf);
+ vf_select_none(vf);
vficon_select(vf, id);
}
g_assert(mark >= 0 && mark < FILEDATA_MARKS_SIZE);
- slist = vficon_selection_get_list(vf);
+ slist = vf_selection_get_list(vf);
work = slist;
while (work)
{
}
else
{
- vficon_select_none(vf);
+ vf_select_none(vf);
vficon_select(vf, id);
vficon_send_layout_select(vf, id);
}
else
{
VFICON_INFO(vf, click_id) = new_id;
- vficon_select_none(vf);
+ vf_select_none(vf);
vficon_select(vf, new_id);
vficon_send_layout_select(vf, new_id);
}
}
else
{
- vficon_select_none(vf);
+ vf_select_none(vf);
if ((bevent->state & GDK_SHIFT_MASK) && VFICON_INFO(vf, prev_selection))
{
VFICON_INFO(vf, rows) = row + 1;
- vficon_send_update(vf);
+ vf_send_update(vf);
vficon_thumb_update(vf);
}
{
gint n;
- n = vficon_count(vf, NULL);
+ n = vf_count(vf, NULL);
if (ignore_list)
{
new_row = vficon_maint_find_closest(vf, row, n, ignore_list);
if (new_row == -1)
{
/* selection all ignored, use closest */
- new_row = vficon_maint_find_closest(vf, row, vficon_count(vf, NULL), ignore_list);
+ new_row = vficon_maint_find_closest(vf, row, vf_count(vf, NULL), ignore_list);
}
}
else
g_free(id);
vficon_sync_idle(vf);
- vficon_send_update(vf);
+ vf_send_update(vf);
return TRUE;
}
#include "ui_fileops.h"
#include "ui_menu.h"
#include "ui_tree_edit.h"
-#include "typedefs.h"
+#include "view_file.h"
#include <gdk/gdkkeysyms.h> /* for keyboard values */
static gint vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data);
static void vflist_populate_view(ViewFile *vf);
-/*
- *-----------------------------------------------------------------------------
- * signals
- *-----------------------------------------------------------------------------
- */
-
-static void vflist_send_update(ViewFile *vf)
-{
- if (vf->func_status) vf->func_status(vf, vf->data_status);
-}
/*
*-----------------------------------------------------------------------------
if (vflist_row_is_selected(vf, VFLIST_INFO(vf, click_fd)))
{
- list = vflist_selection_get_list(vf);
+ list = vf_selection_get_list(vf);
}
else
{
gint items;
if (vflist_row_is_selected(vf, VFLIST_INFO(vf, click_fd)))
- items = vflist_selection_count(vf, NULL);
+ items = vf_selection_count(vf, NULL);
else
items = 1;
if (context->action == GDK_ACTION_MOVE)
{
- vflist_refresh(vf);
+ vf_refresh(vf);
}
}
if (vflist_row_is_selected(vf, VFLIST_INFO(vf, click_fd)))
{
- return vflist_selection_get_list(vf);
+ return vf_selection_get_list(vf);
}
return g_list_append(NULL, file_data_ref(VFLIST_INFO(vf, click_fd)));
{
GList *list;
- list = vflist_selection_get_list(vf);
+ list = vf_selection_get_list(vf);
view_window_new_from_list(list);
filelist_free(list);
}
}
else
{
- vflist_sort_set(vf, type, vf->sort_ascend);
+ vf_sort_set(vf, type, vf->sort_ascend);
}
}
}
else
{
- vflist_sort_set(vf, vf->sort_method, !vf->sort_ascend);
+ vf_sort_set(vf, vf->sort_method, !vf->sort_ascend);
}
}
ViewFile *vf = data;
vflist_color_set(vf, VFLIST_INFO(vf, click_fd), FALSE);
- vflist_refresh(vf);
+ vf_refresh(vf);
}
static void vflist_pop_menu_sel_mark_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_mark_to_selection(vf, vf->active_mark, MTS_MODE_SET);
+ vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_SET);
}
static void vflist_pop_menu_sel_mark_and_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_mark_to_selection(vf, vf->active_mark, MTS_MODE_AND);
+ vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_AND);
}
static void vflist_pop_menu_sel_mark_or_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_mark_to_selection(vf, vf->active_mark, MTS_MODE_OR);
+ vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_OR);
}
static void vflist_pop_menu_sel_mark_minus_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_mark_to_selection(vf, vf->active_mark, MTS_MODE_MINUS);
+ vf_mark_to_selection(vf, vf->active_mark, MTS_MODE_MINUS);
}
static void vflist_pop_menu_set_mark_sel_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_selection_to_mark(vf, vf->active_mark, STM_MODE_SET);
+ vf_selection_to_mark(vf, vf->active_mark, STM_MODE_SET);
}
static void vflist_pop_menu_res_mark_sel_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_selection_to_mark(vf, vf->active_mark, STM_MODE_RESET);
+ vf_selection_to_mark(vf, vf->active_mark, STM_MODE_RESET);
}
static void vflist_pop_menu_toggle_mark_sel_cb(GtkWidget *widget, gpointer data)
{
ViewFile *vf = data;
- vflist_selection_to_mark(vf, vf->active_mark, STM_MODE_TOGGLE);
+ vf_selection_to_mark(vf, vf->active_mark, STM_MODE_TOGGLE);
}
}
else
{
- gint row = vflist_index_by_path(vf, old_path);
+ gint row = vf_index_by_path(vf, old_path);
if (row >= 0)
{
GList *work = g_list_nth(vf->list, row);
if (sel_fd && options->image.enable_read_ahead && row >= 0)
{
if (row > g_list_index(vf->list, cur_fd) &&
- row + 1 < vflist_count(vf, NULL))
+ row + 1 < vf_count(vf, NULL))
{
- read_ahead_fd = vflist_index_get_data(vf, row + 1);
+ read_ahead_fd = vf_index_get_data(vf, row + 1);
}
else if (row > 0)
{
- read_ahead_fd = vflist_index_get_data(vf, row - 1);
+ read_ahead_fd = vf_index_get_data(vf, row - 1);
}
}
return FALSE;
}
- vflist_send_update(vf);
+ vf_send_update(vf);
if (VFLIST_INFO(vf, select_fd))
{
{
FileData *fd;
- fd = vflist_index_get_data(vf, row);
+ fd = vf_index_get_data(vf, row);
return vflist_row_is_selected(vf, fd);
}
if (!vf->list)
{
gtk_tree_store_clear(store);
- vflist_send_update(vf);
+ vf_send_update(vf);
return;
}
gtk_tree_row_reference_free(visible_row);
}
- vflist_send_update(vf);
+ vf_send_update(vf);
vflist_thumb_update(vf);
}
filelist_free(vf->list);
vf->list = NULL;
- return vflist_refresh(vf);
+ return vf_refresh(vf);
}
void vflist_destroy_cb(GtkWidget *widget, gpointer data)
if (VFLIST_INFO(vf, thumbs_enabled) == enable) return;
VFLIST_INFO(vf, thumbs_enabled) = enable;
- if (vf->layout) vflist_refresh(vf);
+ if (vf->layout) vf_refresh(vf);
}
void vflist_marks_set(ViewFile *vf, gint enable)
}
g_list_free(columns);
- //vflist_refresh(vf);
+ //vf_refresh(vf);
}
/*
work = ignore_list;
while (work)
{
- gint f = vflist_index_by_path(vf, work->data);
+ gint f = vf_index_by_path(vf, work->data);
if (f >= 0) list = g_list_prepend(list, GINT_TO_POINTER(f));
work = work->next;
}
{
gint n;
- n = vflist_count(vf, NULL);
+ n = vf_count(vf, NULL);
if (ignore_list)
{
new_row = vflist_maint_find_closest(vf, row, n, ignore_list);
new_row = row - 1;
}
}
- vflist_select_none(vf);
+ vf_select_none(vf);
if (new_row >= 0)
{
- fd = vflist_index_get_data(vf, new_row);
+ fd = vf_index_get_data(vf, new_row);
if (vflist_find_row(vf, fd, &iter) >= 0)
{
GtkTreeSelection *selection;
}
}
- fd = vflist_index_get_data(vf, row);
+ fd = vf_index_get_data(vf, row);
if (vflist_find_row(vf, fd, &iter) >= 0)
{
GtkTreeStore *store;
vf->list = g_list_remove(vf->list, fd);
file_data_unref(fd);
- vflist_send_update(vf);
+ vf_send_update(vf);
return TRUE;
}