#include "collect-io.h"
#include "dnd.h"
#include "dupe.h"
-#include "editors.h"
#include "filedata.h"
#include "img-view.h"
#include "layout.h"
#include "uri-utils.h"
#include "view-file.h"
-#include "icons/marker.xpm"
-#define MARKER_WIDTH 26
-#define MARKER_HEIGHT 32
-
-#include <gdk/gdkkeysyms.h> /* for keyboard values */
-
/* between these, the icon width is increased by thumb_max_width / 2 */
#define THUMB_MIN_ICON_WIDTH 128
#define THUMB_MAX_ICON_WIDTH 150
{GDK_CONTROL_MASK, 'R', N_("Rename")},
{GDK_CONTROL_MASK, 'D', N_("Move to Trash")},
{GDK_CONTROL_MASK, 'W', N_("Close window")},
- {0, GDK_KEY_Delete, N_("Remove")},
- {0, GDK_KEY_Return, N_("View")},
- {0, 'V', N_("View in new window")},
+ {static_cast<GdkModifierType>(0), GDK_KEY_Delete, N_("Remove")},
+ {static_cast<GdkModifierType>(0), GDK_KEY_Return, N_("View")},
+ {static_cast<GdkModifierType>(0), 'V', N_("View in new window")},
{GDK_CONTROL_MASK, 'A', N_("Select all")},
- {GDK_CONTROL_MASK + GDK_SHIFT_MASK, 'A', N_("Select none")},
+ {static_cast<GdkModifierType>(GDK_CONTROL_MASK + GDK_SHIFT_MASK), 'A', N_("Select none")},
{GDK_MOD1_MASK, 'R', N_("Rectangular selection")},
- {0, GDK_KEY_space, N_("Select single file")},
+ {static_cast<GdkModifierType>(0), GDK_KEY_space, N_("Select single file")},
{GDK_CONTROL_MASK, GDK_KEY_space, N_("Toggle select image")},
{GDK_CONTROL_MASK, 'L', N_("Append from file selection")},
- {0, 'A', N_("Append from collection")},
- {0, 'S', N_("Save collection")},
+ {static_cast<GdkModifierType>(0), 'A', N_("Append from collection")},
+ {static_cast<GdkModifierType>(0), 'S', N_("Save collection")},
{GDK_CONTROL_MASK, 'S', N_("Save collection as")},
{GDK_CONTROL_MASK, 'T', N_("Show filename text")},
- {0, 'N', N_("Sort by name")},
- {0, 'I', N_("Sort by number")},
- {0, 'D', N_("Sort by date")},
- {0, 'B', N_("Sort by size")},
- {0, 'P', N_("Sort by path")},
+ {static_cast<GdkModifierType>(0), 'N', N_("Sort by name")},
+ {static_cast<GdkModifierType>(0), 'D', N_("Sort by date")},
+ {static_cast<GdkModifierType>(0), 'B', N_("Sort by size")},
+ {static_cast<GdkModifierType>(0), 'P', N_("Sort by path")},
{GDK_SHIFT_MASK, 'P', N_("Print")},
- {0, 0, NULL}
+ {static_cast<GdkModifierType>(0), 0, NULL}
};
/*
if (iter) *iter = p;
- return g_list_nth_data(list, col);
+ return static_cast<CollectInfo *>(g_list_nth_data(list, col));
}
return NULL;
n = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_number"));
if (iter) *iter = row;
- return g_list_nth_data(list, n);
+ return static_cast<CollectInfo *>(g_list_nth_data(list, n));
}
static guint collection_table_list_count(CollectTable *ct, gint64 *bytes)
work = ct->cd->list;
while (work)
{
- CollectInfo *ci = work->data;
+ CollectInfo *ci = static_cast<CollectInfo *>(work->data);
work = work->next;
b += ci->fd->size;
}
work = ct->selection;
while (work)
{
- CollectInfo *ci = work->data;
+ CollectInfo *ci = static_cast<CollectInfo *>(work->data);
work = work->next;
b += ci->fd->size;
}
static void collection_table_update_extras(CollectTable *ct, gboolean loading, gdouble value)
{
- gchar *text;
+ const gchar *text;
if (!ct->extra_label) return;
{
if (!info) return;
- collection_table_selection_set(ct, info, info->flag_mask | mask, iter);
+ collection_table_selection_set(ct, info, static_cast<SelectionType>(info->flag_mask | mask), iter);
}
static void collection_table_selection_remove(CollectTable *ct, CollectInfo *info, SelectionType mask, GtkTreeIter *iter)
{
if (!info) return;
- collection_table_selection_set(ct, info, info->flag_mask & ~mask, iter);
+ collection_table_selection_set(ct, info, static_cast<SelectionType>(info->flag_mask & ~mask), iter);
}
/*
*-------------------------------------------------------------------
work = ct->selection;
while (work)
{
- CollectInfo *info = work->data;
+ CollectInfo *info = static_cast<CollectInfo *>(work->data);
work = work->next;
if (!g_list_find(ct->cd->list, info))
{
while (work)
{
ct->selection = g_list_append(ct->selection, work->data);
- collection_table_selection_add(ct, work->data, SELECTION_SELECTED, NULL);
+ collection_table_selection_add(ct, static_cast<CollectInfo *>(work->data), SELECTION_SELECTED, NULL);
work = work->next;
}
work = ct->selection;
while (work)
{
- collection_table_selection_remove(ct, work->data, SELECTION_SELECTED, NULL);
+ collection_table_selection_remove(ct, static_cast<CollectInfo *>(work->data), SELECTION_SELECTED, NULL);
work = work->next;
}
work = ct->cd->list;
while (work)
{
- CollectInfo *info = work->data;
+ CollectInfo *info = static_cast<CollectInfo *>(work->data);
if (INFO_SELECTED(info))
{
work = g_list_find(ct->cd->list, start);
while (work)
{
- info = work->data;
+ info = static_cast<CollectInfo *>(work->data);
collection_table_select_util(ct, info, select);
if (work->data != end)
static gboolean tip_schedule_cb(gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
if (!ct->tip_delay_id) return FALSE;
return;
}
- label = g_object_get_data(G_OBJECT(ct->tip_window), "tip_label");
+ label = static_cast<GtkWidget *>(g_object_get_data(G_OBJECT(ct->tip_window), "tip_label"));
gtk_label_set_text(GTK_LABEL(label), ct->show_text ? ct->tip_info->fd->path : ct->tip_info->fd->name);
}
}
static void collection_table_popup_save_as_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_dialog_save_as(NULL, ct->cd);
}
static void collection_table_popup_save_cb(GtkWidget *widget, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
if (!ct->cd->path)
{
static void collection_table_popup_edit_cb(GtkWidget *widget, gpointer data)
{
CollectTable *ct;
- const gchar *key = data;
+ const gchar *key = static_cast<const gchar *>(data);
- ct = submenu_item_get_data(widget);
+ ct = static_cast<CollectTable *>(submenu_item_get_data(widget));
if (!ct) return;
static void collection_table_popup_copy_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
file_util_copy(NULL, collection_table_popup_file_list(ct), NULL, ct->listview);
}
static void collection_table_popup_move_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
file_util_move(NULL, collection_table_popup_file_list(ct), NULL, ct->listview);
}
static void collection_table_popup_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
file_util_rename(NULL, collection_table_popup_file_list(ct), ct->listview);
}
static void collection_table_popup_delete_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
options->file_ops.safe_delete_enable = FALSE;
file_util_delete(NULL, collection_table_popup_file_list(ct), ct->listview);
static void collection_table_popup_move_to_trash_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
options->file_ops.safe_delete_enable = TRUE;
file_util_delete(NULL, collection_table_popup_file_list(ct), ct->listview);
static void collection_table_popup_copy_path_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(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 *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
file_util_copy_path_list_to_clipboard(collection_table_popup_file_list(ct), FALSE);
}
CollectTable *ct;
SortType type;
- ct = submenu_item_get_data(widget);
+ ct = static_cast<CollectTable *>(submenu_item_get_data(widget));
if (!ct) return;
{
CollectTable *ct;
- ct = submenu_item_get_data(widget);
+ ct = static_cast<CollectTable *>(submenu_item_get_data(widget));
if (!ct) return;
static void collection_table_popup_view_new_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
if (ct->click_info && g_list_find(ct->cd->list, ct->click_info))
{
static void collection_table_popup_view_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
if (ct->click_info && g_list_find(ct->cd->list, ct->click_info))
{
static void collection_table_popup_selectall_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_select_all(ct);
ct->prev_selection= ct->click_info;
static void collection_table_popup_unselectall_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_unselect_all(ct);
ct->prev_selection= ct->click_info;
static void collection_table_popup_select_invert_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_select_invert_all(ct);
ct->prev_selection= ct->click_info;
static void collection_table_popup_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GList *list;
if (!ct->click_info) return;
static void collection_table_popup_add_file_selection_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GList *list;
LayoutWindow *lw = NULL;
static void collection_table_popup_add_collection_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_dialog_append(NULL, ct->cd);
}
static void collection_table_popup_goto_original_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GList *list;
LayoutWindow *lw = NULL;
FileData *fd;
list = collection_table_selection_get_list(ct);
if (list)
{
- fd = list->data;
+ fd = static_cast<FileData *>(list->data);
if (fd)
{
layout_set_fd(lw, fd);
static void collection_table_popup_find_dupes_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
DupeWindow *dw;
dw = dupe_window_new();
static void collection_table_popup_print_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
FileData *fd;
fd = (ct->click_info) ? ct->click_info->fd : NULL;
static void collection_table_popup_show_names_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_toggle_filenames(ct);
}
static void collection_table_popup_show_stars_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_toggle_stars(ct);
}
static void collection_table_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_selection_remove(ct, ct->click_info, SELECTION_PRELIGHT, NULL);
ct->click_info = NULL;
G_CALLBACK(collection_table_popup_delete_cb), ct);
menu_item_add_divider(menu);
- submenu = submenu_add_sort(NULL, G_CALLBACK(collection_table_popup_sort_cb), ct, FALSE, TRUE, FALSE, 0);
+ submenu = submenu_add_sort(NULL, G_CALLBACK(collection_table_popup_sort_cb), ct, FALSE, TRUE, FALSE, SORT_NONE);
menu_item_add_divider(submenu);
menu_item_add(submenu, _("Randomize"),
G_CALLBACK(collection_table_popup_randomize_cb), ct);
static gboolean collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
gint focus_row = 0;
gint focus_col = 0;
CollectInfo *info;
gtk_tree_model_get(store, &iter, CTABLE_COLUMN_POINTER, &list, -1);
n = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_number"));
- info = g_list_nth_data(list, n);
+ info = static_cast<CollectInfo *>(g_list_nth_data(list, n));
if (info)
{
{
gint col;
- info = work->data;
+ info = static_cast<CollectInfo *>(work->data);
*after = TRUE;
if (collection_table_find_iter(ct, info, &iter, &col))
work = g_list_find(ct->cd->list, info);
if (work && work->next)
{
- info = work->next->data;
+ info = static_cast<CollectInfo *>(work->next->data);
}
else
{
GdkRectangle cell;
GdkWindow *parent;
gint x_parent, y_parent;
+ GError *error = NULL;
+ GInputStream *in_stream;
+ GdkPixbuf *pb;
+ gchar *path;
parent = gtk_widget_get_window(gtk_widget_get_toplevel(ct->listview));
gdk_window_get_position(parent, &x_parent, &y_parent);
{
GdkWindowAttr attributes;
gint attributes_mask;
- GdkPixbuf *pb = gdk_pixbuf_new_from_xpm_data((const gchar **)marker_xpm);
+
+ path = g_build_filename(GQ_RESOURCE_PATH_ICONS, "gq-marker.xpm", NULL);
+ in_stream = g_resources_open_stream(path, G_RESOURCE_LOOKUP_FLAGS_NONE, &error);
+ g_free(path);
+
+ pb = gdk_pixbuf_new_from_stream(in_stream, NULL, &error);
+ g_object_unref(in_stream);
+
+ if (error)
+ {
+ log_printf("warning: collection marker error: %s", error->message);
+ g_error_free(error);
+ return;
+ }
+
gint w = gdk_pixbuf_get_width(pb);
gint h = gdk_pixbuf_get_height(pb);
static gboolean collection_table_auto_scroll_idle_cb(gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GdkWindow *window;
gint x, y;
gint w, h;
GdkSeat *seat;
GdkDevice *device;
- if (!ct->drop_idle_id) return FALSE;
+ if (!ct->drop_idle_id) return G_SOURCE_REMOVE;
window = gtk_widget_get_window(ct->listview);
seat = gdk_display_get_default_seat(gdk_window_get_display(window));
}
ct->drop_idle_id = 0;
- return FALSE;
+ return G_SOURCE_REMOVE;
}
static gboolean collection_table_auto_scroll_notify_cb(GtkWidget *UNUSED(widget), gint UNUSED(x), gint UNUSED(y), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
if (!ct->drop_idle_id)
{
static gboolean collection_table_motion_cb(GtkWidget *UNUSED(widget), GdkEventMotion *event, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_motion_update(ct, (gint)event->x, (gint)event->y, FALSE);
static gboolean collection_table_press_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GtkTreeIter iter;
CollectInfo *info;
static gboolean collection_table_release_cb(GtkWidget *UNUSED(widget), GdkEventButton *bevent, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GtkTreeIter iter;
CollectInfo *info = NULL;
static gboolean collection_table_leave_cb(GtkWidget *UNUSED(widget), GdkEventCrossing *UNUSED(event), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
tip_unschedule(ct);
return FALSE;
gtk_tree_view_column_set_fixed_width(column, thumb_width + (THUMB_BORDER_PADDING * 6));
list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column));
- cell = (list) ? list->data : NULL;
+ cell = static_cast<GtkCellRenderer *>((list) ? list->data : NULL);
g_list_free(list);
if (cell && GQV_IS_CELL_RENDERER_ICON(cell))
CollectInfo *info;
if (work)
{
- info = work->data;
+ info = static_cast<CollectInfo *>(work->data);
work = work->next;
c++;
}
static gboolean collection_table_sync_idle_cb(gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
- if (!ct->sync_idle_id) return FALSE;
+ if (!ct->sync_idle_id) return G_SOURCE_REMOVE;
g_source_remove(ct->sync_idle_id);
ct->sync_idle_id = 0;
collection_table_sync(ct);
- return FALSE;
+ return G_SOURCE_REMOVE;
}
static void collection_table_sync_idle(CollectTable *ct)
GList *work = list;
while (work)
{
- FileData *fd = work->data;
+ FileData *fd = static_cast<FileData *>(work->data);
work = work->next;
if (isdir(fd->path)) collection_table_add_dir_recursive(ct, fd, recursive);
}
static void confirm_dir_list_add(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
confirm_dir_list_do(ct, ct->drop_list, FALSE);
}
static void confirm_dir_list_recurse(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
confirm_dir_list_do(ct, ct->drop_list, TRUE);
}
static void confirm_dir_list_skip(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_insert_filelist(ct, ct->drop_list, ct->marker_info);
}
*/
static GtkTargetEntry collection_drag_types[] = {
- { TARGET_APP_COLLECTION_MEMBER_STRING, 0, TARGET_APP_COLLECTION_MEMBER },
- { "text/uri-list", 0, TARGET_URI_LIST },
- { "text/plain", 0, TARGET_TEXT_PLAIN }
+ { const_cast<gchar *>(TARGET_APP_COLLECTION_MEMBER_STRING), 0, TARGET_APP_COLLECTION_MEMBER },
+ { const_cast<gchar *>("text/uri-list"), 0, TARGET_URI_LIST },
+ { const_cast<gchar *>("text/plain"), 0, TARGET_TEXT_PLAIN }
};
static gint n_collection_drag_types = 3;
static GtkTargetEntry collection_drop_types[] = {
- { TARGET_APP_COLLECTION_MEMBER_STRING, 0, TARGET_APP_COLLECTION_MEMBER },
- { "text/uri-list", 0, TARGET_URI_LIST }
+ { const_cast<gchar *>(TARGET_APP_COLLECTION_MEMBER_STRING), 0, TARGET_APP_COLLECTION_MEMBER },
+ { const_cast<gchar *>("text/uri-list"), 0, TARGET_URI_LIST }
};
static gint n_collection_drop_types = 2;
GtkSelectionData *selection_data, guint info,
guint UNUSED(time), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
gboolean selected;
GList *list = NULL;
gchar *uri_text = NULL;
GtkSelectionData *selection_data, guint info,
guint UNUSED(time), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
GList *list = NULL;
GList *info_list = NULL;
CollectionData *source;
work = list;
while (work)
{
- FileData *fd = work->data;
+ FileData *fd = static_cast<FileData *>(work->data);
if (isdir(fd->path))
{
GtkWidget *menu;
static void collection_table_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
if (ct->click_info && ct->click_info->pixbuf)
{
static void collection_table_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
/* apparently a leave event is not generated on a drop */
tip_unschedule(ct);
static gint collection_table_dnd_motion(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context),
gint x, gint y, guint UNUSED(time), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_motion_update(ct, x, y, TRUE);
collection_table_scroll(ct, TRUE);
static void collection_table_dnd_leave(GtkWidget *UNUSED(widget), GdkDragContext *UNUSED(context), guint UNUSED(time), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_scroll(ct, FALSE);
}
static void collection_table_dnd_init(CollectTable *ct)
{
- gtk_drag_source_set(ct->listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(ct->listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
collection_drag_types, n_collection_drag_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(ct->listview), "drag_data_get",
G_CALLBACK(collection_table_dnd_get), ct);
g_signal_connect(G_OBJECT(ct->listview), "drag_begin",
G_CALLBACK(collection_table_dnd_end), ct);
gtk_drag_dest_set(ct->listview,
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
+ static_cast<GtkDestDefaults>(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP),
collection_drop_types, n_collection_drop_types,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK));
g_signal_connect(G_OBJECT(ct->listview), "drag_motion",
G_CALLBACK(collection_table_dnd_motion), ct);
g_signal_connect(G_OBJECT(ct->listview), "drag_leave",
static void collection_table_cell_data_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
{
- ColumnData *cd = data;
+ ColumnData *cd = static_cast<ColumnData *>(data);
CollectTable *ct;
GtkStyle *style;
GList *list;
*/
if (cd->number == COLLECT_TABLE_MAX_COLUMNS) return;
- info = g_list_nth_data(list, cd->number);
+ info = static_cast<CollectInfo *>(g_list_nth_data(list, cd->number));
style = gtk_widget_get_style(ct->listview);
if (info && (info->flag_mask & SELECTION_SELECTED) )
static void collection_table_destroy(GtkWidget *UNUSED(widget), gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
/* If there is no unsaved data, save the window geometry
*/
static void collection_table_sized(GtkWidget *UNUSED(widget), GtkAllocation *allocation, gpointer data)
{
- CollectTable *ct = data;
+ CollectTable *ct = static_cast<CollectTable *>(data);
collection_table_populate_at_new_size(ct, allocation->width, allocation->height, FALSE);
}
collection_table_dnd_init(ct);
gtk_widget_set_events(ct->listview, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK);
+ static_cast<GdkEventMask>(GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK));
g_signal_connect(G_OBJECT(ct->listview),"button_press_event",
G_CALLBACK(collection_table_press_cb), ct);
g_signal_connect(G_OBJECT(ct->listview),"button_release_event",