Merge remote-tracking branch 'github/merge-requests/451'
authorKlaus Ethgen <Klaus@Ethgen.de>
Sat, 24 Dec 2016 12:44:25 +0000 (13:44 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Sat, 24 Dec 2016 12:44:25 +0000 (13:44 +0100)
* github/merge-requests/451:
  Move pan-view components to their own subdir.
  Update the automake file with new headers
  Refactor pan-types.h into discrete header files for each pan-view code module
  Fix errors in -Werror (except GdkPixbuf deprecation warnings)

24 files changed:
.gitignore
configure.in
src/Makefile.am
src/fullscreen.c
src/pan-view.h
src/pan-view/Makefile.am [new file with mode: 0644]
src/pan-view/pan-calendar.c [moved from src/pan-calendar.c with 99% similarity]
src/pan-view/pan-calendar.h [new file with mode: 0644]
src/pan-view/pan-folder.c [moved from src/pan-folder.c with 99% similarity]
src/pan-view/pan-folder.h [new file with mode: 0644]
src/pan-view/pan-grid.c [moved from src/pan-grid.c with 97% similarity]
src/pan-view/pan-grid.h [new file with mode: 0644]
src/pan-view/pan-item.c [moved from src/pan-item.c with 99% similarity]
src/pan-view/pan-item.h [new file with mode: 0644]
src/pan-view/pan-timeline.c [moved from src/pan-timeline.c with 97% similarity]
src/pan-view/pan-timeline.h [new file with mode: 0644]
src/pan-view/pan-types.h [moved from src/pan-types.h with 51% similarity]
src/pan-view/pan-util.c [moved from src/pan-util.c with 99% similarity]
src/pan-view/pan-util.h [new file with mode: 0644]
src/pan-view/pan-view.c [moved from src/pan-view.c with 99% similarity]
src/pan-view/pan-view.h [new file with mode: 0644]
src/rcfile.c
src/rcfile.h
src/view_file.c

index 014321e..4b906f6 100644 (file)
@@ -69,6 +69,10 @@ Makefile.in
 # /src/icons/
 /src/icons/icons_inline.h
 
+# /src/pan-view/
+/src/pan-view/.deps
+/src/pan-view/.dirstamp
+
 /build-stamp
 /debian/geeqie*
 /debian/files
index e349cfd..806817c 100644 (file)
@@ -21,7 +21,8 @@ AC_INIT([geeqie], m4_esyscmd_s(git rev-parse --quiet --verify --short master), [
 AC_CONFIG_SRCDIR([src/main.c])
 
 AC_CONFIG_AUX_DIR(auxdir)
-AM_INIT_AUTOMAKE
+# Require Automake 1.14 for %reldir% support
+AM_INIT_AUTOMAKE([1.14.1 subdir-objects])
 
 AC_CONFIG_HEADER([config.h])
 
index 6941e38..151c658 100644 (file)
@@ -80,10 +80,13 @@ CLEANFILES = $(noinst_DATA)
 extra_SLIK = \
        $(extra_ICONS)
 
+include $(srcdir)/pan-view/Makefile.am
+
 bin_PROGRAMS = geeqie
 
 geeqie_SOURCES = \
        $(module_SLIK)  \
+       $(module_pan_view)      \
        ClayRGB1998.icc \
        ClayRGB1998_icc.h \
        advanced_exif.c \
@@ -202,14 +205,6 @@ geeqie_SOURCES = \
        misc.h          \
        options.c       \
        options.h       \
-       pan-calendar.c  \
-       pan-folder.c    \
-       pan-grid.c      \
-       pan-item.c      \
-       pan-timeline.c  \
-       pan-types.h     \
-       pan-util.c      \
-       pan-view.c      \
        pan-view.h      \
        pixbuf-renderer.c       \
        pixbuf-renderer.h       \
index 1c81edc..f12d741 100644 (file)
@@ -364,7 +364,7 @@ void fullscreen_stop(FullScreenData *fs)
 
        gtk_widget_destroy(fs->window);
 
-       gtk_window_present(fs->normal_window);
+       gtk_window_present(GTK_WINDOW(fs->normal_window));
 
        g_free(fs);
 }
index 8725595..791d4c3 100644 (file)
@@ -22,9 +22,9 @@
 #ifndef PAN_VIEW_H
 #define PAN_VIEW_H
 
+#include "filedata.h"
 
 void pan_window_new(FileData *dir_fd);
 
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
diff --git a/src/pan-view/Makefile.am b/src/pan-view/Makefile.am
new file mode 100644 (file)
index 0000000..70c9423
--- /dev/null
@@ -0,0 +1,16 @@
+module_pan_view = \
+       %D%/pan-calendar.c      \
+       %D%/pan-calendar.h      \
+       %D%/pan-folder.c        \
+       %D%/pan-folder.h        \
+       %D%/pan-grid.c  \
+       %D%/pan-grid.h  \
+       %D%/pan-item.c  \
+       %D%/pan-item.h  \
+       %D%/pan-timeline.c      \
+       %D%/pan-timeline.h      \
+       %D%/pan-types.h \
+       %D%/pan-util.c  \
+       %D%/pan-util.h  \
+       %D%/pan-view.c  \
+       %D%/pan-view.h
similarity index 99%
rename from src/pan-calendar.c
rename to src/pan-view/pan-calendar.c
index 9e8d09d..91aa003 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
-#include "pan-types.h"
+#include "pan-calendar.h"
 
 #include <glib/gprintf.h>
 #include <math.h>
 
+#include "pan-util.h"
+#include "pan-view.h"
+#include "pixbuf_util.h"
 
 #define PAN_CAL_POPUP_COLOR 220, 220, 220
 #define PAN_CAL_POPUP_ALPHA 255
diff --git a/src/pan-view/pan-calendar.h b/src/pan-view/pan-calendar.h
new file mode 100644 (file)
index 0000000..cc5eb81
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_CALENDAR_H
+#define PAN_VIEW_PAN_CALENDAR_H
+
+//#include "main.h"
+#include "pan-item.h"
+#include "pan-types.h"
+
+void pan_calendar_update(PanWindow *pw, PanItem *pi_day);
+void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
+
+#endif
similarity index 99%
rename from src/pan-folder.c
rename to src/pan-view/pan-folder.c
index 995aeea..65ac306 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
-#include "pan-types.h"
+#include "pan-folder.h"
 
 #include <math.h>
 
+#include "pan-item.h"
+#include "pan-util.h"
 
 static void pan_flower_size(PanWindow *pw, gint *width, gint *height)
 {
diff --git a/src/pan-view/pan-folder.h b/src/pan-view/pan-folder.h
new file mode 100644 (file)
index 0000000..e9cc261
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_FOLDER_H
+#define PAN_VIEW_PAN_FOLDER_H
+
+#include "main.h"
+#include "pan-types.h"
+
+void pan_flower_compute(PanWindow *pw, FileData *dir_fd,
+                       gint *width, gint *height,
+                       gint *scroll_x, gint *scroll_y);
+void pan_folder_tree_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
+
+#endif
similarity index 97%
rename from src/pan-grid.c
rename to src/pan-view/pan-grid.c
index 6fbf73f..b441b83 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
-#include "pan-types.h"
+#include "pan-grid.h"
 
 #include <math.h>
 
+#include "pan-item.h"
+#include "pan-util.h"
 
 void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
 {
diff --git a/src/pan-view/pan-grid.h b/src/pan-view/pan-grid.h
new file mode 100644 (file)
index 0000000..a898522
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_GRID_H
+#define PAN_VIEW_PAN_GRID_H
+
+#include "main.h"
+#include "pan-types.h"
+
+void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
+
+#endif
similarity index 99%
rename from src/pan-item.c
rename to src/pan-view/pan-item.c
index 946baa9..636a4ff 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
-#include "pan-types.h"
+#include "pan-item.h"
 
+#include "image.h"
+#include "pixbuf_util.h"
+#include "ui_misc.h"
 
 /*
  *-----------------------------------------------------------------------------
diff --git a/src/pan-view/pan-item.h b/src/pan-view/pan-item.h
new file mode 100644 (file)
index 0000000..2b72f0b
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_ITEM_H
+#define PAN_VIEW_PAN_ITEM_H
+
+#include "main.h"
+#include "pan-types.h"
+#include "pixbuf-renderer.h"
+
+void pan_item_free(PanItem *pi);
+
+void pan_item_set_key(PanItem *pi, const gchar *key);
+void pan_item_added(PanWindow *pw, PanItem *pi);
+void pan_item_remove(PanWindow *pw, PanItem *pi);
+
+// Determine sizes
+void pan_item_size_by_item(PanItem *pi, PanItem *child, gint border);
+void pan_item_size_coordinates(PanItem *pi, gint border, gint *w, gint *h);
+
+// Find items
+PanItem *pan_item_find_by_key(PanWindow *pw, PanItemType type, const gchar *key);
+GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path,
+                            gboolean ignore_case, gboolean partial);
+GList *pan_item_find_by_fd(PanWindow *pw, PanItemType type, FileData *fd,
+                          gboolean ignore_case, gboolean partial);
+PanItem *pan_item_find_by_coord(PanWindow *pw, PanItemType type,
+                               gint x, gint y, const gchar *key);
+
+// Item box type
+PanItem *pan_item_box_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height,
+                         gint border_size,
+                         guint8 base_r, guint8 base_g, guint8 base_b, guint8 base_a,
+                         guint8 bord_r, guint8 bord_g, guint8 bord_b, guint8 bord_a);
+void pan_item_box_shadow(PanItem *pi, gint offset, gint fade);
+gint pan_item_box_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
+                      gint x, gint y, gint width, gint height);
+
+// Item triangle type
+PanItem *pan_item_tri_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height,
+                         gint x1, gint y1, gint x2, gint y2, gint x3, gint y3,
+                         guint8 r, guint8 g, guint8 b, guint8 a);
+void pan_item_tri_border(PanItem *pi, gint borders,
+                        guint8 r, guint8 g, guint8 b, guint8 a);
+gint pan_item_tri_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
+                      gint x, gint y, gint width, gint height);
+
+// Item text type
+PanItem *pan_item_text_new(PanWindow *pw, gint x, gint y, const gchar *text,
+                          PanTextAttrType attr, PanBorderType border,
+                          guint8 r, guint8 g, guint8 b, guint8 a);
+gint pan_item_text_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
+                       gint x, gint y, gint width, gint height);
+
+// Item thumbnail type
+PanItem *pan_item_thumb_new(PanWindow *pw, FileData *fd, gint x, gint y);
+gint pan_item_thumb_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
+                        gint x, gint y, gint width, gint height);
+
+// Item image type
+PanItem *pan_item_image_new(PanWindow *pw, FileData *fd, gint x, gint y, gint w, gint h);
+gint pan_item_image_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
+                        gint x, gint y, gint width, gint height);
+
+// Alignment
+typedef struct _PanTextAlignment PanTextAlignment;
+struct _PanTextAlignment {
+       PanWindow *pw;
+
+       GList *column1;
+       GList *column2;
+
+       gint x;
+       gint y;
+       gchar *key;
+};
+
+PanTextAlignment *pan_text_alignment_new(PanWindow *pw, gint x, gint y, const gchar *key);
+void pan_text_alignment_free(PanTextAlignment *ta);
+
+PanItem *pan_text_alignment_add(PanTextAlignment *ta, const gchar *label, const gchar *text);
+void pan_text_alignment_calc(PanTextAlignment *ta, PanItem *box);
+
+#endif
similarity index 97%
rename from src/pan-timeline.c
rename to src/pan-view/pan-timeline.c
index dcd6ba6..9a96420 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
-#include "pan-types.h"
+#include "pan-timeline.h"
 
+#include "pan-item.h"
+#include "pan-util.h"
+#include "pan-view.h"
 
 void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
 {
diff --git a/src/pan-view/pan-timeline.h b/src/pan-view/pan-timeline.h
new file mode 100644 (file)
index 0000000..7cfba94
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_TIMELINE_H
+#define PAN_VIEW_PAN_TIMELINE_H
+
+#include "main.h"
+#include "pan-types.h"
+
+void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
+
+#endif
similarity index 51%
rename from src/pan-types.h
rename to src/pan-view/pan-types.h
index de114bf..5318b38 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifndef PAN_TYPES_H
-#define PAN_TYPES_H
+#ifndef PAN_VIEW_PAN_TYPES_H
+#define PAN_VIEW_PAN_TYPES_H
 
-#include "cache.h"
 #include "cache-loader.h"
 #include "filedata.h"
-#include "image.h"
-#include "image-load.h"
-#include "pixbuf_util.h"
-#include "pixbuf-renderer.h"
-#include "ui_misc.h"
-
 
 /* thumbnail sizes and spacing */
 
@@ -250,119 +243,5 @@ struct _PanCacheData {
        CacheData *cd;
 };
 
-
-/* pan-view.c */
-
-GList *pan_layout_intersect(PanWindow *pw, gint x, gint y, gint width, gint height);
-void pan_layout_resize(PanWindow *pw);
-
-void pan_cache_sync_date(PanWindow *pw, GList *list);
-
-GList *pan_cache_sort(GList *list, SortType method, gboolean ascend);
-/* pan-item.c */
-
-void pan_item_free(PanItem *pi);
-
-void pan_item_set_key(PanItem *pi, const gchar *key);
-void pan_item_added(PanWindow *pw, PanItem *pi);
-void pan_item_remove(PanWindow *pw, PanItem *pi);
-
-void pan_item_size_by_item(PanItem *pi, PanItem *child, gint border);
-void pan_item_size_coordinates(PanItem *pi, gint border, gint *w, gint *h);
-
-
-PanItem *pan_item_find_by_key(PanWindow *pw, PanItemType type, const gchar *key);
-GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path,
-                            gboolean ignore_case, gboolean partial);
-GList *pan_item_find_by_fd(PanWindow *pw, PanItemType type, FileData *fd,
-                            gboolean ignore_case, gboolean partial);
-PanItem *pan_item_find_by_coord(PanWindow *pw, PanItemType type,
-                               gint x, gint y, const gchar *key);
-
-
-PanItem *pan_item_box_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height,
-                         gint border_size,
-                         guint8 base_r, guint8 base_g, guint8 base_b, guint8 base_a,
-                         guint8 bord_r, guint8 bord_g, guint8 bord_b, guint8 bord_a);
-void pan_item_box_shadow(PanItem *pi, gint offset, gint fade);
-gint pan_item_box_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
-                      gint x, gint y, gint width, gint height);
-
-PanItem *pan_item_tri_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height,
-                         gint x1, gint y1, gint x2, gint y2, gint x3, gint y3,
-                         guint8 r, guint8 g, guint8 b, guint8 a);
-void pan_item_tri_border(PanItem *pi, gint borders,
-                        guint8 r, guint8 g, guint8 b, guint8 a);
-gint pan_item_tri_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
-                      gint x, gint y, gint width, gint height);
-
-PanItem *pan_item_text_new(PanWindow *pw, gint x, gint y, const gchar *text,
-                          PanTextAttrType attr, PanBorderType border,
-                          guint8 r, guint8 g, guint8 b, guint8 a);
-gint pan_item_text_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
-                       gint x, gint y, gint width, gint height);
-
-PanItem *pan_item_thumb_new(PanWindow *pw, FileData *fd, gint x, gint y);
-gint pan_item_thumb_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
-                        gint x, gint y, gint width, gint height);
-
-PanItem *pan_item_image_new(PanWindow *pw, FileData *fd, gint x, gint y, gint w, gint h);
-gint pan_item_image_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
-                        gint x, gint y, gint width, gint height);
-
-
-typedef struct _PanTextAlignment PanTextAlignment;
-struct _PanTextAlignment {
-       PanWindow *pw;
-
-       GList *column1;
-       GList *column2;
-
-       gint x;
-       gint y;
-       gchar *key;
-};
-
-PanTextAlignment *pan_text_alignment_new(PanWindow *pw, gint x, gint y, const gchar *key);
-void pan_text_alignment_free(PanTextAlignment *ta);
-
-PanItem *pan_text_alignment_add(PanTextAlignment *ta, const gchar *label, const gchar *text);
-void pan_text_alignment_calc(PanTextAlignment *ta, PanItem *box);
-
-
-/* utils in pan-util.c */
-
-typedef enum {
-       PAN_DATE_LENGTH_EXACT,
-       PAN_DATE_LENGTH_HOUR,
-       PAN_DATE_LENGTH_DAY,
-       PAN_DATE_LENGTH_WEEK,
-       PAN_DATE_LENGTH_MONTH,
-       PAN_DATE_LENGTH_YEAR
-} PanDateLengthType;
-
-gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length);
-gint pan_date_value(time_t d, PanDateLengthType length);
-gchar *pan_date_value_string(time_t d,  PanDateLengthType length);
-time_t pan_date_to_time(gint year, gint month, gint day);
-
-gboolean pan_is_link_loop(const gchar *s);
-gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks);
-GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend,
-                    gboolean ignore_symlinks);
-
-
-/* the different view types */
-
-void pan_calendar_update(PanWindow *pw, PanItem *pi_day);
-void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
-void pan_flower_compute(PanWindow *pw, FileData *dir_fd,
-                       gint *width, gint *height,
-                       gint *scroll_x, gint *scroll_y);
-void pan_folder_tree_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
-void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
-void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height);
-
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
similarity index 99%
rename from src/pan-util.c
rename to src/pan-view/pan-util.c
index 3e20794..14eb238 100644 (file)
@@ -19,8 +19,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
-#include "pan-types.h"
+#include "pan-util.h"
 
 #include "ui_fileops.h"
 
diff --git a/src/pan-view/pan-util.h b/src/pan-view/pan-util.h
new file mode 100644 (file)
index 0000000..b700c81
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_UTIL_H
+#define PAN_VIEW_PAN_UTIL_H
+
+#include "main.h"
+#include "pan-types.h"
+
+typedef enum {
+       PAN_DATE_LENGTH_EXACT,
+       PAN_DATE_LENGTH_HOUR,
+       PAN_DATE_LENGTH_DAY,
+       PAN_DATE_LENGTH_WEEK,
+       PAN_DATE_LENGTH_MONTH,
+       PAN_DATE_LENGTH_YEAR
+} PanDateLengthType;
+
+gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length);
+gint pan_date_value(time_t d, PanDateLengthType length);
+gchar *pan_date_value_string(time_t d,  PanDateLengthType length);
+time_t pan_date_to_time(gint year, gint month, gint day);
+
+gboolean pan_is_link_loop(const gchar *s);
+gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks);
+GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend,
+                    gboolean ignore_symlinks);
+
+#endif
similarity index 99%
rename from src/pan-view.c
rename to src/pan-view/pan-view.c
index 7640e60..a75424d 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "main.h"
 #include "pan-view.h"
 
 #include "bar_exif.h"
 #include "dnd.h"
 #include "editors.h"
 #include "exif.h"
-#include "metadata.h"
 #include "fullscreen.h"
 #include "history_list.h"
+#include "image.h"
 #include "img-view.h"
 #include "menu.h"
+#include "metadata.h"
 #include "misc.h"
-#include "pan-types.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 "pixbuf-renderer.h"
+#include "pixbuf_util.h"
 #include "thumb.h"
 #include "ui_fileops.h"
 #include "ui_menu.h"
+#include "ui_misc.h"
 #include "ui_tabcomp.h"
 #include "ui_utildlg.h"
 #include "uri_utils.h"
diff --git a/src/pan-view/pan-view.h b/src/pan-view/pan-view.h
new file mode 100644 (file)
index 0000000..7a7ddc7
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: John Ellis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PAN_VIEW_PAN_VIEW_H
+#define PAN_VIEW_PAN_VIEW_H
+
+#include "main.h"
+#include "pan-types.h"
+
+GList *pan_layout_intersect(PanWindow *pw, gint x, gint y, gint width, gint height);
+void pan_layout_resize(PanWindow *pw);
+
+void pan_cache_sync_date(PanWindow *pw, GList *list);
+
+GList *pan_cache_sort(GList *list, SortType method, gboolean ascend);
+
+
+#endif
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 509e018..e80ec2e 100644 (file)
@@ -157,6 +157,31 @@ gboolean read_int_option(const gchar *option, const gchar *label, const gchar *v
        return TRUE;
 }
 
+void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n)
+{
+       g_string_append_printf(str, "%s = \"%uh\" ", label, n);
+}
+
+gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n)
+{
+       if (g_ascii_strcasecmp(option, label) != 0) return FALSE;
+       if (!n) return FALSE;
+
+       if (g_ascii_isdigit(value[0]))
+               {
+               *n = strtoul(value, NULL, 10);
+               }
+       else
+               {
+               if (g_ascii_strcasecmp(value, "true") == 0)
+                       *n = 1;
+               else
+                       *n = 0;
+               }
+
+       return TRUE;
+}
+
 void write_uint_option(GString *str, gint indent, const gchar *label, guint n)
 {
        g_string_append_printf(str, "%s = \"%u\" ", label, n);
@@ -644,14 +669,14 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                if (READ_CHAR(*options, image_overlay.template_string)) continue;
                if (READ_INT(*options, image_overlay.x)) continue;
                if (READ_INT(*options, image_overlay.y)) continue;
-               if (READ_INT(*options, image_overlay.text_red)) continue;
-               if (READ_INT(*options, image_overlay.text_green)) continue;
-               if (READ_INT(*options, image_overlay.text_blue)) continue;
-               if (READ_INT(*options, image_overlay.text_alpha)) continue;
-               if (READ_INT(*options, image_overlay.background_red)) continue;
-               if (READ_INT(*options, image_overlay.background_green)) continue;
-               if (READ_INT(*options, image_overlay.background_blue)) continue;
-               if (READ_INT(*options, image_overlay.background_alpha)) continue;
+               if (READ_USHORT(*options, image_overlay.text_red)) continue;
+               if (READ_USHORT(*options, image_overlay.text_green)) continue;
+               if (READ_USHORT(*options, image_overlay.text_blue)) continue;
+               if (READ_USHORT(*options, image_overlay.text_alpha)) continue;
+               if (READ_USHORT(*options, image_overlay.background_red)) continue;
+               if (READ_USHORT(*options, image_overlay.background_green)) continue;
+               if (READ_USHORT(*options, image_overlay.background_blue)) continue;
+               if (READ_USHORT(*options, image_overlay.background_alpha)) continue;
                if (READ_CHAR(*options, image_overlay.font)) continue;
 
                /* Slideshow options */
index 944e1d2..ae53e1c 100644 (file)
@@ -31,6 +31,8 @@ void write_color_option(GString *str, gint indent, gchar *label, GdkColor *color
 gboolean read_color_option(const gchar *option, const gchar *label, const gchar *value, GdkColor *color);
 void write_int_option(GString *str, gint indent, const gchar *label, gint n);
 gboolean read_int_option(const gchar *option, const gchar *label, const gchar *value, gint *n);
+void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n);
+gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n);
 void write_uint_option(GString *str, gint indent, const gchar *label, guint n);
 gboolean read_uint_option(const gchar *option, const gchar *label, const gchar *value, guint *n);
 gboolean read_uint_option_clamp(const gchar *option, const gchar *label, const gchar *value, guint *n, guint min, guint max);
@@ -54,6 +56,7 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 #define READ_BOOL(_target_, _name_) read_bool_option(option, #_name_, value, &(_target_)._name_)
 #define READ_INT(_target_, _name_) read_int_option(option, #_name_, value, &(_target_)._name_)
 #define READ_UINT(_target_, _name_) read_uint_option(option, #_name_, value, &(_target_)._name_)
+#define READ_USHORT(_target_, _name_) read_ushort_option(option, #_name_, value, &(_target_)._name_)
 #define READ_INT_CLAMP(_target_, _name_, _min_, _max_) read_int_option_clamp(option, #_name_, value, &(_target_)._name_, _min_, _max_)
 #define READ_UINT_CLAMP(_target_, _name_, _min_, _max_) read_uint_option_clamp(option, #_name_, value, &(_target_)._name_, _min_, _max_)
 #define READ_INT_UNIT(_target_, _name_, _unit_) read_int_unit_option(option, #_name_, value, &(_target_)._name_, _unit_)
index da40981..2472594 100644 (file)
@@ -22,6 +22,8 @@
 #include "view_file.h"
 
 #include "dupe.h"
+#include "collect.h"
+#include "collect-table.h"
 #include "editors.h"
 #include "layout.h"
 #include "menu.h"