Sort headers using clang-tidy
[geeqie.git] / src / collect-table.cc
index 61944d6..12f38f5 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
 #include "collect-table.h"
 
+#include <config.h>
+
 #include "cellrenderericon.h"
 #include "collect-dlg.h"
 #include "collect-io.h"
+#include "compat.h"
+#include "debug.h"
 #include "dnd.h"
 #include "dupe.h"
 #include "filedata.h"
 #include "img-view.h"
-#include "layout.h"
+#include "intl.h"
 #include "layout-image.h"
+#include "layout.h"
+#include "main-defines.h"
 #include "menu.h"
 #include "metadata.h"
 #include "misc.h"
 #include "pixbuf-util.h"
 #include "print.h"
-#include "utilops.h"
 #include "ui-fileops.h"
 #include "ui-menu.h"
 #include "ui-tree-edit.h"
 #include "uri-utils.h"
+#include "utilops.h"
 #include "view-file.h"
 
 /* between these, the icon width is increased by thumb_max_width / 2 */
-#define THUMB_MIN_ICON_WIDTH 128
-#define THUMB_MAX_ICON_WIDTH 150
-
-#define COLLECT_TABLE_MAX_COLUMNS 32
-#define THUMB_BORDER_PADDING 2
+enum {
+       THUMB_MIN_ICON_WIDTH = 128,
+       THUMB_MAX_ICON_WIDTH = 150
+};
 
-#define COLLECT_TABLE_TIP_DELAY 500
-#define COLLECT_TABLE_TIP_DELAY_PATH (COLLECT_TABLE_TIP_DELAY * 1.7)
+enum {
+       COLLECT_TABLE_MAX_COLUMNS = 32,
+       THUMB_BORDER_PADDING = 2
+};
 
+enum {
+       COLLECT_TABLE_TIP_DELAY = 500,
+       COLLECT_TABLE_TIP_DELAY_PATH = 850
+};
 
 enum {
        CTABLE_COLUMN_POINTER = 0,
@@ -124,7 +134,8 @@ static gboolean collection_table_find_position(CollectTable *ct, CollectInfo *in
 static gboolean collection_table_find_iter(CollectTable *ct, CollectInfo *info, GtkTreeIter *iter, gint *column)
 {
        GtkTreeModel *store;
-       gint row, col;
+       gint row;
+       gint col;
 
        store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
        if (!collection_table_find_position(ct, info, &row, &col)) return FALSE;
@@ -481,10 +492,13 @@ static void collection_table_select_util(CollectTable *ct, CollectInfo *info, gb
 
 static void collection_table_select_region_util(CollectTable *ct, CollectInfo *start, CollectInfo *end, gboolean select)
 {
-       gint row1, col1;
-       gint row2, col2;
+       gint row1;
+       gint col1;
+       gint row2;
+       gint col2;
        gint t;
-       gint i, j;
+       gint i;
+       gint j;
 
        if (!collection_table_find_position(ct, start, &row1, &col1) ||
            !collection_table_find_position(ct, end, &row2, &col2) ) return;
@@ -561,7 +575,8 @@ static GList *collection_table_get_list(CollectTable *ct)
 static void tip_show(CollectTable *ct)
 {
        GtkWidget *label;
-       gint x, y;
+       gint x;
+       gint y;
        GdkDisplay *display;
        GdkSeat *seat;
        GdkDevice *device;
@@ -648,7 +663,8 @@ static void tip_update(CollectTable *ct, CollectInfo *info)
 
        if (ct->tip_window)
                {
-               gint x, y;
+               gint x;
+               gint y;
                gdk_device_get_position(device, nullptr, &x, &y);
 
                gq_gtk_window_move(GTK_WINDOW(ct->tip_window), x + 16, y + 16);
@@ -1071,7 +1087,8 @@ static GtkWidget *collection_table_popup_menu(CollectTable *ct, gboolean over_ic
 void collection_table_set_focus(CollectTable *ct, CollectInfo *info)
 {
        GtkTreeIter iter;
-       gint row, col;
+       gint row;
+       gint col;
 
        if (g_list_find(ct->cd->list, ct->focus_info))
                {
@@ -1479,7 +1496,8 @@ static void collection_table_insert_marker(CollectTable *ct, CollectInfo *info,
        gboolean after = FALSE;
        GdkRectangle cell;
        GdkWindow *parent;
-       gint x_parent, y_parent;
+       gint x_parent;
+       gint y_parent;
        GError *error = nullptr;
        GInputStream *in_stream;
        GdkPixbuf *pb;
@@ -1550,8 +1568,10 @@ static void collection_table_insert_marker(CollectTable *ct, CollectInfo *info,
 
        if (info)
                {
-               gint x, y;
-               gint w, h;
+               gint x;
+               gint y;
+               gint w;
+               gint h;
 
                w = gdk_window_get_width(ct->marker_window);
                h = gdk_window_get_height(ct->marker_window);
@@ -1607,8 +1627,10 @@ static gboolean collection_table_auto_scroll_idle_cb(gpointer data)
 {
        auto ct = static_cast<CollectTable *>(data);
        GdkWindow *window;
-       gint x, y;
-       gint w, h;
+       gint x;
+       gint y;
+       gint w;
+       gint h;
        GdkSeat *seat;
        GdkDevice *device;
 
@@ -1913,7 +1935,8 @@ static void collection_table_sync(CollectTable *ct)
        GtkTreeModel *store;
        GtkTreeIter iter;
        GList *work;
-       gint r, c;
+       gint r;
+       gint c;
 
        store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
 
@@ -2094,7 +2117,8 @@ static void collection_table_move_by_info_list(CollectTable *ct, GList *info_lis
 void collection_table_file_update(CollectTable *ct, CollectInfo *info)
 {
        GtkTreeIter iter;
-       gint row, col;
+       gint row;
+       gint col;
        gdouble value;
 
        if (!info)