{
GtkWidget *label;
gint x, y;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *device;
-#endif
if (ct->tip_window) return;
-#if GTK_CHECK_VERSION(3,0,0)
device_manager = gdk_display_get_device_manager(gdk_window_get_display(
gtk_widget_get_window(ct->listview)));
device = gdk_device_manager_get_client_pointer(device_manager);
gdk_window_get_device_position(gtk_widget_get_window(ct->listview),
device, &x, &y, NULL);
-#else
- gdk_window_get_pointer(gtk_widget_get_window(ct->listview), &x, &y, NULL);
-#endif
ct->tip_info = collection_table_find_data_by_coord(ct, x, y, NULL);
if (!ct->tip_info) return;
gtk_container_add(GTK_CONTAINER(ct->tip_window), label);
gtk_widget_show(label);
-#if GTK_CHECK_VERSION(3,0,0)
display = gdk_display_get_default();
device_manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(device_manager);
gdk_device_get_position(device, NULL, &x, &y);
-#else
- gdk_window_get_pointer(NULL, &x, &y, NULL);
-#endif
if (!gtk_widget_get_realized(ct->tip_window)) gtk_widget_realize(ct->tip_window);
gtk_window_move(GTK_WINDOW(ct->tip_window), x + 16, y + 16);
static void tip_update(CollectTable *ct, CollectInfo *info)
{
-#if GTK_CHECK_VERSION(3,0,0)
GdkDisplay *display = gdk_display_get_default();
GdkDeviceManager *device_manager = gdk_display_get_device_manager(display);
GdkDevice *device = gdk_device_manager_get_client_pointer(device_manager);
-#endif
tip_schedule(ct);
if (ct->tip_window)
{
gint x, y;
-#if GTK_CHECK_VERSION(3,0,0)
gdk_device_get_position(device, NULL, &x, &y);
-#else
- gdk_window_get_pointer(NULL, &x, &y, NULL);
-#endif
+
gtk_window_move(GTK_WINDOW(ct->tip_window), x + 16, y + 16);
if (info != ct->tip_info)
*-------------------------------------------------------------------
*/
-static void collection_table_popup_save_as_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_save_as_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_start_editor_from_filelist(key, collection_table_popup_file_list(ct), NULL, ct->listview);
}
-static void collection_table_popup_copy_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_copy(NULL, collection_table_popup_file_list(ct), NULL, ct->listview);
}
-static void collection_table_popup_move_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_move_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_move(NULL, collection_table_popup_file_list(ct), NULL, ct->listview);
}
-static void collection_table_popup_rename_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_rename(NULL, collection_table_popup_file_list(ct), ct->listview);
}
-static void collection_table_popup_delete_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_delete(NULL, collection_table_popup_file_list(ct), ct->listview);
}
-static void collection_table_popup_move_to_trash_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_delete(NULL, collection_table_popup_file_list(ct), ct->listview);
}
-static void collection_table_popup_copy_path_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
file_util_copy_path_list_to_clipboard(collection_table_popup_file_list(ct), TRUE);
}
-static void collection_table_popup_copy_path_unquoted_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_copy_path_unquoted_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
collection_set_sort_method(ct->cd, type);
}
-static void collection_table_popup_randomize_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_randomize_cb(GtkWidget *widget, gpointer UNUSED(data))
{
CollectTable *ct;
collection_randomize(ct->cd);
}
-static void collection_table_popup_view_new_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_view_new_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
}
}
-static void collection_table_popup_view_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_view_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
}
}
-static void collection_table_popup_selectall_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_selectall_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
ct->prev_selection= ct->click_info;
}
-static void collection_table_popup_unselectall_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_unselectall_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
ct->prev_selection= ct->click_info;
}
-static void collection_table_popup_select_invert_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_select_invert_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
ct->prev_selection= ct->click_info;
}
-static void collection_table_popup_rectangular_selection_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_rectangular_selection_cb(GtkWidget *UNUSED(widget), gpointer UNUSED(data))
{
options->collections.rectangular_selection = !(options->collections.rectangular_selection);
}
-static void collection_table_popup_remove_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
GList *list;
g_list_free(list);
}
-static void collection_table_popup_add_file_selection_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_add_file_selection_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
GList *list;
}
}
-static void collection_table_popup_add_collection_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_add_collection_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
collection_dialog_append(NULL, ct->cd);
}
-static void collection_table_popup_goto_original_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_goto_original_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
GList *list;
g_list_free(list);
}
-static void collection_table_popup_find_dupes_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_find_dupes_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
DupeWindow *dw;
dupe_window_add_collection(dw, ct->cd);
}
-static void collection_table_popup_print_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_print_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
FileData *fd;
print_window_new(fd, collection_table_selection_get_list(ct), collection_table_get_list(ct), gtk_widget_get_toplevel(ct->listview));
}
-static void collection_table_popup_show_names_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_show_names_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
collection_table_toggle_filenames(ct);
}
-static void collection_table_popup_show_stars_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_show_stars_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
collection_table_toggle_stars(ct);
}
-static void collection_table_popup_destroy_cb(GtkWidget *widget, gpointer data)
+static void collection_table_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
return ret;
}
-static void collection_table_menu_pos_cb(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
+static void collection_table_menu_pos_cb(GtkMenu *menu, gint *x, gint *y, gboolean *UNUSED(push_in), gpointer data)
{
CollectTable *ct = data;
GtkTreeModel *store;
popup_menu_position_clamp(menu, x, y, 0);
}
-static gboolean collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+static gboolean collection_table_press_key_cb(GtkWidget *UNUSED(widget), GdkEventKey *event, gpointer data)
{
CollectTable *ct = data;
gint focus_row = 0;
GtkTreeIter iter;
GtkTreePath *tpath;
GtkTreeViewColumn *column;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDeviceManager *device_manager;
GdkDevice *device;
-#endif
store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
-#if GTK_CHECK_VERSION(3,0,0)
if (!use_coord)
{
device_manager = gdk_display_get_device_manager(gdk_window_get_display(
gdk_window_get_device_position(gtk_widget_get_window(ct->listview),
device, &x, &y, NULL);
}
-#else
- if (!use_coord) gdk_window_get_pointer(gtk_widget_get_window(ct->listview), &x, &y, NULL);
-#endif
+
if (source)
{
gint col;
ct->marker_window = gdk_window_new(NULL, &attributes, attributes_mask);
-#if GTK_CHECK_VERSION(3,0,0)
cairo_region_t *mask;
cairo_pattern_t *pattern;
cairo_surface_t *img = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
cairo_pattern_destroy(pattern);
cairo_destroy(cr);
cairo_surface_destroy(img);
-#else
- GdkPixmap *pixmap;
- GdkBitmap *mask;
- gdk_pixbuf_render_pixmap_and_mask(pb, &pixmap, &mask, 128);
-
- gdk_window_set_back_pixmap(ct->marker_window, pixmap, FALSE);
- gdk_window_shape_combine_mask(ct->marker_window, mask, 0, 0);
-
- g_object_unref(pixmap);
- if (mask) g_object_unref(mask);
-#endif
g_object_unref(pb);
}
y = y + y_parent;
gdk_window_move(ct->marker_window, x, y);
-#if !GTK_CHECK_VERSION(3,0,0)
- gdk_window_clear(ct->marker_window);
-#endif
+
if (!gdk_window_is_visible(ct->marker_window)) gdk_window_show(ct->marker_window);
}
else
GdkWindow *window;
gint x, y;
gint w, h;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDeviceManager *device_manager;
GdkDevice *device;
-#endif
if (!ct->drop_idle_id) return FALSE;
window = gtk_widget_get_window(ct->listview);
-#if GTK_CHECK_VERSION(3,0,0)
device_manager = gdk_display_get_device_manager(gdk_window_get_display(window));
device = gdk_device_manager_get_client_pointer(device_manager);
gdk_window_get_device_position(window, device, &x, &y, NULL);
-#else
- gdk_window_get_pointer(window, &x, &y, NULL);
-#endif
+
w = gdk_window_get_width(window);
h = gdk_window_get_height(window);
if (x >= 0 && x < w && y >= 0 && y < h)
return FALSE;
}
-static gboolean collection_table_auto_scroll_notify_cb(GtkWidget *widget, gint x, gint y, gpointer data)
+static gboolean collection_table_auto_scroll_notify_cb(GtkWidget *UNUSED(widget), gint UNUSED(x), gint UNUSED(y), gpointer data)
{
CollectTable *ct = data;
*-------------------------------------------------------------------
*/
-static gboolean collection_table_motion_cb(GtkWidget *widget, GdkEventMotion *event, gpointer data)
+static gboolean collection_table_motion_cb(GtkWidget *UNUSED(widget), GdkEventMotion *event, gpointer data)
{
CollectTable *ct = data;
return FALSE;
}
-static gboolean collection_table_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
+static gboolean collection_table_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
{
CollectTable *ct = data;
GtkTreeIter iter;
return TRUE;
}
-static gboolean collection_table_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
+static gboolean collection_table_release_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
{
CollectTable *ct = data;
GtkTreeIter iter;
return TRUE;
}
-static gboolean collection_table_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
+static gboolean collection_table_leave_cb(GtkWidget *UNUSED(widget), GdkEventCrossing *UNUSED(event), gpointer data)
{
CollectTable *ct = data;
*-------------------------------------------------------------------
*/
-static gboolean collection_table_destroy_node_cb(GtkTreeModel *store, GtkTreePath *tpath, GtkTreeIter *iter, gpointer data)
+static gboolean collection_table_destroy_node_cb(GtkTreeModel *store, GtkTreePath *UNUSED(tpath), GtkTreeIter *iter, gpointer UNUSED(data))
{
GList *list;
collection_table_update_status(ct);
}
-static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint h, gboolean force)
+static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint UNUSED(h), gboolean force)
{
gint new_cols;
gint thumb_width;
}
}
-void collection_table_file_add(CollectTable *ct, CollectInfo *info)
+void collection_table_file_add(CollectTable *ct, CollectInfo *UNUSED(info))
{
collection_table_sync_idle(ct);
}
-void collection_table_file_insert(CollectTable *ct, CollectInfo *ci)
+void collection_table_file_insert(CollectTable *ct, CollectInfo *UNUSED(ci))
{
collection_table_sync_idle(ct);
}
}
-static void confirm_dir_list_add(GtkWidget *widget, gpointer data)
+static void confirm_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
confirm_dir_list_do(ct, ct->drop_list, FALSE);
}
-static void confirm_dir_list_recurse(GtkWidget *widget, gpointer data)
+static void confirm_dir_list_recurse(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
confirm_dir_list_do(ct, ct->drop_list, TRUE);
}
-static void confirm_dir_list_skip(GtkWidget *widget, gpointer data)
+static void confirm_dir_list_skip(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
static gint n_collection_drop_types = 2;
-static void collection_table_dnd_get(GtkWidget *widget, GdkDragContext *context,
+static void collection_table_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context),
GtkSelectionData *selection_data, guint info,
- guint time, gpointer data)
+ guint UNUSED(time), gpointer data)
{
CollectTable *ct = data;
gboolean selected;
}
-static void collection_table_dnd_receive(GtkWidget *widget, GdkDragContext *context,
+static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragContext *context,
gint x, gint y,
GtkSelectionData *selection_data, guint info,
guint time, gpointer data)
}
}
-static void collection_table_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data)
+static void collection_table_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), gpointer data)
{
CollectTable *ct = data;
collection_table_scroll(ct, FALSE);
}
-static gint collection_table_dnd_motion(GtkWidget *widget, GdkDragContext *context,
- gint x, gint y, guint time, gpointer data)
+static gint collection_table_dnd_motion(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context),
+ gint x, gint y, guint UNUSED(time), gpointer data)
{
CollectTable *ct = data;
return FALSE;
}
-static void collection_table_dnd_leave(GtkWidget *widget, GdkDragContext *context, guint time, gpointer data)
+static void collection_table_dnd_leave(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), guint UNUSED(time), gpointer data)
{
CollectTable *ct = data;
gint number;
};
-static void collection_table_cell_data_cb(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell,
+static void collection_table_cell_data_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
{
ColumnData *cd = data;
gtk_tree_model_get(tree_model, iter, CTABLE_COLUMN_POINTER, &list, -1);
-#if GTK_CHECK_VERSION(3,0,0)
/** @FIXME this is a primitive hack to stop a crash.
* When compiled with GTK3, if a Collection window containing
* say, 50 or so, images has its width changed, there is a segfault
* https://github.com/BestImageViewer/geeqie/issues/531
*/
if (cd->number == COLLECT_TABLE_MAX_COLUMNS) return;
-#endif
+
info = g_list_nth_data(list, cd->number);
style = gtk_widget_get_style(ct->listview);
*-------------------------------------------------------------------
*/
-static void collection_table_destroy(GtkWidget *widget, gpointer data)
+static void collection_table_destroy(GtkWidget *UNUSED(widget), gpointer data)
{
CollectTable *ct = data;
g_free(ct);
}
-static void collection_table_sized(GtkWidget *widget, GtkAllocation *allocation, gpointer data)
+static void collection_table_sized(GtkWidget *UNUSED(widget), GtkAllocation *allocation, gpointer data)
{
CollectTable *ct = data;