annotate src/pan-timeline.c @ 205:31f4adaf8f8a

updated README files
author nadvornik
date Wed, 26 Mar 2008 08:02:45 +0000
parents f6e307c7bad6
children 9995c5fb202a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 138
diff changeset
2 * Geeqie
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
3 * (C) 2006 John Ellis
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
4 *
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
5 * Author: John Ellis
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
6 *
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
7 * This software is released under the GNU General Public License (GNU GPL).
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
8 * Please read the included file COPYING for more information.
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
9 * This software comes with no warranty of any kind, use at your own risk!
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
10 */
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
11
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
12
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
13 #include "gqview.h"
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
14 #include "pan-types.h"
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
15
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
16
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
17 void pan_timeline_compute(PanWindow *pw, const gchar *path, gint *width, gint *height)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
18 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
19 GList *list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
20 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
21 gint x, y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
22 time_t tc;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
23 gint total;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
24 gint count;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
25 PanItem *pi_month = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
26 PanItem *pi_day = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
27 gint month_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
28 gint day_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
29 gint x_width;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
30 gint y_height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
31
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
32 list = pan_list_tree(path, SORT_NONE, TRUE, pw->ignore_symlinks);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
33
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
34 if (pw->cache_list && pw->exif_date_enable)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
35 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 105
diff changeset
36 pw->cache_list = pan_cache_sort(pw->cache_list, SORT_NAME, TRUE);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
37 list = filelist_sort(list, SORT_NAME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
38 pan_cache_sync_date(pw, list);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
39 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
40
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 105
diff changeset
41 pw->cache_list = pan_cache_sort(pw->cache_list, SORT_TIME, TRUE);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
42 list = filelist_sort(list, SORT_TIME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
43
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
44 *width = PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
45 *height = PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
46
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
47 x = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
48 y = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
49 month_start = y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
50 day_start = month_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
51 x_width = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
52 y_height = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
53 tc = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
54 total = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
55 count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
56 work = list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
57 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
58 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
59 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
60 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
61
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
62 fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
63 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
64
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
65 if (!pan_date_compare(fd->date, tc, PAN_DATE_LENGTH_DAY))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
66 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
67 GList *needle;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
68 gchar *buf;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
69
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
70 if (!pan_date_compare(fd->date, tc, PAN_DATE_LENGTH_MONTH))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
71 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
72 pi_day = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
73
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
74 if (pi_month)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
75 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
76 x = pi_month->x + pi_month->width + PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
77 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
78 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
79 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
80 x = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
81 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
82
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
83 y = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
84
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
85 buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_MONTH);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
86 pi = pan_item_text_new(pw, x, y, buf,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
87 PAN_TEXT_ATTR_BOLD | PAN_TEXT_ATTR_HEADING,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
88 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
89 PAN_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
90 g_free(buf);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
91 y += pi->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
92
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
93 pi_month = pan_item_box_new(pw, file_data_new_simple(fd->path),
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
94 x, y, 0, 0,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
95 PAN_BOX_OUTLINE_THICKNESS,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
96 PAN_BOX_COLOR, PAN_BOX_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
97 PAN_BOX_OUTLINE_COLOR, PAN_BOX_OUTLINE_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
98
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
99 x += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
100 y += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
101 month_start = y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
102 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
103
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
104 if (pi_day) x = pi_day->x + pi_day->width + PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
106 tc = fd->date;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
107 total = 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
108 count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
109
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
110 needle = work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
111 while (needle)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
112 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
113 FileData *nfd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
114
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
115 nfd = needle->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
116 if (pan_date_compare(nfd->date, tc, PAN_DATE_LENGTH_DAY))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
117 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
118 needle = needle->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
119 total++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
120 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
121 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
122 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
123 needle = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
124 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
125 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
126
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
127 buf = pan_date_value_string(fd->date, PAN_DATE_LENGTH_WEEK);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
128 pi = pan_item_text_new(pw, x, y, buf, PAN_TEXT_ATTR_NONE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
129 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
130 PAN_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
131 g_free(buf);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
132
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
133 y += pi->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
134
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
135 pi_day = pan_item_box_new(pw, file_data_new_simple(fd->path), x, y, 0, 0,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
136 PAN_BOX_OUTLINE_THICKNESS,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
137 PAN_BOX_COLOR, PAN_BOX_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
138 PAN_BOX_OUTLINE_COLOR, PAN_BOX_OUTLINE_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
139
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
140 x += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
141 y += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
142 day_start = y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
143 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
144
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
145 if (pw->size > PAN_IMAGE_SIZE_THUMB_LARGE)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
146 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
147 pi = pan_item_image_new(pw, fd, x, y, 10, 10);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
148 if (pi->width > x_width) x_width = pi->width;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
149 y_height = pi->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
150 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
151 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
152 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
153 pi = pan_item_thumb_new(pw, fd, x, y);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
154 x_width = PAN_THUMB_SIZE;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
155 y_height = PAN_THUMB_SIZE;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
156 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
157
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
158 pan_item_size_by_item(pi_day, pi, PAN_BOX_BORDER);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
159 pan_item_size_by_item(pi_month, pi_day, PAN_BOX_BORDER);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
160
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
161 total--;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
162 count++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
163
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
164 if (total > 0 && count < PAN_GROUP_MAX)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
165 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
166 y += y_height + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
167 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
168 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
169 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
170 x += x_width + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
171 x_width = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
172 count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
173
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
174 if (total > 0)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
175 y = day_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
176 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
177 y = month_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
178 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
179
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
180 pan_item_size_coordinates(pi_month, PAN_BOX_BORDER, width, height);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
181 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
182
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
183 g_list_free(list);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
184 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
185