annotate src/pan-folder.c @ 1697:219e1ba3ae30

Fix a overrun data_offset + data_length could be bigger than guint which makes the calculation overflow to a value smaller then size.
author mow
date Sat, 18 Jul 2009 08:16:54 +0000
parents b106af9689db
children 956aab097ea7
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: 105
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
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1055
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
5 *
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
6 * Author: John Ellis
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
7 *
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
8 * 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
9 * 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
10 * 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
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
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 196
diff changeset
14 #include "main.h"
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
15 #include "pan-types.h"
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 #include <math.h>
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
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
20 static void pan_flower_size(PanWindow *pw, gint *width, gint *height)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
21 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
22 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
23 gint x1, y1, x2, y2;
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 x1 = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
26 y1 = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
27 x2 = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
28 y2 = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
29
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
30 work = pw->list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
31 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
32 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
33 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
34
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
35 pi = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
36 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
37
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
38 if (x1 > pi->x) x1 = pi->x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
39 if (y1 > pi->y) y1 = pi->y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
40 if (x2 < pi->x + pi->width) x2 = pi->x + pi->width;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
41 if (y2 < pi->y + pi->height) y2 = pi->y + pi->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
42 }
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 x1 -= PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
45 y1 -= PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
46 x2 += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
47 y2 += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
48
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
49 work = pw->list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
50 while (work)
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 PanItem *pi;
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 pi = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
55 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
56
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
57 pi->x -= x1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
58 pi->y -= y1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
59
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
60 if (pi->type == PAN_ITEM_TRIANGLE && pi->data)
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 gint *coord;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
63
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
64 coord = pi->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
65 coord[0] -= x1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
66 coord[1] -= y1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
67 coord[2] -= x1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
68 coord[3] -= y1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
69 coord[4] -= x1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
70 coord[5] -= y1;
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 }
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 (width) *width = x2 - x1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
75 if (height) *height = y2 - y1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
76 }
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 typedef struct _FlowerGroup FlowerGroup;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
79 struct _FlowerGroup {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
80 GList *items;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
81 GList *children;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
82 gint x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
83 gint y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
84 gint width;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
85 gint height;
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 gdouble angle;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
88 gint circumference;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
89 gint diameter;
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
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
92 static void pan_flower_move(FlowerGroup *group, gint x, gint y)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
93 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
94 GList *work;
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 work = group->items;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
97 while (work)
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 PanItem *pi;
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 pi = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
102 work = work->next;
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 pi->x += x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
105 pi->y += y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
106 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
107
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
108 group->x += x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
109 group->y += y;
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
1434
b106af9689db More gboolean.
zas_
parents: 1284
diff changeset
112 #define PI 3.14159265
105
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 static void pan_flower_position(FlowerGroup *group, FlowerGroup *parent,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
115 gint *result_x, gint *result_y)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
116 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
117 gint x, y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
118 gint radius;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
119 gdouble a;
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 radius = parent->circumference / (2*PI);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
122 radius = MAX(radius, parent->diameter / 2 + group->diameter / 2);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
123
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
124 a = 2*PI * group->diameter / parent->circumference;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
125
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 875
diff changeset
126 x = (gint)((gdouble)radius * cos(parent->angle + a / 2));
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 875
diff changeset
127 y = (gint)((gdouble)radius * sin(parent->angle + a / 2));
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
128
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
129 parent->angle += a;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
130
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
131 x += parent->x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
132 y += parent->y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
133
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
134 x += parent->width / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
135 y += parent->height / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
136
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
137 x -= group->width / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
138 y -= group->height / 2;
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 *result_x = x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
141 *result_y = y;
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
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
144 static void pan_flower_build(PanWindow *pw, FlowerGroup *group, FlowerGroup *parent)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
145 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
146 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
147 gint x, y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
148
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
149 if (!group) return;
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 if (parent && parent->children)
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 pan_flower_position(group, parent, &x, &y);
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 x = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
158 y = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
159 }
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 pan_flower_move(group, x, y);
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 if (parent)
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 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
166 gint px, py, gx, gy;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
167 gint x1, y1, x2, y2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
168
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
169 px = parent->x + parent->width / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
170 py = parent->y + parent->height / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
171
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
172 gx = group->x + group->width / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
173 gy = group->y + group->height / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
174
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
175 x1 = MIN(px, gx);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
176 y1 = MIN(py, gy);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
177
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
178 x2 = MAX(px, gx + 5);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
179 y2 = MAX(py, gy + 5);
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 pi = pan_item_tri_new(pw, NULL, x1, y1, x2 - x1, y2 - y1,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
182 px, py, gx, gy, gx + 5, gy + 5,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
183 255, 40, 40, 128);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
184 pan_item_tri_border(pi, PAN_BORDER_1 | PAN_BORDER_3,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
185 255, 0, 0, 128);
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
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
188 pw->list = g_list_concat(group->items, pw->list);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
189 group->items = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
190
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
191 group->circumference = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
192 work = group->children;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
193 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
194 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
195 FlowerGroup *child;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
196
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
197 child = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
198 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
199
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
200 group->circumference += child->diameter;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
201 }
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 work = g_list_last(group->children);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
204 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
205 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
206 FlowerGroup *child;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
207
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
208 child = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
209 work = work->prev;
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 pan_flower_build(pw, child, group);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
212 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
213
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
214 g_list_free(group->children);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
215 g_free(group);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
216 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
217
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
218 static FlowerGroup *pan_flower_group(PanWindow *pw, FileData *dir_fd, gint x, gint y)
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
219 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
220 FlowerGroup *group;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
221 GList *f;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
222 GList *d;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
223 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
224 PanItem *pi_box;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
225 gint x_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
226 gint y_height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
227 gint grid_size;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
228 gint grid_count;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
229
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
230 if (!filelist_read(dir_fd, &f, &d)) return NULL;
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
231 if (!f && !d) return NULL;
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 f = filelist_sort(f, SORT_NAME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
234 d = filelist_sort(d, SORT_NAME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
235
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
236 pi_box = pan_item_text_new(pw, x, y, dir_fd->path, PAN_TEXT_ATTR_NONE,
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
237 PAN_TEXT_BORDER_SIZE,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
238 PAN_TEXT_COLOR, 255);
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 y += pi_box->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
241
875
f103af877504 Fix missing references for the current directory in pan folder stuff.
zas_
parents: 783
diff changeset
242 pi_box = pan_item_box_new(pw, file_data_ref(dir_fd),
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
243 x, y,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
244 PAN_BOX_BORDER * 2, PAN_BOX_BORDER * 2,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
245 PAN_BOX_OUTLINE_THICKNESS,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
246 PAN_BOX_COLOR, PAN_BOX_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
247 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
248
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
249 x += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
250 y += PAN_BOX_BORDER;
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 grid_size = (gint)(sqrt(g_list_length(f)) + 0.9);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
253 grid_count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
254 x_start = x;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
255 y_height = y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
256
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
257 work = f;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
258 while (work)
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 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
261 PanItem *pi;
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 fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
264 work = work->next;
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 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
267 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
268 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
269 x += pi->width + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
270 if (pi->height > y_height) y_height = pi->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
271 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
272 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
273 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
274 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
275 x += PAN_THUMB_SIZE + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
276 y_height = PAN_THUMB_SIZE;
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
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
279 grid_count++;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
280 if (grid_count >= grid_size)
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 grid_count = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
283 x = x_start;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
284 y += y_height + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
285 y_height = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
286 }
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 pan_item_size_by_item(pi_box, pi, PAN_BOX_BORDER);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
289 }
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 group = g_new0(FlowerGroup, 1);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
292 group->items = pw->list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
293 pw->list = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
294
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
295 group->width = pi_box->width;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
296 group->height = pi_box->y + pi_box->height;
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 875
diff changeset
297 group->diameter = (gint)sqrt(group->width * group->width + group->height * group->height);
105
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 group->children = NULL;
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 work = d;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
302 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
303 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
304 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
305 FlowerGroup *child;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
306
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
307 fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
308 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
309
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
310 if (!pan_is_ignored(fd->path, pw->ignore_symlinks))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
311 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
312 child = pan_flower_group(pw, fd, 0, 0);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
313 if (child) group->children = g_list_prepend(group->children, child);
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 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
316
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
317 if (!f && !group->children)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
318 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
319 work = group->items;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
320 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
321 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
322 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
323
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
324 pi = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
325 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
326
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
327 pan_item_free(pi);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
328 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
329
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
330 g_list_free(group->items);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
331 g_free(group);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
332 group = NULL;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
333 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
334
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
335 g_list_free(f);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
336 filelist_free(d);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
337
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
338 return group;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
339 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
340
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
341 void pan_flower_compute(PanWindow *pw, FileData *dir_fd,
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
342 gint *width, gint *height,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
343 gint *scroll_x, gint *scroll_y)
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 FlowerGroup *group;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
346 GList *list;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
347
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
348 group = pan_flower_group(pw, dir_fd, 0, 0);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
349 pan_flower_build(pw, group, NULL);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
350
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
351 pan_flower_size(pw, width, height);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
352
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
353 list = pan_item_find_by_fd(pw, PAN_ITEM_BOX, dir_fd, FALSE, FALSE);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
354 if (list)
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 PanItem *pi = list->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
357 *scroll_x = pi->x + pi->width / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
358 *scroll_y = pi->y + pi->height / 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
359 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
360 g_list_free(list);
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
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
363 static void pan_folder_tree_path(PanWindow *pw, FileData *dir_fd,
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
364 gint *x, gint *y, gint *level,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
365 PanItem *parent,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
366 gint *width, gint *height)
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 GList *f;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
369 GList *d;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
370 GList *work;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
371 PanItem *pi_box;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
372 gint y_height = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
373
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
374 if (!filelist_read(dir_fd, &f, &d)) return;
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
375 if (!f && !d) return;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
376
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
377 f = filelist_sort(f, SORT_NAME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
378 d = filelist_sort(d, SORT_NAME, TRUE);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
379
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
380 *x = PAN_BOX_BORDER + ((*level) * MAX(PAN_BOX_BORDER, PAN_THUMB_GAP));
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
381
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
382 pi_box = pan_item_text_new(pw, *x, *y, dir_fd->path, PAN_TEXT_ATTR_NONE,
105
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_TEXT_COLOR, 255);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
385
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
386 *y += pi_box->height;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
387
875
f103af877504 Fix missing references for the current directory in pan folder stuff.
zas_
parents: 783
diff changeset
388 pi_box = pan_item_box_new(pw, file_data_ref(dir_fd),
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
389 *x, *y,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
390 PAN_BOX_BORDER, PAN_BOX_BORDER,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
391 PAN_BOX_OUTLINE_THICKNESS,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
392 PAN_BOX_COLOR, PAN_BOX_ALPHA,
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
393 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
394
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
395 *x += PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
396 *y += PAN_BOX_BORDER;
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 work = f;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
399 while (work)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
400 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
401 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
402 PanItem *pi;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
403
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
404 fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
405 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
406
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
407 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
408 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
409 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
410 *x += pi->width + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
411 if (pi->height > y_height) y_height = pi->height;
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 else
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
414 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
415 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
416 *x += PAN_THUMB_SIZE + PAN_THUMB_GAP;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
417 y_height = PAN_THUMB_SIZE;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
418 }
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 pan_item_size_by_item(pi_box, pi, PAN_BOX_BORDER);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
421 }
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 if (f) *y = pi_box->y + pi_box->height;
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 g_list_free(f);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
426
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
427 work = d;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
428 while (work)
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 FileData *fd;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
431
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
432 fd = work->data;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
433 work = work->next;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
434
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
435 if (!pan_is_ignored(fd->path, pw->ignore_symlinks))
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
436 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
437 *level = *level + 1;
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
438 pan_folder_tree_path(pw, fd, x, y, level, pi_box, width, height);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
439 *level = *level - 1;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
440 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
441 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
442
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
443 filelist_free(d);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
444
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
445 pan_item_size_by_item(parent, pi_box, PAN_BOX_BORDER);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
446
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
447 if (*y < pi_box->y + pi_box->height + PAN_BOX_BORDER)
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
448 *y = pi_box->y + pi_box->height + PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
449
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
450 pan_item_size_coordinates(pi_box, PAN_BOX_BORDER, width, height);
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
451 }
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
452
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
453 void pan_folder_tree_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height)
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
454 {
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
455 gint x, y;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
456 gint level;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
457 gint w, h;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
458
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
459 level = 0;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
460 x = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
461 y = PAN_BOX_BORDER;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
462 w = PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
463 h = PAN_BOX_BORDER * 2;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
464
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 475
diff changeset
465 pan_folder_tree_path(pw, dir_fd, &x, &y, &level, NULL, &w, &h);
105
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
466
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
467 if (width) *width = w;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
468 if (height) *height = h;
de64a683d5d0 Thu Nov 9 17:43:06 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
469 }
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1000
diff changeset
470 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */