annotate src/pan-calendar.c @ 442:4b2d7f9af171

Big whitespaces cleanup: - drop whitespaces at end of lines - convert eight spaces to tab at start of lines - drop spurious spaces mixed with tabs - remove empty lines at end of files
author zas_
date Sun, 20 Apr 2008 13:04:57 +0000
parents 8cecb9695d28
children ddabc4873a3f
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
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 196
diff changeset
13 #include "main.h"
105
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 #include <math.h>
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
17
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 #define PAN_CAL_POPUP_COLOR 220, 220, 220
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
20 #define PAN_CAL_POPUP_ALPHA 255
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
21 #define PAN_CAL_POPUP_BORDER 1
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
22 #define PAN_CAL_POPUP_BORDER_COLOR 0, 0, 0
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
23 #define PAN_CAL_POPUP_TEXT_COLOR 0, 0, 0
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
24
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
25 #define PAN_CAL_DAY_WIDTH 100
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
26 #define PAN_CAL_DAY_HEIGHT 80
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
27
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
28 #define PAN_CAL_DAY_COLOR 255, 255, 255
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
29 #define PAN_CAL_DAY_ALPHA 220
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
30 #define PAN_CAL_DAY_BORDER 2
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
31 #define PAN_CAL_DAY_BORDER_COLOR 0, 0, 0
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
32 #define PAN_CAL_DAY_TEXT_COLOR 0, 0, 0
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 #define PAN_CAL_MONTH_COLOR 255, 255, 255
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
35 #define PAN_CAL_MONTH_ALPHA 200
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
36 #define PAN_CAL_MONTH_BORDER 4
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
37 #define PAN_CAL_MONTH_BORDER_COLOR 0, 0, 0
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
38 #define PAN_CAL_MONTH_TEXT_COLOR 0, 0, 0
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 #define PAN_CAL_DOT_SIZE 3
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
41 #define PAN_CAL_DOT_GAP 2
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
42 #define PAN_CAL_DOT_COLOR 128, 128, 128
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
43 #define PAN_CAL_DOT_ALPHA 128
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
44
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
45
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 *-----------------------------------------------------------------------------
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
48 * calendar
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
49 *-----------------------------------------------------------------------------
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
50 */
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
51
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
52 void pan_calendar_update(PanWindow *pw, PanItem *pi_day)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
53 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
54 PanItem *pbox;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
55 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
56 GList *list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
57 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
58 gint x1, y1, x2, y2, x3, y3;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
59 gint x, y, w, h;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
60 gint grid;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
61 gint column;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
62
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
63 while ((pi = pan_item_find_by_key(pw, PAN_ITEM_NONE, "day_bubble"))) pan_item_remove(pw, pi);
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 (!pi_day || pi_day->type != PAN_ITEM_BOX ||
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
66 !pi_day->key || strcmp(pi_day->key, "day") != 0) return;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
67
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
68 list = pan_layout_intersect(pw, pi_day->x, pi_day->y, pi_day->width, pi_day->height);
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 work = list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
71 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
72 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
73 PanItem *dot;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
74 GList *node;
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 dot = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
77 node = work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
78 work = work->next;
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 if (dot->type != PAN_ITEM_BOX || !dot->fd ||
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
81 !dot->key || strcmp(dot->key, "dot") != 0)
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 list = g_list_delete_link(list, node);
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 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
86
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
87 #if 0
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
88 if (!list) return;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
89 #endif
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
90
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
91 grid = (gint)(sqrt(g_list_length(list)) + 0.5);
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 x = pi_day->x + pi_day->width + 4;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
94 y = pi_day->y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
95
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
96 #if 0
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
97 if (y + grid * (PAN_THUMB_SIZE + PAN_THUMB_GAP) + PAN_BOX_BORDER * 4 > pw->pr->image_height)
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 y = pw->pr->image_height - (grid * (PAN_THUMB_SIZE + PAN_THUMB_GAP) + PAN_BOX_BORDER * 4);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
100 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
101 #endif
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 pbox = pan_item_box_new(pw, NULL, x, y, PAN_BOX_BORDER, PAN_BOX_BORDER,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
104 PAN_CAL_POPUP_BORDER,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
105 PAN_CAL_POPUP_COLOR, PAN_CAL_POPUP_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
106 PAN_CAL_POPUP_BORDER_COLOR, PAN_CAL_POPUP_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
107 pan_item_set_key(pbox, "day_bubble");
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
108
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
109 if (pi_day->fd)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
110 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
111 PanItem *plabel;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
112 gchar *buf;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
113
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
114 buf = pan_date_value_string(pi_day->fd->date, PAN_DATE_LENGTH_WEEK);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
115 plabel = pan_item_text_new(pw, x, y, buf, 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
116 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
117 PAN_CAL_POPUP_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
118 pan_item_set_key(plabel, "day_bubble");
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
119 g_free(buf);
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 pan_item_size_by_item(pbox, plabel, 0);
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 y += plabel->height;
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 if (list)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
127 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
128 column = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
129
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
130 x += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
131 y += PAN_BOX_BORDER;
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 work = list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
134 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
135 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
136 PanItem *dot;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
137
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
138 dot = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
139 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
140
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
141 if (dot->fd)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
142 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
143 PanItem *pimg;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
144
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 105
diff changeset
145 pimg = pan_item_thumb_new(pw, file_data_ref(dot->fd), x, y);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
146 pan_item_set_key(pimg, "day_bubble");
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
147
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
148 pan_item_size_by_item(pbox, pimg, PAN_BOX_BORDER);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
149
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
150 column++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
151 if (column < grid)
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 x += PAN_THUMB_SIZE + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
154 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
155 else
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 column = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
158 x = pbox->x + PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
159 y += PAN_THUMB_SIZE + PAN_THUMB_GAP;
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 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
162 }
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
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
165 x1 = pi_day->x + pi_day->width - 8;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
166 y1 = pi_day->y + 8;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
167 x2 = pbox->x + 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
168 y2 = pbox->y + MIN(42, pbox->height);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
169 x3 = pbox->x + 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
170 y3 = MAX(pbox->y, y2 - 30);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
171 util_clip_triangle(x1, y1, x2, y2, x3, y3,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
172 &x, &y, &w, &h);
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 pi = pan_item_tri_new(pw, NULL, x, y, w, h,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
175 x1, y1, x2, y2, x3, y3,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
176 PAN_CAL_POPUP_COLOR, PAN_CAL_POPUP_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
177 pan_item_tri_border(pi, PAN_BORDER_1 | PAN_BORDER_3, PAN_CAL_POPUP_BORDER_COLOR, PAN_CAL_POPUP_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
178 pan_item_set_key(pi, "day_bubble");
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
179 pan_item_added(pw, pi);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
180
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
181 pan_item_box_shadow(pbox, PAN_SHADOW_OFFSET * 2, PAN_SHADOW_FADE * 2);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
182 pan_item_added(pw, pbox);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
183
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
184 pan_layout_resize(pw);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
185 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
186
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
187 void pan_calendar_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
188 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
189 GList *list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
190 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
191 gint x, y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
192 time_t tc;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
193 gint count;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
194 gint day_max;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
195 gint day_width;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
196 gint day_height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
197 gint grid;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
198 gint year = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
199 gint month = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
200 gint end_year = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
201 gint end_month = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
202
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
203 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
204
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
205 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
206 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 105
diff changeset
207 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
208 list = filelist_sort(list, SORT_NAME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
209 pan_cache_sync_date(pw, list);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
210 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
211
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 105
diff changeset
212 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
213 list = filelist_sort(list, SORT_TIME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
214
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
215 day_max = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
216 count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
217 tc = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
218 work = list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
219 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
220 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
221 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
222
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
223 fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
224 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
225
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
226 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
227 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
228 count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
229 tc = fd->date;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
230 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
231 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
232 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
233 count++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
234 if (day_max < count) day_max = count;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
235 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
236 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
237
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
238 if (debug) printf("biggest day contains %d images\n", day_max);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
239
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
240 grid = (gint)(sqrt((double)day_max) + 0.5) * (PAN_THUMB_SIZE + PAN_SHADOW_OFFSET * 2 + PAN_THUMB_GAP);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
241 day_width = MAX(PAN_CAL_DAY_WIDTH, grid);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
242 day_height = MAX(PAN_CAL_DAY_HEIGHT, grid);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
243
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
244 if (list)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
245 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
246 FileData *fd = list->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
247
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
248 year = pan_date_value(fd->date, PAN_DATE_LENGTH_YEAR);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
249 month = pan_date_value(fd->date, PAN_DATE_LENGTH_MONTH);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
250 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
251
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
252 work = g_list_last(list);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
253 if (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
254 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
255 FileData *fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
256 end_year = pan_date_value(fd->date, PAN_DATE_LENGTH_YEAR);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
257 end_month = pan_date_value(fd->date, PAN_DATE_LENGTH_MONTH);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
258 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
259
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
260 *width = PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
261 *height = PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
262
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
263 x = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
264 y = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
265
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
266 work = list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
267 while (work && (year < end_year || (year == end_year && month <= end_month)))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
268 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
269 PanItem *pi_month;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
270 PanItem *pi_text;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
271 gint day;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
272 gint days;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
273 gint col;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
274 gint row;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
275 time_t dt;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
276 gchar *buf;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
277
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
278 /* figure last second of this month */
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
279 dt = pan_date_to_time((month == 12) ? year + 1 : year, (month == 12) ? 1 : month + 1, 1);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
280 dt -= 60 * 60 * 24;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
281
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
282 /* anything to show this month? */
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
283 if (!pan_date_compare(((FileData *)(work->data))->date, dt, PAN_DATE_LENGTH_MONTH))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
284 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
285 month ++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
286 if (month > 12)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
287 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
288 year++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
289 month = 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
290 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
291 continue;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
292 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
293
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
294 days = pan_date_value(dt, PAN_DATE_LENGTH_DAY);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
295 dt = pan_date_to_time(year, month, 1);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
296 col = pan_date_value(dt, PAN_DATE_LENGTH_WEEK);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
297 row = 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
298
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
299 x = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
300
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
301 pi_month = pan_item_box_new(pw, NULL, x, y, PAN_CAL_DAY_WIDTH * 7, PAN_CAL_DAY_HEIGHT / 4,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
302 PAN_CAL_MONTH_BORDER,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
303 PAN_CAL_MONTH_COLOR, PAN_CAL_MONTH_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
304 PAN_CAL_MONTH_BORDER_COLOR, PAN_CAL_MONTH_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
305 buf = pan_date_value_string(dt, PAN_DATE_LENGTH_MONTH);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
306 pi_text = 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
307 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
308 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
309 PAN_CAL_MONTH_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
310 g_free(buf);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
311 pi_text->x = pi_month->x + (pi_month->width - pi_text->width) / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
312
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
313 pi_month->height = pi_text->y + pi_text->height - pi_month->y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
314
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
315 x = PAN_BOX_BORDER + col * PAN_CAL_DAY_WIDTH;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
316 y = pi_month->y + pi_month->height + PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
317
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
318 for (day = 1; day <= days; day++)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
319 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
320 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
321 PanItem *pi_day;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
322 gint dx, dy;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
323 gint n = 0;
301
8cecb9695d28 fixed dates in pan-calendar
nadvornik
parents: 291
diff changeset
324 char fake_path[20];
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
325
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
326 dt = pan_date_to_time(year, month, day);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
327
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
328 /*
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
329 * Create a FileData entry that represents the given day.
301
8cecb9695d28 fixed dates in pan-calendar
nadvornik
parents: 291
diff changeset
330 * It does not correspond to any real file
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
331 */
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
332
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 301
diff changeset
333 g_snprintf(fake_path, sizeof(fake_path), "//%04d-%02d-%02d", year, month, day);
301
8cecb9695d28 fixed dates in pan-calendar
nadvornik
parents: 291
diff changeset
334 fd = file_data_new_simple(fake_path);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
335 fd->date = dt;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
336 pi_day = pan_item_box_new(pw, fd, x, y, PAN_CAL_DAY_WIDTH, PAN_CAL_DAY_HEIGHT,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
337 PAN_CAL_DAY_BORDER,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
338 PAN_CAL_DAY_COLOR, PAN_CAL_DAY_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
339 PAN_CAL_DAY_BORDER_COLOR, PAN_CAL_DAY_ALPHA);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
340 pan_item_set_key(pi_day, "day");
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
341
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
342 dx = x + PAN_CAL_DOT_GAP * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
343 dy = y + PAN_CAL_DOT_GAP * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
344
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
345 fd = (work) ? work->data : NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
346 while (fd && pan_date_compare(fd->date, dt, PAN_DATE_LENGTH_DAY))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
347 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
348 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
349
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
350 pi = pan_item_box_new(pw, fd, dx, dy, PAN_CAL_DOT_SIZE, PAN_CAL_DOT_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
351 0,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
352 PAN_CAL_DOT_COLOR, PAN_CAL_DOT_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
353 0, 0, 0, 0);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
354 pan_item_set_key(pi, "dot");
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
355
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
356 dx += PAN_CAL_DOT_SIZE + PAN_CAL_DOT_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
357 if (dx + PAN_CAL_DOT_SIZE > pi_day->x + pi_day->width - PAN_CAL_DOT_GAP * 2)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
358 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
359 dx = x + PAN_CAL_DOT_GAP * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
360 dy += PAN_CAL_DOT_SIZE + PAN_CAL_DOT_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
361 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
362 if (dy + PAN_CAL_DOT_SIZE > pi_day->y + pi_day->height - PAN_CAL_DOT_GAP * 2)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
363 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
364 /* must keep all dots within respective day even if it gets ugly */
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
365 dy = y + PAN_CAL_DOT_GAP * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
366 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
367
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
368 n++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
369
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
370 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
371 fd = (work) ? work->data : NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
372 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
373
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
374 if (n > 0)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
375 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
376 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
377
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
378 pi_day->color_r = MAX(pi_day->color_r - 61 - n * 3, 80);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
379 pi_day->color_g = pi_day->color_r;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
380
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
381 buf = g_strdup_printf("( %d )", n);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
382 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
383 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
384 PAN_CAL_DAY_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
385 g_free(buf);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
386
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
387 pi->x = pi_day->x + (pi_day->width - pi->width) / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
388 pi->y = pi_day->y + (pi_day->height - pi->height) / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
389 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
390
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
391 buf = g_strdup_printf("%d", day);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
392 pan_item_text_new(pw, x + 4, y + 4, buf, 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
393 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
394 PAN_CAL_DAY_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
395 g_free(buf);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
396
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
397
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
398 pan_item_size_coordinates(pi_day, PAN_BOX_BORDER, width, height);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
399
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
400 col++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
401 if (col > 6)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
402 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
403 col = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
404 row++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
405 x = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
406 y += PAN_CAL_DAY_HEIGHT;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
407 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
408 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
409 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
410 x += PAN_CAL_DAY_WIDTH;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
411 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
412 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
413
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
414 if (col > 0) y += PAN_CAL_DAY_HEIGHT;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
415 y += PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
416
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
417 month ++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
418 if (month > 12)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
419 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
420 year++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
421 month = 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
422 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
423 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
424
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
425 *width += grid;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
426 *height = MAX(*height, grid + PAN_BOX_BORDER * 2 * 2);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
427
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
428 g_list_free(list);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
429 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
430
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
431