/*
- * Geeqie
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
*
* Author: John Ellis
*
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
#include "main.h"
#include "collect-table.h"
CTABLE_COLUMN_COUNT
};
-typedef enum {
- SELECTION_NONE = 0,
- SELECTION_SELECTED = 1 << 0,
- SELECTION_PRELIGHT = 1 << 1,
- SELECTION_FOCUS = 1 << 2
-} SelectionType;
-
-
#define INFO_SELECTED(x) (x->flag_mask & SELECTION_SELECTED)
{
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)
ct->prev_selection= ct->click_info;
}
+static void collection_table_popup_rectangular_selection_cb(GtkWidget *widget, gpointer data)
+{
+ CollectTable *ct = data;
+
+ options->collections.rectangular_selection = !(options->collections.rectangular_selection);
+}
+
static void collection_table_popup_remove_cb(GtkWidget *widget, gpointer data)
{
CollectTable *ct = data;
CollectTable *ct = data;
DupeWindow *dw;
- dw = dupe_window_new(DUPE_MATCH_NAME);
+ dw = dupe_window_new();
dupe_window_add_collection(dw, ct->cd);
}
G_CALLBACK(collection_table_popup_unselectall_cb), ct);
menu_item_add(submenu, _("Invert selection"),
G_CALLBACK(collection_table_popup_select_invert_cb), ct);
+ menu_item_add_check(submenu, _("Rectangular selection"), (options->collections.rectangular_selection != FALSE),
+ G_CALLBACK(collection_table_popup_rectangular_selection_cb), ct);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
menu_item_add_divider(menu);
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(
+ 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
if (!use_coord) gdk_window_get_pointer(gtk_widget_get_window(ct->listview), &x, &y, NULL);
-
+#endif
if (source)
{
gint col;
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)
*-------------------------------------------------------------------
*/
-static gboolean collection_table_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
+static gboolean collection_table_motion_cb(GtkWidget *widget, GdkEventMotion *event, gpointer data)
{
CollectTable *ct = data;
- collection_table_motion_update(ct, (gint)bevent->x, (gint)bevent->y, FALSE);
+ collection_table_motion_update(ct, (gint)event->x, (gint)event->y, FALSE);
return FALSE;
}