#include "pan-calendar.h"
-#include <math.h>
+#include <cmath>
+#include "debug.h"
#include "misc.h"
+#include "pan-item.h"
#include "pan-util.h"
-#include "pan-view.h"
#include "pan-view-filter.h"
+#include "pan-view.h"
#include "pixbuf-util.h"
#define PAN_CAL_POPUP_COLOR 220, 220, 220
-#define PAN_CAL_POPUP_ALPHA 255
-#define PAN_CAL_POPUP_BORDER 1
+enum {
+ PAN_CAL_POPUP_ALPHA = 255,
+ PAN_CAL_POPUP_BORDER = 1
+};
#define PAN_CAL_POPUP_BORDER_COLOR 0, 0, 0
#define PAN_CAL_POPUP_TEXT_COLOR 0, 0, 0
-#define PAN_CAL_DAY_WIDTH 100
-#define PAN_CAL_DAY_HEIGHT 80
+enum {
+ PAN_CAL_DAY_WIDTH = 100,
+ PAN_CAL_DAY_HEIGHT = 80
+};
#define PAN_CAL_DAY_COLOR 255, 255, 255
-#define PAN_CAL_DAY_ALPHA 220
-#define PAN_CAL_DAY_BORDER 2
+enum {
+ PAN_CAL_DAY_ALPHA = 220,
+ PAN_CAL_DAY_BORDER = 2
+};
#define PAN_CAL_DAY_BORDER_COLOR 0, 0, 0
#define PAN_CAL_DAY_TEXT_COLOR 0, 0, 0
#define PAN_CAL_MONTH_COLOR 255, 255, 255
-#define PAN_CAL_MONTH_ALPHA 200
-#define PAN_CAL_MONTH_BORDER 4
+enum {
+ PAN_CAL_MONTH_ALPHA = 200,
+ PAN_CAL_MONTH_BORDER = 4
+};
#define PAN_CAL_MONTH_BORDER_COLOR 0, 0, 0
#define PAN_CAL_MONTH_TEXT_COLOR 0, 0, 0
-#define PAN_CAL_DOT_SIZE 3
-#define PAN_CAL_DOT_GAP 2
+enum {
+ PAN_CAL_DOT_SIZE = 3,
+ PAN_CAL_DOT_GAP = 2
+};
#define PAN_CAL_DOT_COLOR 128, 128, 128
-#define PAN_CAL_DOT_ALPHA 128
+enum {
+ PAN_CAL_DOT_ALPHA = 128
+};
#define PAN_CAL_DAY_OF_WEEK_COLOR 128, 128, 128
PanItem *pi;
GList *list;
GList *work;
- 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;
gint grid;
gint column;
x = pi_day->x + pi_day->width + 4;
y = pi_day->y;
- pbox = pan_item_box_new(pw, NULL, x, y, PAN_BOX_BORDER, PAN_BOX_BORDER,
+ pbox = pan_item_box_new(pw, nullptr, x, y, PAN_BOX_BORDER, PAN_BOX_BORDER,
PAN_CAL_POPUP_BORDER,
PAN_CAL_POPUP_COLOR, PAN_CAL_POPUP_ALPHA,
PAN_CAL_POPUP_BORDER_COLOR, PAN_CAL_POPUP_ALPHA);
util_clip_triangle(x1, y1, x2, y2, x3, y3,
&x, &y, &w, &h);
- pi = pan_item_tri_new(pw, NULL, x, y, w, h,
+ pi = pan_item_tri_new(pw, nullptr, x, y, w, h,
x1, y1, x2, y2, x3, y3,
PAN_CAL_POPUP_COLOR, PAN_CAL_POPUP_ALPHA);
pan_item_tri_border(pi, PAN_BORDER_1 | PAN_BORDER_3, PAN_CAL_POPUP_BORDER_COLOR, PAN_CAL_POPUP_ALPHA);
{
GList *list;
GList *work;
- gint x, y;
+ gint x;
+ gint y;
time_t tc;
gint count;
gint day_max;
gint end_month = 0;
gint day_of_week;
- list = pan_list_tree(dir_fd, SORT_NONE, TRUE, pw->ignore_symlinks);
+ list = pan_list_tree(dir_fd, SORT_NONE, TRUE, TRUE, pw->ignore_symlinks);
pan_filter_fd_list(&list, pw->filter_ui->filter_elements, pw->filter_ui->filter_classes);
if (pw->cache_list && pw->exif_date_enable)
{
- pw->cache_list = pan_cache_sort(pw->cache_list, SORT_NAME, TRUE);
- list = filelist_sort(list, SORT_NAME, TRUE);
+ pw->cache_list = pan_cache_sort(pw->cache_list, SORT_NAME, TRUE, TRUE);
+ list = filelist_sort(list, SORT_NAME, TRUE, TRUE);
pan_cache_sync_date(pw, list);
}
- pw->cache_list = pan_cache_sort(pw->cache_list, SORT_TIME, TRUE);
- list = filelist_sort(list, SORT_TIME, TRUE);
+ pw->cache_list = pan_cache_sort(pw->cache_list, SORT_TIME, TRUE, TRUE);
+ list = filelist_sort(list, SORT_TIME, TRUE, TRUE);
day_max = 0;
count = 0;
x = PAN_BOX_BORDER;
- pi_month = pan_item_box_new(pw, NULL, x, y, PAN_CAL_DAY_WIDTH * 7, PAN_CAL_DAY_HEIGHT / 4,
+ pi_month = pan_item_box_new(pw, nullptr, x, y, PAN_CAL_DAY_WIDTH * 7, PAN_CAL_DAY_HEIGHT / 4,
PAN_CAL_MONTH_BORDER,
PAN_CAL_MONTH_COLOR, PAN_CAL_MONTH_ALPHA,
PAN_CAL_MONTH_BORDER_COLOR, PAN_CAL_MONTH_ALPHA);
{
FileData *fd;
PanItem *pi_day;
- gint dx, dy;
+ gint dx;
+ gint dy;
gint n = 0;
gchar fake_path[20];
dx = x + PAN_CAL_DOT_GAP * 2;
dy = y + PAN_CAL_DOT_GAP * 2;
- fd = static_cast<FileData *>((work) ? work->data : NULL);
+ fd = static_cast<FileData *>((work) ? work->data : nullptr);
while (fd && pan_date_compare(fd->date, dt, PAN_DATE_LENGTH_DAY))
{
PanItem *pi;
n++;
work = work->next;
- fd = static_cast<FileData *>((work) ? work->data : NULL);
+ fd = static_cast<FileData *>((work) ? work->data : nullptr);
}
if (n > 0)