while (pan_queue_step(pw));
}
-#if 0
-static void pan_queue_image_area_cb(ImageLoader *il, guint x, guint y,
- guint width, guint height, gpointer data)
-{
- PanWindow *pw = data;
-
- if (pw->queue_pi)
- {
- PanItem *pi;
- gint rc;
-
- pi = pw->queue_pi;
-
- if (!pi->pixbuf)
- {
- pi->pixbuf = image_loader_get_pixbuf(pw->il);
- if (pi->pixbuf) g_object_ref(pi->pixbuf);
- }
-
- rc = pi->refcount;
- image_area_changed(pw->imd, pi->x + x, pi->y + y, width, height);
- pi->refcount = rc;
- }
-}
-#endif
-
static gboolean pan_queue_step(PanWindow *pw)
{
PanItem *pi;
image_loader_set_requested_size(pw->il, pi->width, pi->height);
}
-#if 0
- image_loader_set_area_ready_func(pw->il, pan_queue_image_area_cb, pw);
-#endif
g_signal_connect(G_OBJECT(pw->il), "error", (GCallback)pan_queue_image_done_cb, pw);
g_signal_connect(G_OBJECT(pw->il), "done", (GCallback)pan_queue_image_done_cb, pw);
g_list_free(list);
-#if 0
- if (x%512 == 0 && y%512 == 0)
- {
- PangoLayout *layout;
- gchar *buf;
-
- layout = gtk_widget_create_pango_layout((GtkWidget *)pr, NULL);
-
- buf = g_strdup_printf("%d,%d\n(#%d)", x, y,
- (x / pr->source_tile_width) +
- (y / pr->source_tile_height * (pr->image_width/pr->source_tile_width + 1)));
- pango_layout_set_text(layout, buf, -1);
- g_free(buf);
-
- pixbuf_draw_layout(pixbuf, layout, (GtkWidget *)pr, 0, 0, 0, 0, 0, 255);
-
- g_object_unref(G_OBJECT(layout));
- }
-#endif
-
return TRUE;
}
fd = pw->cache_todo->data;
pw->cache_todo = g_list_remove(pw->cache_todo, fd);
-#if 0
- if (enable_thumb_caching)
- {
- gchar *found;
-
- found = cache_find_location(CACHE_TYPE_SIM, fd->path);
- if (found && filetime(found) == fd->date)
- {
- cd = cache_sim_data_load(found);
- }
- g_free(found);
- }
-
- if (!cd) cd = cache_sim_data_new();
-
- if (!cd->dimensions)
- {
- cd->dimensions = image_load_dimensions(fd, &cd->width, &cd->height);
- if (enable_thumb_caching &&
- cd->dimensions)
- {
- gchar *base;
- mode_t mode = 0755;
-
- base = cache_get_location(CACHE_TYPE_SIM, fd->path, FALSE, &mode);
- if (recursive_mkdir_if_not_exists(base, mode))
- {
- g_free(cd->path);
- cd->path = cache_get_location(CACHE_TYPE_SIM, fd->path, TRUE, NULL);
- if (cache_sim_data_save(cd))
- {
- filetime_set(cd->path, filetime(fd->path));
- }
- }
- g_free(base);
- }
-
- pw->cache_tick = 9;
- }
-#endif
pc = g_new0(PanCacheData, 1);
pc->fd = file_data_ref(fd);
gint col, row;
gint cw, ch;
gint l;
- gdouble total;
- gdouble s;
- gdouble aw, ah;
gint i, j;
pan_grid_clear(pw);
if (l < 1) return;
- total = (gdouble)width * (gdouble)height / (gdouble)l;
- s = sqrt(total);
-
- aw = (gdouble)width / s;
- ah = (gdouble)height / s;
-
col = (gint)(sqrt((gdouble)l / grid_size) * width / height + 0.999);
col = CLAMP(col, 1, l / grid_size + 1);
row = (gint)((gdouble)l / grid_size / col);
pr = PIXBUF_RENDERER(pw->imd->pr);
fd = pan_menu_click_fd(pw);
-
+
imd_widget = gtk_container_get_focus_child(GTK_CONTAINER(pw->imd->widget));
-#if GTK_CHECK_VERSION(2,20,0)
- focused = (pw->fs || imd_widget && gtk_widget_has_focus(imd_widget));
+ focused = (pw->fs || (imd_widget && gtk_widget_has_focus(imd_widget)));
on_entry = (gtk_widget_has_focus(pw->path_entry) ||
gtk_widget_has_focus(pw->search_entry));
-#else
- focused = (pw->fs || imd_widget && GTK_WIDGET_HAS_FOCUS(imd_widget));
- on_entry = (GTK_WIDGET_HAS_FOCUS(pw->path_entry) ||
- GTK_WIDGET_HAS_FOCUS(pw->search_entry));
-#endif
if (focused)
{
if (event->state & GDK_CONTROL_MASK)
{
- gint n = -1;
-
stop_signal = TRUE;
switch (event->keyval)
{
case '1':
- n = 0;
- break;
case '2':
- n = 1;
- break;
case '3':
- n = 2;
- break;
case '4':
- n = 3;
- break;
case '5':
- n = 4;
- break;
case '6':
- n = 5;
- break;
case '7':
- n = 6;
- break;
case '8':
- n = 7;
- break;
case '9':
- n = 8;
- break;
case '0':
- n = 9;
break;
case 'C': case 'c':
if (fd) file_util_copy(fd, NULL, NULL, GTK_WIDGET(pr));
stop_signal = FALSE;
break;
}
-#if 0
- if (n != -1 && fd)
- {
- if (!editor_window_flag_set(n))
- {
- pan_fullscreen_toggle(pw, TRUE);
- }
- file_util_start_editor_from_file(n, fd, GTK_WIDGET(pr));
- }
-#endif
}
else
{
pan_fullscreen_toggle(pw, FALSE);
break;
case 'I': case 'i':
-#if 0
- pan_overlay_toggle(pw);
-#endif
break;
case GDK_KEY_Delete: case GDK_KEY_KP_Delete:
break;
if (!fd) return;
pan_text_alignment_add(ta, NULL, NULL);
-#if 0
- {
- GList *work;
- gint i;
-
-
- for (i = 0; ExifUIList[i].key; i++)
- {
- gchar *label;
- gchar *desc;
- gchar *text;
-
- if (ExifUIList[i].current == EXIF_UI_OFF) continue;
-
- text = metadata_read_string(fd, ExifUIList[i].key, METADATA_FORMATTED);
-
- if (ExifUIList[i].current == EXIF_UI_IFSET && (!text || !*text))
- {
- g_free(text);
- continue;
- }
-
- desc = exif_get_description_by_key(ExifUIList[i].key);
- label = g_strdup_printf("%s:", desc);
- g_free(desc);
- pan_text_alignment_add(ta, label, text);
- g_free(label);
- g_free(text);
- }
-
- work = g_list_last(history_list_get_by_key("exif_extras"));
- if (work) pan_text_alignment_add(ta, "---", NULL);
- while (work)
- {
- const gchar *name;
- gchar *text;
-
- name = work->data;
- work = work->prev;
-
- text = metadata_read_string(fd, name, METADATA_FORMATTED);
- if (text)
- {
- gchar *label = g_strdup_printf("%s:", name);
- pan_text_alignment_add(ta, label, text);
- g_free(label);
- g_free(text);
- }
- }
- }
-#endif
}
{
gchar *text;
-#if 0
- if (!GTK_WIDGET_VISIBLE(pw->search_box))
- {
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pw->search_button), TRUE);
- }
-#endif
-
text = g_strdup(gtk_entry_get_text(GTK_ENTRY(pw->search_entry)));
pan_search_activate_cb(text, pw);
g_free(text);
PanWindow *pw = data;
gboolean visible;
-#if GTK_CHECK_VERSION(2,20,0)
visible = gtk_widget_get_visible(pw->search_box);
-#else
- visible = GTK_WIDGET_VISIBLE(pw->search_box);
-#endif
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)) == visible) return;
if (visible)
if (enable)
{
-#if GTK_CHECK_VERSION(2,20,0)
if (gtk_widget_get_visible(pw->search_box))
-#else
- if (GTK_WIDGET_VISIBLE(pw->search_box))
-#endif
{
gtk_widget_grab_focus(pw->search_entry);
}
}
else
{
-#if GTK_CHECK_VERSION(2,20,0)
if (gtk_widget_get_visible(pw->search_entry))
-#else
- if (GTK_WIDGET_VISIBLE(pw->search_entry))
-#endif
{
-#if GTK_CHECK_VERSION(2,20,0)
if (gtk_widget_has_focus(pw->search_entry))
-#else
- if (GTK_WIDGET_HAS_FOCUS(pw->search_entry))
-#endif
{
gtk_widget_grab_focus(GTK_WIDGET(pw->imd->widget));
}
static void scroll_cb(PixbufRenderer *pr, GdkEventScroll *event, gpointer data)
{
-#if 0
- PanWindow *pw = data;
-#endif
gint w, h;
w = pr->vis_width;
pan_layout_update(pw);
}
-#if 0
-static void pan_window_date_toggle_cb(GtkWidget *button, gpointer data)
-{
- PanWindow *pw = data;
-
- pw->exif_date_enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
- pan_layout_update(pw);
-}
-#endif
-
static void pan_window_entry_activate_cb(const gchar *new_text, gpointer data)
{
PanWindow *pw = data;
gtk_container_add(GTK_CONTAINER(frame), pw->label_zoom);
gtk_widget_show(pw->label_zoom);
-#if 0
- pw->date_button = pref_checkbox_new(box, _("Use Exif date"), pw->exif_date_enable,
- G_CALLBACK(pan_window_date_toggle_cb), pw);
-#endif
-
pw->search_button = gtk_toggle_button_new();
gtk_button_set_relief(GTK_BUTTON(pw->search_button), GTK_RELIEF_NONE);
gtk_button_set_focus_on_click(GTK_BUTTON(pw->search_button), FALSE);
{
GList *list = NULL;
FileData *fd = pan_menu_click_fd(pw);
-
+
if (fd) list = g_list_prepend(filelist_copy(fd->sidecar_files), file_data_ref(fd));
-
+
return list;
}
submenu_add_edit(menu, &item, G_CALLBACK(pan_edit_cb), pw, editmenu_fd_list);
gtk_widget_set_sensitive(item, active);
-
+
menu_item_add_stock_sensitive(menu, _("View in _new window"), GTK_STOCK_NEW, active,
G_CALLBACK(pan_new_window_cb), pw);
fd = pan_menu_click_fd(pw);
if (fd)
{
- gchar *text = NULL;
- gint len;
GList *list;
list = g_list_append(NULL, fd);