Documentation: Use G_SOURCE_CONTINUE and G_SOURCE_REMOVE
[geeqie.git] / src / layout.cc
index bfe4e5a..034dcdf 100644 (file)
@@ -82,7 +82,7 @@ gboolean layout_valid(LayoutWindow **lw)
        if (*lw == NULL)
                {
                if (current_lw) *lw = current_lw;
-               else if (layout_window_list) *lw = layout_window_list->data;
+               else if (layout_window_list) *lw = static_cast<LayoutWindow *>(layout_window_list->data);
                return (*lw != NULL);
                }
        return (g_list_find(layout_window_list, *lw) != NULL);
@@ -130,7 +130,7 @@ LayoutWindow *layout_find_by_layout_id(const gchar *id)
        if (strcmp(id, LAYOUT_ID_CURRENT) == 0)
                {
                if (current_lw) return current_lw;
-               if (layout_window_list) return layout_window_list->data;
+               if (layout_window_list) return static_cast<LayoutWindow *>(layout_window_list->data);
                return NULL;
                }
 
@@ -202,7 +202,7 @@ static void layout_box_folders_changed_cb(GtkWidget *widget, gpointer UNUSED(dat
        work = layout_window_list;
        while (work)
                {
-               lw = work->data;
+               lw = static_cast<LayoutWindow *>(work->data);
                lw->options.folder_window.vdivider_pos = gtk_paned_get_position(GTK_PANED(widget));
                work = work->next;
                }
@@ -306,7 +306,7 @@ static gboolean path_entry_tooltip_cb(GtkWidget *widget, gpointer UNUSED(data))
        gchar *current_path;
 
        box_child_list = gtk_container_get_children(GTK_CONTAINER(widget));
-       path_entry = box_child_list->data;
+       path_entry = static_cast<GtkComboBox *>(box_child_list->data);
        current_path = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(path_entry));
        gtk_widget_set_tooltip_text(GTK_WIDGET(widget), current_path);
 
@@ -408,7 +408,7 @@ static void layout_sort_menu_cb(GtkWidget *widget, gpointer data)
 
        if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) return;
 
-       lw = submenu_item_get_data(widget);
+       lw = static_cast<LayoutWindow *>(submenu_item_get_data(widget));
        if (!lw) return;
 
        type = (SortType)GPOINTER_TO_INT(data);
@@ -1462,8 +1462,8 @@ static void layout_location_compute(LayoutLocation l1, LayoutLocation l2,
 {
        LayoutLocation l;
 
-       l = l1 & l2;    /* get common compass direction */
-       l = l1 - l;     /* remove it */
+       l = static_cast<LayoutLocation>(l1 & l2);       /* get common compass direction */
+       l = static_cast<LayoutLocation>(l1 - l);        /* remove it */
 
        if (layout_location_first(l))
                {
@@ -1605,7 +1605,7 @@ static void layout_tools_setup(LayoutWindow *lw, GtkWidget *tools, GtkWidget *fi
                        }
                else
                        {
-                       hints = 0;
+                       hints = static_cast<GdkWindowHints>(0);
                        }
 
                geometry.min_width = DEFAULT_MINIMAL_WINDOW_SIZE;
@@ -1613,7 +1613,7 @@ static void layout_tools_setup(LayoutWindow *lw, GtkWidget *tools, GtkWidget *fi
                geometry.base_width = TOOLWINDOW_DEF_WIDTH;
                geometry.base_height = TOOLWINDOW_DEF_HEIGHT;
                gtk_window_set_geometry_hints(GTK_WINDOW(lw->tools), NULL, &geometry,
-                                             GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints);
+                                             static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints));
 
 
                gtk_window_set_resizable(GTK_WINDOW(lw->tools), TRUE);
@@ -1848,7 +1848,7 @@ static void layout_grid_setup(LayoutWindow *lw)
        h = lw->h_pane = gtk_hpaned_new();
        DEBUG_NAME(h);
 
-       if (!layout_location_vertical(priority_location))
+       if (!layout_location_vertical(static_cast<LayoutLocation>(priority_location)))
                {
                GtkWidget *tmp;
 
@@ -1859,7 +1859,7 @@ static void layout_grid_setup(LayoutWindow *lw)
 
        gtk_box_pack_start(GTK_BOX(lw->group_box), v, TRUE, TRUE, 0);
 
-       if (!layout_location_first(priority_location))
+       if (!layout_location_first(static_cast<LayoutLocation>(priority_location)))
                {
                gtk_paned_pack1(GTK_PANED(v), h, FALSE, TRUE);
                gtk_paned_pack2(GTK_PANED(v), w3, TRUE, TRUE);
@@ -1886,8 +1886,8 @@ static void layout_grid_setup(LayoutWindow *lw)
        /* fix to have image pane visible when it is left and priority widget */
        if (lw->options.main_window.hdivider_pos == -1 &&
            w1 == image_sb &&
-           !layout_location_vertical(priority_location) &&
-           layout_location_first(priority_location))
+           !layout_location_vertical(static_cast<LayoutLocation>(priority_location)) &&
+           layout_location_first(static_cast<LayoutLocation>(priority_location)))
                {
                gtk_widget_set_size_request(image_sb, 200, -1);
                }
@@ -2549,7 +2549,7 @@ static gboolean move_window_to_workspace_cb(gpointer data)
                        }
                }
 #endif
-       return FALSE;
+       return G_SOURCE_REMOVE;
 }
 
 LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
@@ -2582,9 +2582,8 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
 
        layout_config_parse(lw->options.style, lw->options.order,
                            &lw->dir_location,  &lw->file_location, &lw->image_location);
-       if (lw->options.dir_view_type > DIRVIEW_LAST) lw->options.dir_view_type = 0;
-       if (lw->options.file_view_type > FILEVIEW_LAST) lw->options.file_view_type = 0;
-
+       if (lw->options.dir_view_type > DIRVIEW_LAST) lw->options.dir_view_type = DIRVIEW_LIST;
+       if (lw->options.file_view_type > FILEVIEW_LAST) lw->options.file_view_type = FILEVIEW_LIST;
        /* divider positions */
 
        default_path = g_build_filename(get_rc_dir(), DEFAULT_WINDOW_LAYOUT, NULL);
@@ -2614,7 +2613,7 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
                }
        else
                {
-               hint_mask = 0;
+               hint_mask = static_cast<GdkWindowHints>(0);
                }
 
        hint.min_width = 32;
@@ -2622,7 +2621,7 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
        hint.base_width = 0;
        hint.base_height = 0;
        gtk_window_set_geometry_hints(GTK_WINDOW(lw->window), NULL, &hint,
-                                     GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hint_mask);
+                                     static_cast<GdkWindowHints>(GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hint_mask));
 
        if (options->save_window_positions || isfile(default_path))
                {
@@ -2687,7 +2686,7 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
        gtk_widget_show(lw->window);
        layout_tools_hide(lw, lw->options.tools_hidden);
 
-       image_osd_set(lw->image, lw->options.image_overlay.state);
+       image_osd_set(lw->image, static_cast<OsdShowFlags>(lw->options.image_overlay.state));
        histogram = image_osd_get_histogram(lw->image);
 
        histogram->histogram_channel = lw->options.image_overlay.histogram_channel;
@@ -3041,7 +3040,7 @@ LayoutWindow *layout_new_from_default()
        if (success)
                {
                work = g_list_last(layout_window_list);
-               lw = work->data;
+               lw = static_cast<LayoutWindow *>(work->data);
                g_free(lw->options.id);
                lw->options.id = g_strdup(layout_get_unique_id());
                }