GList *work;
if (!id || !id[0]) return NULL;
-
+
if (strcmp(id, LAYOUT_ID_CURRENT) == 0)
{
if (current_lw) return current_lw;
char id[10];
gint i;
if (lw->options.id && lw->options.id[0]) return; /* id is already set */
-
+
g_free(lw->options.id);
lw->options.id = NULL;
-
+
if (!layout_find_by_layout_id("main"))
{
lw->options.id = g_strdup("main");
return;
}
-
+
i = 1;
while (TRUE)
{
buf = g_strdup(path);
parse_out_relatives(buf);
-
+
if (isdir(buf))
{
if ((!lw->dir_fd || strcmp(lw->dir_fd->path, buf) != 0) && layout_set_path(lw, buf))
}
g_free(base);
}
-
+
g_free(buf);
}
{
guint n;
gint64 n_bytes = 0;
-
+
n = layout_list_count(lw, &n_bytes);
-
+
if (n)
{
guint s;
{
ss = "";
}
-
+
s = layout_selection_count(lw, &s_bytes);
-
+
layout_bars_new_selection(lw, s);
-
+
if (s > 0)
{
gchar *b = text_from_size_abrev(n_bytes);
{
buf = g_strdup_printf(_("%d files%s"), n, ss);
}
-
+
text = buf;
-
+
image_osd_update(lw->image);
}
else
text = "";
}
}
-
+
if (lw->info_status) gtk_label_set_text(GTK_LABEL(lw->info_status), text);
g_free(buf);
}
void layout_status_update_image(LayoutWindow *lw)
{
guint64 n;
-
+
if (!layout_valid(&lw) || !lw->image) return;
if (!lw->info_zoom || !lw->info_details) return; /*called from layout_style_set */
n = layout_list_count(lw, NULL);
-
+
if (!n)
{
gtk_label_set_text(GTK_LABEL(lw->info_zoom), "");
else
{
gint width, height;
-
+
image_get_image_size(lw->image, &width, &height);
text = g_strdup_printf(_("( %d x %d ) %s bytes"),
width, height, b);
}
g_signal_emit_by_name (lw->image->pr, "update-pixel");
-
+
g_free(b);
-
+
gtk_label_set_text(GTK_LABEL(lw->info_details), text);
g_free(text);
}
}
lw->info_details = layout_status_label(NULL, hbox, TRUE, 0, TRUE);
toolbar = layout_actions_toolbar(lw, TOOLBAR_STATUS);
-
+
toolbar_frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(toolbar_frame), GTK_SHADOW_IN);
gtk_container_add(GTK_CONTAINER(toolbar_frame), toolbar);
vf_set_thumb_status_func(lw->vf, layout_list_thumb_cb, lw);
vf_marks_set(lw->vf, lw->options.show_marks);
-
+
layout_list_sync_thumb(lw);
return lw->vf->widget;
gboolean ret;
if (!path) return FALSE;
-
+
fd = file_data_new_group(path);
ret = layout_set_fd(lw, fd);
file_data_unref(fd);
if (lw->path_entry) tab_completion_append_to_history(lw->path_entry, lw->dir_fd->path);
layout_sync_path(lw);
layout_list_sync_sort(lw);
-
+
if (have_file)
{
gint row;
{
GdkWindow *window;
if (!layout_valid(&lw)) return FALSE;
-
+
window = gtk_widget_get_window(lw->window);
gdk_window_get_root_origin(window, x, y);
*w = gdk_window_get_width(window);
{
GtkAllocation h_allocation;
GtkAllocation v_allocation;
-
+
if (!layout_valid(&lw)) return FALSE;
-
+
if (lw->h_pane)
{
GtkWidget *child = gtk_paned_get_child1(GTK_PANED(lw->h_pane));
image = layout_image_setup_split(lw, lw->split_mode);
image_sb = layout_bars_prepare(lw, image);
}
-
+
tools = layout_tools_new(lw);
files = layout_list_new(lw);
gint i;
LayoutWindow *lw = work->data;
work = work->next;
-
+
if (!lw->image) continue;
for (i = 0; i < MAX_SPLIT_IMAGES; i++)
if (!lw->split_images[i]) continue;
image_background_set_color_from_options(lw->split_images[i], !!lw->full_screen);
}
-
+
image_background_set_color_from_options(lw->image, !!lw->full_screen);
}
}
void layout_info_pixel_set(LayoutWindow *lw, gboolean show)
{
GtkWidget *frame;
-
+
if (!layout_valid(&lw)) return;
if (!lw->info_pixel) return;
{
gtk_widget_show(frame);
}
-
+
g_signal_emit_by_name (lw->image->pr, "update-pixel");
}
GtkWidget *configwindow;
GtkWidget *home_path_entry;
GtkWidget *layout_widget;
-
+
LayoutOptions options;
};
static void layout_config_close_cb(GtkWidget *widget, gpointer data)
{
LayoutConfig *lc = data;
-
+
gtk_widget_destroy(lc->configwindow);
free_layout_options_content(&lc->options);
g_free(lc);
static void layout_config_apply_cb(GtkWidget *widget, gpointer data)
{
LayoutConfig *lc = data;
-
+
g_free(lc->options.order);
lc->options.order = layout_config_get(lc->layout_widget, &lc->options.style);
}
frame = pref_frame_new(win_vbox, TRUE, NULL, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
-
+
vbox = gtk_vbox_new(FALSE, PREF_PAD_SPACE);
gtk_container_add(GTK_CONTAINER(frame), vbox);
gtk_widget_show(vbox);
lw->options.image_overlay.state = image_osd_get(lw->image);
histogram = image_osd_get_histogram(lw->image);
-
+
lw->options.image_overlay.histogram_channel = histogram->histogram_channel;
lw->options.image_overlay.histogram_mode = histogram->histogram_mode;
if (current_lw == lw) current_lw = NULL;
if (lw->exif_window) g_signal_handlers_disconnect_matched(G_OBJECT(lw->exif_window), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, lw);
-
+
layout_bars_close(lw);
g_object_unref(lw->menu_bar);
if (lw->toolbar[i]) g_object_unref(lw->toolbar[i]);
string_list_free(lw->toolbar_actions[i]);
}
-
+
gtk_widget_destroy(lw->window);
-
+
if (lw->split_image_sizegroup) g_object_unref(lw->split_image_sizegroup);
file_data_unregister_notify_func(layout_image_notify_cb, lw);
GdkPixbuf *pixbuf;
pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO);
-
+
/* FIXME: the zoom value set here is the value, which is then copied again and again
in "Leave Zoom at previous setting" mode. This is not ideal. */
image_change_pixbuf(lw->image, pixbuf, 0.0, FALSE);
image_osd_set(lw->image, lw->options.image_overlay.state);
histogram = image_osd_get_histogram(lw->image);
-
+
histogram->histogram_channel = lw->options.image_overlay.histogram_channel;
histogram->histogram_mode = lw->options.image_overlay.histogram_mode;
bar_sort_write_config(lw->bar_sort, outstr, indent + 1);
bar_write_config(lw->bar, outstr, indent + 1);
-
+
layout_toolbar_write_config(lw, TOOLBAR_MAIN, outstr, indent + 1);
layout_toolbar_write_config(lw, TOOLBAR_STATUS, outstr, indent + 1);
void layout_load_attributes(LayoutOptions *layout, const gchar **attribute_names, const gchar **attribute_values)
{
gchar *id = NULL;
-
+
while (*attribute_names)
{
const gchar *option = *attribute_names++;
if (READ_INT(*layout, style)) continue;
if (READ_CHAR(*layout, order)) continue;
-
+
if (READ_UINT(*layout, dir_view_type)) continue;
if (READ_UINT(*layout, file_view_type)) continue;
if (READ_BOOL(*layout, show_marks)) continue;
if (READ_INT(*layout, float_window.w)) continue;
if (READ_INT(*layout, float_window.h)) continue;
if (READ_INT(*layout, float_window.vdivider_pos)) continue;
-
+
if (READ_INT(*layout, properties_window.w)) continue;
if (READ_INT(*layout, properties_window.h)) continue;
*path = g_strdup(command_line->path);
}
else layout_config_startup_path(lop, path);
-
+
if (command_line->tools_show)
{
lop->tools_float = FALSE;
LayoutOptions lop;
LayoutWindow *lw;
gchar *path = NULL;
-
+
init_layout_options(&lop);
if (attribute_names) layout_load_attributes(&lop, attribute_names, attribute_values);
-
+
if (use_commandline)
{
layout_config_commandline(&lop, &path);
void layout_update_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values)
{
LayoutOptions lop;
-
+
init_layout_options(&lop);
if (attribute_names) layout_load_attributes(&lop, attribute_names, attribute_values);
layout_apply_options(lw, &lop);
-
+
free_layout_options_content(&lop);
}