* 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,
CTABLE_COLUMN_COUNT
};
-#define INFO_SELECTED(x) (x->flag_mask & SELECTION_SELECTED)
+#define INFO_SELECTED(x) ((x)->flag_mask & SELECTION_SELECTED)
static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint h, gboolean force);
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;
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;
static void tip_show(CollectTable *ct)
{
GtkWidget *label;
- gint x, y;
+ gint x;
+ gint y;
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *device;
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);
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))
{
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;
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);
{
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;
GtkTreeModel *store;
GtkTreeIter iter;
GList *work;
- gint r, c;
+ gint r;
+ gint c;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview));
void collection_table_file_update(CollectTable *ct, CollectInfo *info)
{
GtkTreeIter iter;
- gint row, col;
+ gint row;
+ gint col;
gdouble value;
if (!info)