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);
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;
}
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;
}
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);
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);
{
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))
{
}
else
{
- hints = 0;
+ hints = static_cast<GdkWindowHints>(0);
}
geometry.min_width = DEFAULT_MINIMAL_WINDOW_SIZE;
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);
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;
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);
/* 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);
}
}
}
#endif
- return FALSE;
+ return G_SOURCE_REMOVE;
}
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);
}
else
{
- hint_mask = 0;
+ hint_mask = static_cast<GdkWindowHints>(0);
}
hint.min_width = 32;
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))
{
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;
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());
}