#include "pan-view.h"
+#include <config.h>
+
#include "bar-exif.h"
+#include "compat.h"
+#include "debug.h"
#include "dnd.h"
#include "editors.h"
#include "exif.h"
#include "fullscreen.h"
#include "image.h"
#include "img-view.h"
+#include "intl.h"
#include "layout-util.h"
+#include "main-defines.h"
+#include "main.h"
#include "menu.h"
#include "metadata.h"
+#include "misc.h"
#include "pan-calendar.h"
#include "pan-folder.h"
#include "pan-grid.h"
+#include "pan-item.h"
#include "pan-timeline.h"
#include "pan-util.h"
#include "pan-view-filter.h"
#include "pan-view-search.h"
+#include "pixbuf-renderer.h"
#include "pixbuf-util.h"
#include "thumb.h"
#include "ui-fileops.h"
#include <cmath>
-#define PAN_WINDOW_DEFAULT_WIDTH 720
-#define PAN_WINDOW_DEFAULT_HEIGHT 500
+enum {
+ PAN_WINDOW_DEFAULT_WIDTH = 720,
+ PAN_WINDOW_DEFAULT_HEIGHT = 500
+};
-#define PAN_TILE_SIZE 512
+enum {
+ PAN_TILE_SIZE = 512
+};
#define ZOOM_INCREMENT 1.0
-#define ZOOM_LABEL_WIDTH 64
+enum {
+ ZOOM_LABEL_WIDTH = 64
+};
#define PAN_PREF_GROUP "pan_view_options"
for (i = (x / PAN_GRID_SIZE) * PAN_GRID_SIZE; i < x + width; i += PAN_GRID_SIZE)
{
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (util_clip_region(x, y, width, height,
i, y, 1, height,
}
for (i = (y / PAN_GRID_SIZE) * PAN_GRID_SIZE; i < y + height; i += PAN_GRID_SIZE)
{
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
if (util_clip_region(x, y, width, height,
x, i, width, 1,
auto pcb = static_cast<PanCacheData *>(b);
return filelist_sort_compare_filedata(pca->fd, pcb->fd);
}
-GList *pan_cache_sort(GList *list, SortType method, gboolean ascend)
+GList *pan_cache_sort(GList *list, SortType method, gboolean ascend, gboolean case_sensitive)
{
- return filelist_sort_full(list, method, ascend, reinterpret_cast<GCompareFunc>(pan_cache_sort_file_cb));
+ return filelist_sort_full(list, method, ascend, case_sensitive, reinterpret_cast<GCompareFunc>(pan_cache_sort_file_cb));
}
pan_cache_free(pw);
- list = pan_list_tree(dir_fd, SORT_NAME, TRUE, pw->ignore_symlinks);
+ list = pan_list_tree(dir_fd, SORT_NAME, TRUE, TRUE, pw->ignore_symlinks);
pw->cache_todo = g_list_reverse(list);
pw->cache_total = g_list_length(pw->cache_todo);
static void pan_grid_build(PanWindow *pw, gint width, gint height, gint grid_size)
{
GList *work;
- gint col, row;
- gint cw, ch;
+ gint col;
+ gint row;
+ gint cw;
+ gint ch;
gint l;
- gint i, j;
+ gint i;
+ gint j;
pan_grid_clear(pw);
while (grid)
{
PanGrid *pg;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
pg = static_cast<PanGrid *>(grid->data);
grid = grid->next;
while (work)
{
PanItem *pi;
- gint rx, ry, rw, rh;
+ gint rx;
+ gint ry;
+ gint rw;
+ gint rh;
pi = static_cast<PanItem *>(work->data);
work = work->next;
PanItem *pbox;
PanItem *p;
gchar *buf;
- gint x1, y1, x2, y2, x3, y3;
- gint x, y, w, h;
+ gint x1;
+ gint y1;
+ gint x2;
+ gint y2;
+ gint x3;
+ gint y3;
+ gint x;
+ gint y;
+ gint w;
+ gint h;
if (pw->click_pi == pi) return;
if (pi && !pi->fd) pi = nullptr;
if (pw->info_image_size > PAN_IMAGE_SIZE_THUMB_NONE)
{
- gint iw, ih;
+ gint iw;
+ gint ih;
if (image_load_dimensions(pi->fd, &iw, &ih))
{
gint scale = 25;
auto pw = static_cast<PanWindow *>(data);
PanItem *pi = nullptr;
GtkWidget *menu;
- gint rx, ry;
+ gint rx;
+ gint ry;
rx = ry = 0;
if (pr->scale)
static void scroll_cb(PixbufRenderer *pr, GdkEventScroll *event, gpointer)
{
- gint w, h;
+ gint w;
+ gint h;
w = pr->vis_width;
h = pr->vis_height;
auto pw = static_cast<PanWindow *>(data);
GtkAdjustment *adj;
GdkRectangle rect;
- gint width, height;
+ gint width;
+ gint height;
if (pr->scale == 0.0) return;
pan_fullscreen_toggle(pw, TRUE);
pan_search_ui_destroy(&pw->search_ui);
pan_filter_ui_destroy(&pw->filter_ui);
- gtk_widget_destroy(pw->window);
+ gq_gtk_widget_destroy(pw->window);
pan_window_items_free(pw);
pan_cache_free(pw);
pw->idle_id = 0;
- pw->window = window_new(GTK_WINDOW_TOPLEVEL, "panview", nullptr, nullptr, _("Pan View"));
+ pw->window = window_new("panview", nullptr, nullptr, _("Pan View"));
DEBUG_NAME(pw->window);
geometry.min_width = DEFAULT_MINIMAL_WINDOW_SIZE;
pref_label_new(box, _("Location:"));
combo = tab_completion_new_with_history(&pw->path_entry, dir_fd->path, "pan_view_path", -1,
pan_window_entry_activate_cb, pw);
- gtk_box_pack_start(GTK_BOX(box), combo, TRUE, TRUE, 0);
+ gq_gtk_box_pack_start(GTK_BOX(box), combo, TRUE, TRUE, 0);
gtk_widget_show(combo);
combo = gtk_combo_box_text_new();
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), pw->layout);
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(pan_window_layout_change_cb), pw);
- gtk_box_pack_start(GTK_BOX(box), combo, FALSE, FALSE, 0);
+ gq_gtk_box_pack_start(GTK_BOX(box), combo, FALSE, FALSE, 0);
gtk_widget_show(combo);
combo = gtk_combo_box_text_new();
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), pw->size);
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(pan_window_layout_size_cb), pw);
- gtk_box_pack_start(GTK_BOX(box), combo, FALSE, FALSE, 0);
+ gq_gtk_box_pack_start(GTK_BOX(box), combo, FALSE, FALSE, 0);
gtk_widget_show(combo);
table = pref_table_new(vbox, 2, 2, FALSE, TRUE);
- gtk_table_set_row_spacings(GTK_TABLE(table), 2);
- gtk_table_set_col_spacings(GTK_TABLE(table), 2);
+ gtk_grid_set_row_spacing(GTK_GRID(table), 2);
+ gtk_grid_set_column_spacing(GTK_GRID(table), 2);
+ pw->imd = image_new(TRUE);
pw->imd_normal = pw->imd;
g_signal_connect(G_OBJECT(pw->imd->pr), "zoom",
g_signal_connect(G_OBJECT(pw->imd->pr), "scroll_notify",
G_CALLBACK(pan_window_image_scroll_notify_cb), pw);
- gtk_table_attach(GTK_TABLE(table), pw->imd->widget, 0, 1, 0, 1,
- static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), 0, 0);
+ gq_gtk_grid_attach(GTK_GRID(table), pw->imd->widget, 0, 1, 0, 1, static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), 0, 0);
gtk_widget_show(GTK_WIDGET(pw->imd->widget));
pan_window_dnd_init(pw);
pw->scrollbar_h = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, nullptr);
g_signal_connect(G_OBJECT(pw->scrollbar_h), "value_changed",
G_CALLBACK(pan_window_scrollbar_h_value_cb), pw);
- gtk_table_attach(GTK_TABLE(table), pw->scrollbar_h, 0, 1, 1, 2,
- static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
+ gq_gtk_grid_attach(GTK_GRID(table), pw->scrollbar_h, 0, 1, 1, 2, static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(pw->scrollbar_h);
pw->scrollbar_v = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, nullptr);
g_signal_connect(G_OBJECT(pw->scrollbar_v), "value_changed",
G_CALLBACK(pan_window_scrollbar_v_value_cb), pw);
- gtk_table_attach(GTK_TABLE(table), pw->scrollbar_v, 1, 2, 0, 1,
- static_cast<GtkAttachOptions>(0), static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), 0, 0);
+ gq_gtk_grid_attach(GTK_GRID(table), pw->scrollbar_v, 1, 2, 0, 1, static_cast<GtkAttachOptions>(0), static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), 0, 0);
gtk_widget_show(pw->scrollbar_v);
/* find bar */
pw->search_ui = pan_search_ui_new(pw);
- gtk_box_pack_start(GTK_BOX(vbox), pw->search_ui->search_box, FALSE, FALSE, 2);
+ gq_gtk_box_pack_start(GTK_BOX(vbox), pw->search_ui->search_box, FALSE, FALSE, 2);
/* filter bar */
pw->filter_ui = pan_filter_ui_new(pw);
- gtk_box_pack_start(GTK_BOX(vbox), pw->filter_ui->filter_box, FALSE, FALSE, 2);
+ gq_gtk_box_pack_start(GTK_BOX(vbox), pw->filter_ui->filter_box, FALSE, FALSE, 2);
/* status bar */
frame = gtk_frame_new(nullptr);
DEBUG_NAME(frame);
- gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
+ gq_gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_size_request(frame, ZOOM_LABEL_WIDTH, -1);
- gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 0);
+ gq_gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 0);
gtk_widget_show(frame);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
frame = gtk_frame_new(nullptr);
DEBUG_NAME(frame);
- gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
+ gq_gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_size_request(frame, ZOOM_LABEL_WIDTH, -1);
- gtk_box_pack_end(GTK_BOX(box), frame, FALSE, FALSE, 0);
+ gq_gtk_box_pack_end(GTK_BOX(box), frame, FALSE, FALSE, 0);
gtk_widget_show(frame);
pw->label_zoom = gtk_label_new("");
gtk_widget_show(pw->label_zoom);
// Add the "Find" button to the status bar area.
- gtk_box_pack_end(GTK_BOX(box), pw->search_ui->search_button, FALSE, FALSE, 0);
+ gq_gtk_box_pack_end(GTK_BOX(box), pw->search_ui->search_button, FALSE, FALSE, 0);
gtk_widget_show(pw->search_ui->search_button);
// Add the "Filter" button to the status bar area.
- gtk_box_pack_end(GTK_BOX(box), pw->filter_ui->filter_button, FALSE, FALSE, 0);
+ gq_gtk_box_pack_end(GTK_BOX(box), pw->filter_ui->filter_button, FALSE, FALSE, 0);
gtk_widget_show(pw->filter_ui->filter_button);
g_signal_connect(G_OBJECT(pw->window), "delete_event",
GenericDialog *gd;
GtkWidget *box;
GtkWidget *group;
- GtkWidget *button;
+ GtkWidget *checkbox;
GtkWidget *ct_button;
gboolean hide_dlg;
ct_button = pref_checkbox_new_int(group, _("Cache thumbnails"),
options->thumbnails.enable_caching, &options->thumbnails.enable_caching);
- button = pref_checkbox_new_int(group, _("Use shared thumbnail cache"),
+ checkbox = pref_checkbox_new_int(group, _("Use shared thumbnail cache"),
options->thumbnails.spec_standard, &options->thumbnails.spec_standard);
- pref_checkbox_link_sensitivity(ct_button, button);
+ pref_checkbox_link_sensitivity(ct_button, checkbox);
pref_line(box, 0);
GtkWidget *menu;
GtkWidget *submenu;
GtkWidget *item;
- gboolean active, video;
+ gboolean active;
+ gboolean video;
GList *editmenu_fd_list;
GtkAccelGroup *accel_group;