Documentation: Use G_SOURCE_CONTINUE and G_SOURCE_REMOVE
[geeqie.git] / src / collect-table.cc
index 2307e6d..81f65c2 100644 (file)
@@ -77,25 +77,25 @@ hard_coded_window_keys collection_window_keys[] = {
        {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, '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}
 };
 
 /*
@@ -148,7 +148,7 @@ static CollectInfo *collection_table_find_data(CollectTable *ct, gint row, gint
 
                if (iter) *iter = p;
 
-               return g_list_nth_data(list, col);
+               return static_cast<CollectInfo *>(g_list_nth_data(list, col));
                }
 
        return NULL;
@@ -176,7 +176,7 @@ static CollectInfo *collection_table_find_data_by_coord(CollectTable *ct, gint x
 
        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)
@@ -189,7 +189,7 @@ 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;
                        }
@@ -210,7 +210,7 @@ static guint collection_table_selection_count(CollectTable *ct, gint64 *bytes)
                work = ct->selection;
                while (work)
                        {
-                       CollectInfo *ci = work->data;
+                       CollectInfo *ci = static_cast<CollectInfo *>(work->data);
                        work = work->next;
                        b += ci->fd->size;
                        }
@@ -259,7 +259,7 @@ static void collection_table_update_status(CollectTable *ct)
 
 static void collection_table_update_extras(CollectTable *ct, gboolean loading, gdouble value)
 {
-       gchar *text;
+       const gchar *text;
 
        if (!ct->extra_label) return;
 
@@ -343,14 +343,14 @@ static void collection_table_selection_add(CollectTable *ct, CollectInfo *info,
 {
        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);
 }
 /*
  *-------------------------------------------------------------------
@@ -365,7 +365,7 @@ static void collection_table_verify_selections(CollectTable *ct)
        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))
                        {
@@ -385,7 +385,7 @@ void collection_table_select_all(CollectTable *ct)
        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;
                }
 
@@ -399,7 +399,7 @@ void collection_table_unselect_all(CollectTable *ct)
        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;
                }
 
@@ -418,7 +418,7 @@ static void collection_table_select_invert_all(CollectTable *ct)
        work = ct->cd->list;
        while (work)
                {
-               CollectInfo *info = work->data;
+               CollectInfo *info = static_cast<CollectInfo *>(work->data);
 
                if (INFO_SELECTED(info))
                        {
@@ -503,7 +503,7 @@ static void collection_table_select_region_util(CollectTable *ct, CollectInfo *s
                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)
@@ -601,7 +601,7 @@ static void tip_hide(CollectTable *ct)
 
 static gboolean tip_schedule_cb(gpointer data)
 {
-       CollectTable *ct = data;
+       CollectTable *ct = static_cast<CollectTable *>(data);
 
        if (!ct->tip_delay_id) return FALSE;
 
@@ -661,7 +661,7 @@ static void tip_update(CollectTable *ct, CollectInfo *info)
                                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);
                        }
                }
@@ -675,14 +675,14 @@ static void tip_update(CollectTable *ct, CollectInfo *info)
 
 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)
                {
@@ -711,9 +711,9 @@ static GList *collection_table_popup_file_list(CollectTable *ct)
 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;
 
@@ -722,28 +722,28 @@ static void collection_table_popup_edit_cb(GtkWidget *widget, gpointer data)
 
 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);
@@ -751,7 +751,7 @@ static void collection_table_popup_delete_cb(GtkWidget *UNUSED(widget), gpointer
 
 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);
@@ -759,14 +759,14 @@ static void collection_table_popup_move_to_trash_cb(GtkWidget *UNUSED(widget), g
 
 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);
 }
@@ -776,7 +776,7 @@ static void collection_table_popup_sort_cb(GtkWidget *widget, gpointer data)
        CollectTable *ct;
        SortType type;
 
-       ct = submenu_item_get_data(widget);
+       ct = static_cast<CollectTable *>(submenu_item_get_data(widget));
 
        if (!ct) return;
 
@@ -789,7 +789,7 @@ static void collection_table_popup_randomize_cb(GtkWidget *widget, gpointer UNUS
 {
        CollectTable *ct;
 
-       ct = submenu_item_get_data(widget);
+       ct = static_cast<CollectTable *>(submenu_item_get_data(widget));
 
        if (!ct) return;
 
@@ -798,7 +798,7 @@ static void collection_table_popup_randomize_cb(GtkWidget *widget, gpointer UNUS
 
 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))
                {
@@ -808,7 +808,7 @@ static void collection_table_popup_view_new_cb(GtkWidget *UNUSED(widget), gpoint
 
 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))
                {
@@ -818,7 +818,7 @@ static void collection_table_popup_view_cb(GtkWidget *UNUSED(widget), gpointer d
 
 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;
@@ -826,7 +826,7 @@ static void collection_table_popup_selectall_cb(GtkWidget *UNUSED(widget), gpoin
 
 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;
@@ -834,7 +834,7 @@ static void collection_table_popup_unselectall_cb(GtkWidget *UNUSED(widget), gpo
 
 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;
@@ -847,7 +847,7 @@ static void collection_table_popup_rectangular_selection_cb(GtkWidget *UNUSED(wi
 
 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;
@@ -867,7 +867,7 @@ static void collection_table_popup_remove_cb(GtkWidget *UNUSED(widget), gpointer
 
 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;
 
@@ -884,14 +884,14 @@ static void collection_table_popup_add_file_selection_cb(GtkWidget *UNUSED(widge
 
 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;
@@ -900,7 +900,7 @@ static void collection_table_popup_goto_original_cb(GtkWidget *UNUSED(widget), g
        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);
@@ -911,7 +911,7 @@ static void collection_table_popup_goto_original_cb(GtkWidget *UNUSED(widget), g
 
 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();
@@ -920,7 +920,7 @@ static void collection_table_popup_find_dupes_cb(GtkWidget *UNUSED(widget), gpoi
 
 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;
@@ -930,21 +930,21 @@ static void collection_table_popup_print_cb(GtkWidget *UNUSED(widget), gpointer
 
 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;
@@ -1034,7 +1034,7 @@ static GtkWidget *collection_table_popup_menu(CollectTable *ct, gboolean over_ic
                                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);
@@ -1241,7 +1241,7 @@ static gint page_height(CollectTable *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;
@@ -1408,7 +1408,7 @@ static CollectInfo *collection_table_insert_find(CollectTable *ct, CollectInfo *
                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)
                        {
@@ -1428,7 +1428,7 @@ static CollectInfo *collection_table_insert_find(CollectTable *ct, CollectInfo *
                        {
                        gint col;
 
-                       info = work->data;
+                       info = static_cast<CollectInfo *>(work->data);
                        *after = TRUE;
 
                        if (collection_table_find_iter(ct, info, &iter, &col))
@@ -1459,7 +1459,7 @@ static CollectInfo *collection_table_insert_point(CollectTable *ct, gint x, gint
                work = g_list_find(ct->cd->list, info);
                if (work && work->next)
                        {
-                       info = work->next->data;
+                       info = static_cast<CollectInfo *>(work->next->data);
                        }
                else
                        {
@@ -1604,14 +1604,14 @@ static void collection_table_motion_update(CollectTable *ct, gint x, gint y, gbo
 
 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));
@@ -1626,12 +1626,12 @@ static gboolean collection_table_auto_scroll_idle_cb(gpointer data)
                }
 
        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)
                {
@@ -1669,7 +1669,7 @@ static void collection_table_scroll(CollectTable *ct, gboolean scroll)
 
 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);
 
@@ -1678,7 +1678,7 @@ static gboolean collection_table_motion_cb(GtkWidget *UNUSED(widget), GdkEventMo
 
 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;
 
@@ -1717,7 +1717,7 @@ static gboolean collection_table_press_cb(GtkWidget *UNUSED(widget), GdkEventBut
 
 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;
 
@@ -1777,7 +1777,7 @@ static gboolean collection_table_release_cb(GtkWidget *UNUSED(widget), GdkEventB
 
 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;
@@ -1851,7 +1851,7 @@ static void collection_table_populate(CollectTable *ct, gboolean resize)
                        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))
@@ -1940,7 +1940,7 @@ static void collection_table_sync(CollectTable *ct)
                        CollectInfo *info;
                        if (work)
                                {
-                               info = work->data;
+                               info = static_cast<CollectInfo *>(work->data);
                                work = work->next;
                                c++;
                                }
@@ -1974,14 +1974,14 @@ static void collection_table_sync(CollectTable *ct)
 
 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)
@@ -2190,7 +2190,7 @@ static void confirm_dir_list_do(CollectTable *ct, GList *list, gboolean recursiv
        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);
                }
@@ -2200,21 +2200,21 @@ static void confirm_dir_list_do(CollectTable *ct, GList *list, gboolean recursiv
 
 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);
 }
@@ -2248,15 +2248,15 @@ static GtkWidget *collection_table_drop_menu(CollectTable *ct)
  */
 
 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;
 
@@ -2265,7 +2265,7 @@ static void collection_table_dnd_get(GtkWidget *UNUSED(widget), GdkDragContext *
                                     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;
@@ -2317,7 +2317,7 @@ static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragConte
                                          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;
@@ -2371,7 +2371,7 @@ static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragConte
                        work = list;
                        while (work)
                                {
-                               FileData *fd = work->data;
+                               FileData *fd = static_cast<FileData *>(work->data);
                                if (isdir(fd->path))
                                        {
                                        GtkWidget *menu;
@@ -2399,7 +2399,7 @@ static void collection_table_dnd_receive(GtkWidget *UNUSED(widget), GdkDragConte
 
 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)
                {
@@ -2415,7 +2415,7 @@ static void collection_table_dnd_begin(GtkWidget *widget, GdkDragContext *contex
 
 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);
@@ -2426,7 +2426,7 @@ static void collection_table_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *
 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);
@@ -2436,16 +2436,16 @@ static gint collection_table_dnd_motion(GtkWidget *UNUSED(widget), GdkDragContex
 
 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",
@@ -2454,9 +2454,9 @@ static void collection_table_dnd_init(CollectTable *ct)
                         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",
@@ -2481,7 +2481,7 @@ struct _ColumnData
 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;
@@ -2502,7 +2502,7 @@ static void collection_table_cell_data_cb(GtkTreeViewColumn *UNUSED(tree_column)
         */
        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) )
@@ -2616,7 +2616,7 @@ static void collection_table_append_column(CollectTable *ct, gint n)
 
 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
         */
@@ -2645,7 +2645,7 @@ static void collection_table_destroy(GtkWidget *UNUSED(widget), gpointer data)
 
 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);
 }
@@ -2701,7 +2701,7 @@ CollectTable *collection_table_new(CollectionData *cd)
        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",