Sort headers using clang-tidy
[geeqie.git] / src / pan-view / pan-view.cc
index 141944f..8db42c2 100644 (file)
 
 #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"
@@ -334,7 +349,10 @@ static gboolean pan_window_request_tile_cb(PixbufRenderer *pr, gint x, gint y,
 
        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,
@@ -347,7 +365,10 @@ static gboolean pan_window_request_tile_cb(PixbufRenderer *pr, gint x, gint y,
                }
        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,
@@ -718,10 +739,13 @@ static void pan_grid_clear(PanWindow *pw)
 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);
 
@@ -775,7 +799,10 @@ static void pan_grid_build(PanWindow *pw, gint width, gint height, gint grid_siz
                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;
@@ -929,7 +956,10 @@ static GList *pan_layout_intersect_l(GList *list, GList *item_list,
        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;
@@ -1387,8 +1417,16 @@ void pan_info_update(PanWindow *pw, PanItem *pi)
        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;
@@ -1458,7 +1496,8 @@ void pan_info_update(PanWindow *pw, PanItem *pi)
 
        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;
@@ -1516,7 +1555,8 @@ static void button_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
        auto pw = static_cast<PanWindow *>(data);
        PanItem *pi = nullptr;
        GtkWidget *menu;
-       gint rx, ry;
+       gint rx;
+       gint ry;
 
        rx = ry = 0;
        if (pr->scale)
@@ -1560,7 +1600,8 @@ static void button_cb(PixbufRenderer *pr, GdkEventButton *event, gpointer data)
 
 static void scroll_cb(PixbufRenderer *pr, GdkEventScroll *event, gpointer)
 {
-       gint w, h;
+       gint w;
+       gint h;
 
        w = pr->vis_width;
        h = pr->vis_height;
@@ -1659,7 +1700,8 @@ static void pan_window_image_scroll_notify_cb(PixbufRenderer *pr, gpointer data)
        auto pw = static_cast<PanWindow *>(data);
        GtkAdjustment *adj;
        GdkRectangle rect;
-       gint width, height;
+       gint width;
+       gint height;
 
        if (pr->scale == 0.0) return;
 
@@ -2007,7 +2049,7 @@ static gboolean pan_warning(FileData *dir_fd)
        GenericDialog *gd;
        GtkWidget *box;
        GtkWidget *group;
-       GtkWidget *button;
+       GtkWidget *checkbox;
        GtkWidget *ct_button;
        gboolean hide_dlg;
 
@@ -2039,9 +2081,9 @@ static gboolean pan_warning(FileData *dir_fd)
 
        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);
 
@@ -2303,7 +2345,8 @@ static GtkWidget *pan_popup_menu(PanWindow *pw)
        GtkWidget *menu;
        GtkWidget *submenu;
        GtkWidget *item;
-       gboolean active, video;
+       gboolean active;
+       gboolean video;
        GList *editmenu_fd_list;
        GtkAccelGroup *accel_group;