/*
* Geeqie
* (C) 2006 John Ellis
- * Copyright (C) 2008 - 2010 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Author: John Ellis
*
LayoutWindow *lw = data;
/* restore image window */
- lw->image = fs->normal_imd;
+ if (lw->image == fs->imd)
+ lw->image = fs->normal_imd;
lw->full_screen = NULL;
}
layout_image_full_screen_stop_func, lw);
/* set to new image window */
- lw->image = lw->full_screen->imd;
+ if (lw->full_screen->same_region)
+ lw->image = lw->full_screen->imd;
layout_image_set_buttons(lw);
G_CALLBACK(layout_key_press_cb), lw);
layout_actions_add_window(lw, lw->full_screen->window);
-#if 0
- gtk_widget_set_sensitive(lw->window, FALSE);
- if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
-#endif
image_osd_copy_status(lw->full_screen->normal_imd, lw->image);
}
if (!layout_valid(&lw)) return;
if (!lw->full_screen) return;
- image_osd_copy_status(lw->image, lw->full_screen->normal_imd);
+ if (lw->image == lw->full_screen->imd)
+ image_osd_copy_status(lw->image, lw->full_screen->normal_imd);
fullscreen_stop(lw->full_screen);
-
-#if 0
- gtk_widget_set_sensitive(lw->window, TRUE);
- if (lw->tools) gtk_widget_set_sensitive(lw->tools, TRUE);
-#endif
}
void layout_image_full_screen_toggle(LayoutWindow *lw)
{
LayoutWindow *lw = data;
- gdk_window_get_origin(lw->image->pr->window, x, y);
+ gdk_window_get_origin(gtk_widget_get_window(lw->image->pr), x, y);
popup_menu_position_clamp(menu, x, y, 0);
}
if (info == TARGET_URI_LIST)
{
- list = uri_filelist_from_text((gchar *)selection_data->data, TRUE);
+ list = uri_filelist_from_gtk_selection_data(selection_data);
source = NULL;
info_list = NULL;
}
else
{
- source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list);
+ source = collection_from_dnd_data((gchar *)gtk_selection_data_get_data(selection_data), &list, &info_list);
}
if (list)
FileData *dir_fd;
base = remove_level_from_path(fd->path);
- dir_fd = file_data_new_simple(base);
+ dir_fd = file_data_new_dir(base);
if (dir_fd != lw->dir_fd)
{
layout_set_fd(lw, dir_fd);
if (fd)
{
- gchar *text = NULL;
- gint len;
- gboolean plain_text;
GList *list;
- switch (info)
- {
- case TARGET_URI_LIST:
- plain_text = FALSE;
- break;
- case TARGET_TEXT_PLAIN:
- default:
- plain_text = TRUE;
- break;
- }
list = g_list_append(NULL, fd);
- text = uri_text_from_filelist(list, &len, plain_text);
+ uri_selection_data_set_uris_from_filelist(selection_data, list);
g_list_free(list);
- if (text)
- {
- gtk_selection_data_set(selection_data, selection_data->target,
- 8, (guchar *)text, len);
- g_free(text);
- }
}
else
{
- gtk_selection_data_set(selection_data, selection_data->target,
+ gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data),
8, NULL, 0);
}
}
static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data)
{
LayoutWindow *lw = data;
- if (context->action == GDK_ACTION_MOVE)
+ if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
FileData *fd;
gint row;
image_scroll(lw->image, x, y);
+ if (lw->full_screen && lw->image != lw->full_screen->imd)
+ {
+ image_scroll(lw->full_screen->imd, x, y);
+ }
+
if (!connect_scroll) return;
image_get_image_size(lw->image, &width, &height);
image_zoom_adjust(lw->image, increment);
+ if (lw->full_screen && lw->image != lw->full_screen->imd)
+ {
+ image_zoom_adjust(lw->full_screen->imd, increment);
+ }
+
if (!connect_zoom) return;
for (i = 0; i < MAX_SPLIT_IMAGES; i++)
image_zoom_adjust_at_point(lw->image, increment, x, y);
+ if (lw->full_screen && lw->image != lw->full_screen->imd)
+ {
+ image_zoom_adjust_at_point(lw->full_screen->imd, increment, x, y);
+ }
+
if (!connect_zoom) return;
for (i = 0; i < MAX_SPLIT_IMAGES; i++)
image_zoom_set(lw->image, zoom);
+ if (lw->full_screen && lw->image != lw->full_screen->imd)
+ {
+ image_zoom_set(lw->full_screen->imd, zoom);
+ }
+
if (!connect_zoom) return;
for (i = 0; i < MAX_SPLIT_IMAGES; i++)
image_zoom_set_fill_geometry(lw->image, vertical);
+ if (lw->full_screen && lw->image != lw->full_screen->imd)
+ {
+ image_zoom_set_fill_geometry(lw->full_screen->imd, vertical);
+ }
+
if (!connect_zoom) return;
for (i = 0; i < MAX_SPLIT_IMAGES; i++)
image_stereo_set(lw->image, stereo_mode);
}
-*/
void layout_image_stereo_swap(LayoutWindow *lw)
{
if (!layout_valid(&lw)) return;
image_stereo_swap(lw->image);
}
+*/
gint layout_image_stereo_pixbuf_get(LayoutWindow *lw)
{
image_change_fd(lw->image, fd, image_zoom_get_default(lw->image));
+ if (lw->full_screen && lw->image != lw->full_screen->imd)
+ {
+ image_change_fd(lw->full_screen->imd, fd, image_zoom_get_default(lw->full_screen->imd));
+ }
+
+
layout_list_sync_fd(lw, fd);
layout_image_slideshow_continue_check(lw);
layout_bars_new_image(lw);
{
gint i;
LayoutWindow *lw = data;
+ gdouble sx, sy;
+
+ if (lw->full_screen && lw->image != lw->full_screen->imd &&
+ imd != lw->full_screen->imd)
+ {
+ if (event->state & GDK_CONTROL_MASK)
+ {
+ image_get_scroll_center(imd, &sx, &sy);
+ }
+ else
+ {
+ image_get_scroll_center(lw->full_screen->imd, &sx, &sy);
+ sx += dx;
+ sy += dy;
+ }
+ image_set_scroll_center(lw->full_screen->imd, sx, sy);
+ }
if (!(event->state & GDK_SHIFT_MASK)) return;
{
if (lw->split_images[i] && lw->split_images[i] != imd)
{
- gdouble sx, sy;
if (event->state & GDK_CONTROL_MASK)
{
gint r_mouse, g_mouse, b_mouse;
pixbuf_renderer_get_pixel_colors(pr, x_pixel, y_pixel,
- &r_mouse, &g_mouse, &b_mouse);
+ &r_mouse, &g_mouse, &b_mouse);
text = g_strdup_printf(_("[%*d,%*d]: RGB(%3d,%3d,%3d)"),
num_length(width - 1), x_pixel,
{
lw->split_images[i] = image_new(TRUE);
-#if GTK_CHECK_VERSION(2,12,0)
g_object_ref(lw->split_images[i]->widget);
-#else
- gtk_widget_ref(lw->split_images[i]->widget);
-#endif
g_signal_connect(G_OBJECT(lw->split_images[i]->pr), "update-pixel",
G_CALLBACK(layout_status_update_pixel_cb), lw);
// layout_list_sync_path(lw, path);
layout_set_fd(lw, fd);
}
+ layout_status_update_image(lw);
}
{
if (lw->split_images[i])
{
-#if GTK_CHECK_VERSION(2,12,0)
g_object_unref(lw->split_images[i]->widget);
-#else
- gtk_widget_unref(lw->split_images[i]->widget);
-#endif
lw->split_images[i] = NULL;
}
}
layout_image_set_fd(lw, NULL);
}
- /* the image will be set to the next image from the list soon,
+ /* the image will be set to the next image from the list soon,
setting it to NULL here is not necessary*/
}
}