line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VLGal::Style; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
6
|
1
|
|
|
1
|
|
4
|
use Error qw(:try); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
563
|
use VLGal::Size; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2817
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Singleton variable |
10
|
|
|
|
|
|
|
our $SINGLETON = undef; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Used by _value_is_allowed |
13
|
|
|
|
|
|
|
our %ALLOW_ISA = ( |
14
|
|
|
|
|
|
|
'size' => [ 'VLGal::Size' ], |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Used by _value_is_allowed |
18
|
|
|
|
|
|
|
our %ALLOW_REF = ( |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Used by _value_is_allowed |
22
|
|
|
|
|
|
|
our %ALLOW_RX = ( |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Used by _value_is_allowed |
26
|
|
|
|
|
|
|
our %ALLOW_VALUE = ( |
27
|
|
|
|
|
|
|
'table_order_dir' => { |
28
|
|
|
|
|
|
|
'n' => 1, |
29
|
|
|
|
|
|
|
'z' => 1, |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
'table_order_image' => { |
32
|
|
|
|
|
|
|
'n' => 1, |
33
|
|
|
|
|
|
|
'z' => 1, |
34
|
|
|
|
|
|
|
}, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Used by _initialize |
38
|
|
|
|
|
|
|
our %DEFAULT_VALUE = ( |
39
|
|
|
|
|
|
|
#'css_definition_file' => 'VLGal/lib/default.css file @INC', |
40
|
|
|
|
|
|
|
#'image_icon_folder' => 'VLGal/lib/icon-folder.png file @INC', |
41
|
|
|
|
|
|
|
#'image_icon_next_peer' => 'VLGal/lib/icon-next-peer.png file @INC', |
42
|
|
|
|
|
|
|
#'image_icon_next_seq' => 'VLGal/lib/icon-next-seq.png file @INC', |
43
|
|
|
|
|
|
|
#'image_icon_previous_peer' => 'VLGal/lib/icon-previous-peer.png file @INC', |
44
|
|
|
|
|
|
|
#'image_icon_previous_seq' => 'VLGal/lib/icon-previous-seq.png file @INC', |
45
|
|
|
|
|
|
|
'max_columns_dir' => 8, |
46
|
|
|
|
|
|
|
'max_columns_image' => 5, |
47
|
|
|
|
|
|
|
'size' => [ |
48
|
|
|
|
|
|
|
VLGal::Size->new( { |
49
|
|
|
|
|
|
|
max_height => 90, |
50
|
|
|
|
|
|
|
max_width => 90, |
51
|
|
|
|
|
|
|
} ), |
52
|
|
|
|
|
|
|
VLGal::Size->new( { |
53
|
|
|
|
|
|
|
max_height => 600, |
54
|
|
|
|
|
|
|
max_width => 600, |
55
|
|
|
|
|
|
|
} ), |
56
|
|
|
|
|
|
|
VLGal::Size->new( { |
57
|
|
|
|
|
|
|
max_height => 800, |
58
|
|
|
|
|
|
|
max_width => 800, |
59
|
|
|
|
|
|
|
} ), |
60
|
|
|
|
|
|
|
VLGal::Size->new( { |
61
|
|
|
|
|
|
|
max_height => 1000, |
62
|
|
|
|
|
|
|
max_width => 1000, |
63
|
|
|
|
|
|
|
} ), |
64
|
|
|
|
|
|
|
VLGal::Size->new( { |
65
|
|
|
|
|
|
|
max_height => 0, |
66
|
|
|
|
|
|
|
max_width => 0, |
67
|
|
|
|
|
|
|
} ), |
68
|
|
|
|
|
|
|
], |
69
|
|
|
|
|
|
|
'table_order_dir' => 'n', |
70
|
|
|
|
|
|
|
'table_order_image' => 'z', |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Library files |
74
|
|
|
|
|
|
|
our %LIB_FILE = ( |
75
|
|
|
|
|
|
|
css_definition_file => 'default.css', |
76
|
|
|
|
|
|
|
image_icon_folder => 'icon-folder.png', |
77
|
|
|
|
|
|
|
image_icon_next_peer => 'icon-next-peer.png', |
78
|
|
|
|
|
|
|
image_icon_next_seq => 'icon-next-seq.png', |
79
|
|
|
|
|
|
|
image_icon_previous_peer => 'icon-previous-peer.png', |
80
|
|
|
|
|
|
|
image_icon_previous_seq => 'icon-previous-seq.png', |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Package version |
84
|
|
|
|
|
|
|
our ($VERSION) = '$Revision: 0.01 $' =~ /\$Revision:\s+([^\s]+)/; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 NAME |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
VLGal::Style - contains VLGal code style information |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SYNOPSIS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
TODO |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 ABSTRACT |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Vincenzo's little gallery style |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 DESCRIPTION |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
C class to style Vincenzo's little gallery. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=over |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item new( [ OPT_HASH_REF ] ) |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Creates a new C object. C is a hash reference used to pass initialization options. On error an exception C is thrown. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Options for C may include: |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=over |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item B> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Passed to L. Defaults to the B file in C<@INC>. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item B> |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Passed to L. Defaults to the B file in C<@INC>. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item B> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Passed to L. Defaults to the B file in C<@INC>. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item B> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Passed to L. Defaults to the B file in C<@INC>. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item B> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Passed to L. Defaults to the B file in C<@INC>. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item B> |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Passed to L. Defaults to the B file in C<@INC>. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item B> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Passed to L. Defaults to B<8>. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=item B> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Passed to L. Defaults to B<5>. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item B> |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Passed to L. Must be an C reference. Defaults to: |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
[ |
151
|
|
|
|
|
|
|
VLGal::Size->new( { |
152
|
|
|
|
|
|
|
max_height => 90, |
153
|
|
|
|
|
|
|
max_width => 90, |
154
|
|
|
|
|
|
|
} ), |
155
|
|
|
|
|
|
|
VLGal::Size->new( { |
156
|
|
|
|
|
|
|
max_height => 600, |
157
|
|
|
|
|
|
|
max_width => 600, |
158
|
|
|
|
|
|
|
} ), |
159
|
|
|
|
|
|
|
VLGal::Size->new( { |
160
|
|
|
|
|
|
|
max_height => 800, |
161
|
|
|
|
|
|
|
max_width => 800, |
162
|
|
|
|
|
|
|
} ), |
163
|
|
|
|
|
|
|
VLGal::Size->new( { |
164
|
|
|
|
|
|
|
max_height => 1000, |
165
|
|
|
|
|
|
|
max_width => 1000, |
166
|
|
|
|
|
|
|
} ), |
167
|
|
|
|
|
|
|
VLGal::Size->new( { |
168
|
|
|
|
|
|
|
max_height => 0, |
169
|
|
|
|
|
|
|
max_width => 0, |
170
|
|
|
|
|
|
|
} ), |
171
|
|
|
|
|
|
|
], |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=item B> |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Passed to L. Defaults to B<'n'>. |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=item B> |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Passed to L. Defaults to B<'z'>. |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=item B> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Passed to L. |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=back |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=back |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head1 METHODS |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=over |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=item exists_size(ARRAY) |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Returns the count of items in C that are in the list of size description objects for the file. |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=item get_css_definition_file() |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Returns the B definition file to use. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=item get_image_icon_folder() |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
Returns the icon image to use to view a child page in the gallery. |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=item get_image_icon_next_peer() |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
Returns the icon image to use to view the next peer in the gallery. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=item get_image_icon_next_seq() |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
Returns the icon image to use to view the next item in sequence in the gallery. |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=item get_image_icon_previous_peer() |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
Returns the icon image to use to view the previous peer in the gallery. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=item get_image_icon_previous_seq() |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Returns the icon image to use to view the previous item in sequence in the gallery. |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=item get_max_columns_dir() |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
Returns the maximal amount of columns in the directory table. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=item get_max_columns_image() |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Returns the maximal amount of columns in the image table. |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=item get_size( [ INDEX_ARRAY ] ) |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
Returns an C containing the list of size description objects for the file. C is an optional list of indexes which when specified causes only the indexed elements in the ordered list to be returned. If not specified, all elements are returned. |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=item get_table_order_dir() |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
Returns the table ordering for directories. |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=item get_table_order_image() |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
Returns the table ordering for images. |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=item instance( [ CONSTR_OPT ] ) |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
Always returns the same C -singleton- object instance. The first time it is called, parameters C -if specified- are passed to the constructor. |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
=item is_verbose() |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
Returns whether to print messages to C during C code generation and image scaling or not. |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=item pop_size() |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
Pop and return an element off the list of size description objects for the file. On error an exception C is thrown. |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=item push_size(ARRAY) |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Push additional values on the list of size description objects for the file. C is the list value. On error an exception C is thrown. |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=over |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=item The values in C must be a (sub)class of: |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=over |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=item VLGal::Size |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=back |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=back |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=item set_css_definition_file(VALUE) |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
Set the B definition file to use. C is the value. Default value at initialization is the B file in C<@INC>. On error an exception C is thrown. |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=item set_idx_size( INDEX, VALUE ) |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
Set value in the list of size description objects for the file. C is the integer index which is greater than or equal to C<0>. C is the value. |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=over |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=item The values in C must be a (sub)class of: |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=over |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=item VLGal::Size |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
=back |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=back |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=item set_image_icon_folder(VALUE) |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Set the icon image to use to view a child page in the gallery. C is the value. Default value at initialization is the B file in C<@INC>. On error an exception C is thrown. |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=item set_image_icon_next_peer(VALUE) |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
Set the icon image to use to view the next peer in the gallery. C is the value. Default value at initialization is the B file in C<@INC>. On error an exception C is thrown. |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=item set_image_icon_next_seq(VALUE) |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
Set the icon image to use to view the next item in sequence in the gallery. C is the value. Default value at initialization is the B file in C<@INC>. On error an exception C is thrown. |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=item set_image_icon_previous_peer(VALUE) |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
Set the icon image to use to view the previous peer in the gallery. C is the value. Default value at initialization is the B file in C<@INC>. On error an exception C is thrown. |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=item set_image_icon_previous_seq(VALUE) |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
Set the icon image to use to view the previous item in sequence in the gallery. C is the value. Default value at initialization is the B file in C<@INC>. On error an exception C is thrown. |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=item set_max_columns_dir(VALUE) |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
Set the maximal amount of columns in the directory table. C is the value. Default value at initialization is C<8>. On error an exception C is thrown. |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=item set_max_columns_image(VALUE) |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
Set the maximal amount of columns in the image table. C is the value. Default value at initialization is C<5>. On error an exception C is thrown. |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=item set_num_size( NUMBER, VALUE ) |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
Set value in the list of size description objects for the file. C is the integer index which is greater than C<0>. C is the value. |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=over |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=item The values in C must be a (sub)class of: |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=over |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=item VLGal::Size |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
=back |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
=back |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
=item set_size(ARRAY) |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
Set the list of size description objects for the file absolutely. C is the list value. Default value at initialization is: |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
[ |
338
|
|
|
|
|
|
|
VLGal::Size->new( { |
339
|
|
|
|
|
|
|
max_height => 90, |
340
|
|
|
|
|
|
|
max_width => 90, |
341
|
|
|
|
|
|
|
} ), |
342
|
|
|
|
|
|
|
VLGal::Size->new( { |
343
|
|
|
|
|
|
|
max_height => 600, |
344
|
|
|
|
|
|
|
max_width => 600, |
345
|
|
|
|
|
|
|
} ), |
346
|
|
|
|
|
|
|
VLGal::Size->new( { |
347
|
|
|
|
|
|
|
max_height => 800, |
348
|
|
|
|
|
|
|
max_width => 800, |
349
|
|
|
|
|
|
|
} ), |
350
|
|
|
|
|
|
|
VLGal::Size->new( { |
351
|
|
|
|
|
|
|
max_height => 1000, |
352
|
|
|
|
|
|
|
max_width => 1000, |
353
|
|
|
|
|
|
|
} ), |
354
|
|
|
|
|
|
|
VLGal::Size->new( { |
355
|
|
|
|
|
|
|
max_height => 0, |
356
|
|
|
|
|
|
|
max_width => 0, |
357
|
|
|
|
|
|
|
} ), |
358
|
|
|
|
|
|
|
], |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
On error an exception C is thrown. |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=over |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
=item The values in C must be a (sub)class of: |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=over |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=item VLGal::Size |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=back |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=back |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=item set_table_order_dir(VALUE) |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
Set the table ordering for directories. C is the value. Default value at initialization is C. On error an exception C is thrown. |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=over |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=item VALUE must be a one of: |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=over |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
=item n |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=item z |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=back |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
=back |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
=item set_table_order_image(VALUE) |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
Set the table ordering for images. C is the value. Default value at initialization is C. On error an exception C is thrown. |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=over |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=item VALUE must be a one of: |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
=over |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
=item n |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=item z |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=back |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=back |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=item set_verbose(VALUE) |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
State that to print messages to C during C code generation and image scaling. C is the value. On error an exception C is thrown. |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=item shift_size() |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
Shift and return an element off the list of size description objects for the file. On error an exception C is thrown. |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
=item unshift_size(ARRAY) |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
Unshift additional values on the list of size description objects for the file. C is the list value. On error an exception C is thrown. |
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
=over |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
=item The values in C must be a (sub)class of: |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
=over |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
=item VLGal::Size |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
=back |
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=back |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
=back |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=head1 SEE ALSO |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
L, |
439
|
|
|
|
|
|
|
L, |
440
|
|
|
|
|
|
|
L, |
441
|
|
|
|
|
|
|
L, |
442
|
|
|
|
|
|
|
L |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
=head1 BUGS |
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
None known (yet.) |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
=head1 HISTORY |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
First development: September 2003 |
451
|
|
|
|
|
|
|
Last update: October 2003 |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
=head1 AUTHOR |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
Vincenzo Zocca |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=head1 COPYRIGHT |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
Copyright 2003 by Vincenzo Zocca |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
=head1 LICENSE |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
This file is part of the C module hierarchy for Perl by |
464
|
|
|
|
|
|
|
Vincenzo Zocca. |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
The VLGal module hierarchy is free software; you can redistribute it |
467
|
|
|
|
|
|
|
and/or modify it under the terms of the GNU General Public License |
468
|
|
|
|
|
|
|
as published by the Free Software Foundation; either version 2 of |
469
|
|
|
|
|
|
|
the License, or (at your option) any later version. |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
The VLGal module hierarchy is distributed in the hope that it will |
472
|
|
|
|
|
|
|
be useful, but WITHOUT ANY WARRANTY; without even the implied |
473
|
|
|
|
|
|
|
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
474
|
|
|
|
|
|
|
See the GNU General Public License for more details. |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
477
|
|
|
|
|
|
|
along with the VLGal module hierarchy; if not, write to |
478
|
|
|
|
|
|
|
the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
479
|
|
|
|
|
|
|
Boston, MA 02111-1307 USA |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
=cut |
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
sub new { |
484
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
485
|
|
|
|
|
|
|
|
486
|
1
|
|
|
|
|
2
|
my $self = {}; |
487
|
1
|
|
33
|
|
|
9
|
bless( $self, ( ref($class) || $class ) ); |
488
|
1
|
|
|
|
|
4
|
return( $self->_initialize(@_) ); |
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
sub _initialize { |
492
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
493
|
1
|
50
|
|
|
|
3
|
my $opt = defined($_[0]) ? shift : {}; |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
# Check $opt |
496
|
1
|
50
|
|
|
|
4
|
ref($opt) eq 'HASH' || throw Error::Simple("ERROR: VLGal::Style::_initialize, first argument must be 'HASH' reference."); |
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
# Check lib files |
499
|
1
|
|
|
|
|
4
|
&_check_lib_files($opt); |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
# css_definition_file, SINGLE, with default value |
502
|
1
|
50
|
|
|
|
8
|
$self->set_css_definition_file( exists( $opt->{css_definition_file} ) ? $opt->{css_definition_file} : $DEFAULT_VALUE{css_definition_file} ); |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
# image_icon_folder, SINGLE, with default value |
505
|
1
|
50
|
|
|
|
6
|
$self->set_image_icon_folder( exists( $opt->{image_icon_folder} ) ? $opt->{image_icon_folder} : $DEFAULT_VALUE{image_icon_folder} ); |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
# image_icon_next_peer, SINGLE, with default value |
508
|
1
|
50
|
|
|
|
5
|
$self->set_image_icon_next_peer( exists( $opt->{image_icon_next_peer} ) ? $opt->{image_icon_next_peer} : $DEFAULT_VALUE{image_icon_next_peer} ); |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
# image_icon_next_seq, SINGLE, with default value |
511
|
1
|
50
|
|
|
|
7
|
$self->set_image_icon_next_seq( exists( $opt->{image_icon_next_seq} ) ? $opt->{image_icon_next_seq} : $DEFAULT_VALUE{image_icon_next_seq} ); |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
# image_icon_previous_peer, SINGLE, with default value |
514
|
1
|
50
|
|
|
|
9
|
$self->set_image_icon_previous_peer( exists( $opt->{image_icon_previous_peer} ) ? $opt->{image_icon_previous_peer} : $DEFAULT_VALUE{image_icon_previous_peer} ); |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
# image_icon_previous_seq, SINGLE, with default value |
517
|
1
|
50
|
|
|
|
6
|
$self->set_image_icon_previous_seq( exists( $opt->{image_icon_previous_seq} ) ? $opt->{image_icon_previous_seq} : $DEFAULT_VALUE{image_icon_previous_seq} ); |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
# max_columns_dir, SINGLE, with default value |
520
|
1
|
50
|
|
|
|
6
|
$self->set_max_columns_dir( exists( $opt->{max_columns_dir} ) ? $opt->{max_columns_dir} : $DEFAULT_VALUE{max_columns_dir} ); |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
# max_columns_image, SINGLE, with default value |
523
|
1
|
50
|
|
|
|
5
|
$self->set_max_columns_image( exists( $opt->{max_columns_image} ) ? $opt->{max_columns_image} : $DEFAULT_VALUE{max_columns_image} ); |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
# size, MULTI, with default value |
526
|
1
|
50
|
|
|
|
4
|
if ( exists( $opt->{size} ) ) { |
527
|
0
|
0
|
|
|
|
0
|
ref( $opt->{size} ) eq 'ARRAY' || throw Error::Simple("ERROR: VLGal::Style::_initialize, specified value for option 'size' must be an 'ARRAY' reference."); |
528
|
0
|
|
|
|
|
0
|
$self->set_size( @{ $opt->{size} } ); |
|
0
|
|
|
|
|
0
|
|
529
|
|
|
|
|
|
|
} |
530
|
|
|
|
|
|
|
else { |
531
|
1
|
|
|
|
|
2
|
$self->set_size( @{ $DEFAULT_VALUE{size} } ); |
|
1
|
|
|
|
|
6
|
|
532
|
|
|
|
|
|
|
} |
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
# table_order_dir, SINGLE, with default value |
535
|
1
|
50
|
|
|
|
6
|
$self->set_table_order_dir( exists( $opt->{table_order_dir} ) ? $opt->{table_order_dir} : $DEFAULT_VALUE{table_order_dir} ); |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
# table_order_image, SINGLE, with default value |
538
|
1
|
50
|
|
|
|
6
|
$self->set_table_order_image( exists( $opt->{table_order_image} ) ? $opt->{table_order_image} : $DEFAULT_VALUE{table_order_image} ); |
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
# verbose, BOOLEAN |
541
|
1
|
50
|
|
|
|
3
|
exists( $opt->{verbose} ) && $self->set_verbose( $opt->{verbose} ); |
542
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
# Return $self |
544
|
1
|
|
|
|
|
3
|
return($self); |
545
|
|
|
|
|
|
|
} |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
sub _check_lib_files { |
548
|
1
|
|
|
1
|
|
1
|
my $opt = shift; |
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
# Check lib files |
551
|
1
|
|
|
|
|
6
|
foreach my $attr ( keys(%LIB_FILE) ) { |
552
|
|
|
|
|
|
|
# Do nothing if attribute in options |
553
|
6
|
50
|
|
|
|
13
|
$opt->{$attr} && |
554
|
|
|
|
|
|
|
next; |
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
# Make file name |
557
|
6
|
|
|
|
|
57
|
my $def_fn = File::Spec->catfile( 'VLGal', 'lib', $LIB_FILE{$attr} ); |
558
|
6
|
|
|
|
|
15
|
foreach my $dir ( @INC ) { |
559
|
|
|
|
|
|
|
# Make file name |
560
|
12
|
|
|
|
|
90
|
my $fs_name = File::Spec->catfile( $dir, $def_fn ); |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
# Check if file exists |
563
|
12
|
100
|
|
|
|
237
|
( -f $fs_name ) || |
564
|
|
|
|
|
|
|
next; |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
# Set option |
567
|
6
|
|
|
|
|
11
|
$opt->{$attr} = $fs_name; |
568
|
6
|
|
|
|
|
8
|
last; |
569
|
|
|
|
|
|
|
} |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
# Check if we have a file |
572
|
6
|
50
|
|
|
|
14
|
$opt->{$attr} || |
573
|
|
|
|
|
|
|
throw Error::Simple("ERROR: VLGal::Style::_check_lib_files, failed to find file '$def_fn' in \@INC '@INC'."); |
574
|
|
|
|
|
|
|
} |
575
|
|
|
|
|
|
|
} |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
sub _mk_size_basename { |
578
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
# Make the precision |
581
|
0
|
|
|
|
|
0
|
my $p = length( scalar( $self->get_size() ) ); |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
# Make the size basenames |
584
|
0
|
|
|
|
|
0
|
my $i = 0; |
585
|
0
|
|
|
|
|
0
|
foreach my $size ( $self->get_size() ) { |
586
|
0
|
|
|
|
|
0
|
$i++; |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
# Make basename and label |
589
|
0
|
0
|
0
|
|
|
0
|
if ( $size->get_max_height() && $size->get_max_width() ) { |
590
|
0
|
|
|
|
|
0
|
$size->set_basename( sprintf( |
591
|
|
|
|
|
|
|
"%0${p}d-%sx%s", |
592
|
|
|
|
|
|
|
$i, |
593
|
|
|
|
|
|
|
$size->get_max_width(), |
594
|
|
|
|
|
|
|
$size->get_max_width() |
595
|
|
|
|
|
|
|
) ); |
596
|
0
|
|
|
|
|
0
|
$size->set_label( sprintf( |
597
|
|
|
|
|
|
|
"%sx%s", |
598
|
|
|
|
|
|
|
$size->get_max_width(), |
599
|
|
|
|
|
|
|
$size->get_max_width() |
600
|
|
|
|
|
|
|
) ); |
601
|
|
|
|
|
|
|
} |
602
|
|
|
|
|
|
|
else { |
603
|
0
|
|
|
|
|
0
|
$size->set_basename('orig'); |
604
|
0
|
|
|
|
|
0
|
$size->set_label('Original'); |
605
|
|
|
|
|
|
|
} |
606
|
|
|
|
|
|
|
} |
607
|
|
|
|
|
|
|
} |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
sub _value_is_allowed { |
610
|
12
|
|
|
12
|
|
15
|
my $name = shift; |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
# Value is allowed if no ALLOW clauses exist for the named attribute |
613
|
12
|
100
|
66
|
|
|
58
|
if ( ! exists( $ALLOW_ISA{$name} ) && ! exists( $ALLOW_REF{$name} ) && ! exists( $ALLOW_RX{$name} ) && ! exists( $ALLOW_VALUE{$name} ) ) { |
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
614
|
8
|
|
|
|
|
24
|
return(1); |
615
|
|
|
|
|
|
|
} |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
# At this point, all values in @_ must to be allowed |
618
|
|
|
|
|
|
|
CHECK_VALUES: |
619
|
4
|
|
|
|
|
7
|
foreach my $val (@_) { |
620
|
|
|
|
|
|
|
# Check ALLOW_ISA |
621
|
10
|
100
|
66
|
|
|
33
|
if ( ref($val) && exists( $ALLOW_ISA{$name} ) ) { |
622
|
8
|
|
|
|
|
7
|
foreach my $class ( @{ $ALLOW_ISA{$name} } ) { |
|
8
|
|
|
|
|
12
|
|
623
|
8
|
50
|
|
|
|
27
|
&UNIVERSAL::isa( $val, $class ) && next CHECK_VALUES; |
624
|
|
|
|
|
|
|
} |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
# Check ALLOW_REF |
628
|
2
|
50
|
33
|
|
|
18
|
if ( ref($val) && exists( $ALLOW_REF{$name} ) ) { |
629
|
0
|
0
|
|
|
|
0
|
exists( $ALLOW_REF{$name}{ ref($val) } ) && next CHECK_VALUES; |
630
|
|
|
|
|
|
|
} |
631
|
|
|
|
|
|
|
|
632
|
|
|
|
|
|
|
# Check ALLOW_RX |
633
|
2
|
50
|
33
|
|
|
18
|
if ( defined($val) && ! ref($val) && exists( $ALLOW_RX{$name} ) ) { |
|
|
|
33
|
|
|
|
|
634
|
0
|
|
|
|
|
0
|
foreach my $rx ( @{ $ALLOW_RX{$name} } ) { |
|
0
|
|
|
|
|
0
|
|
635
|
0
|
0
|
|
|
|
0
|
$val =~ /$rx/ && next CHECK_VALUES; |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
} |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
# Check ALLOW_VALUE |
640
|
2
|
50
|
33
|
|
|
9
|
if ( ! ref($val) && exists( $ALLOW_VALUE{$name} ) ) { |
641
|
2
|
50
|
|
|
|
8
|
exists( $ALLOW_VALUE{$name}{$val} ) && next CHECK_VALUES; |
642
|
|
|
|
|
|
|
} |
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
# We caught a not allowed value |
645
|
0
|
|
|
|
|
0
|
return(0); |
646
|
|
|
|
|
|
|
} |
647
|
|
|
|
|
|
|
|
648
|
|
|
|
|
|
|
# OK, all values are allowed |
649
|
4
|
|
|
|
|
13
|
return(1); |
650
|
|
|
|
|
|
|
} |
651
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
sub exists_size { |
653
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
# Count occurrences |
656
|
0
|
|
|
|
|
0
|
my $count = 0; |
657
|
0
|
|
|
|
|
0
|
foreach my $val1 (@_) { |
658
|
0
|
|
|
|
|
0
|
foreach my $val2 ( @{ $self->{VLGal_Style}{size} } ) { |
|
0
|
|
|
|
|
0
|
|
659
|
0
|
0
|
|
|
|
0
|
( $val1 eq $val2 ) && $count ++; |
660
|
|
|
|
|
|
|
} |
661
|
|
|
|
|
|
|
} |
662
|
0
|
|
|
|
|
0
|
return($count); |
663
|
|
|
|
|
|
|
} |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
sub get_css_definition_file { |
666
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
667
|
|
|
|
|
|
|
|
668
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{css_definition_file} ); |
669
|
|
|
|
|
|
|
} |
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
sub get_image_icon_folder { |
672
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
673
|
|
|
|
|
|
|
|
674
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{image_icon_folder} ); |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
sub get_image_icon_next_peer { |
678
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
679
|
|
|
|
|
|
|
|
680
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{image_icon_next_peer} ); |
681
|
|
|
|
|
|
|
} |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
sub get_image_icon_next_seq { |
684
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
685
|
|
|
|
|
|
|
|
686
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{image_icon_next_seq} ); |
687
|
|
|
|
|
|
|
} |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
sub get_image_icon_previous_peer { |
690
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
691
|
|
|
|
|
|
|
|
692
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{image_icon_previous_peer} ); |
693
|
|
|
|
|
|
|
} |
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
sub get_image_icon_previous_seq { |
696
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
697
|
|
|
|
|
|
|
|
698
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{image_icon_previous_seq} ); |
699
|
|
|
|
|
|
|
} |
700
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
sub get_max_columns_dir { |
702
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
703
|
|
|
|
|
|
|
|
704
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{max_columns_dir} ); |
705
|
|
|
|
|
|
|
} |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
sub get_max_columns_image { |
708
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
709
|
|
|
|
|
|
|
|
710
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{max_columns_image} ); |
711
|
|
|
|
|
|
|
} |
712
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
sub get_size { |
714
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
715
|
|
|
|
|
|
|
|
716
|
0
|
0
|
|
|
|
0
|
if ( scalar(@_) ) { |
717
|
0
|
|
|
|
|
0
|
my @ret = (); |
718
|
0
|
|
|
|
|
0
|
foreach my $i (@_) { |
719
|
0
|
|
|
|
|
0
|
push( @ret, $self->{VLGal_Style}{size}[ int($i) ] ); |
720
|
|
|
|
|
|
|
} |
721
|
0
|
|
|
|
|
0
|
return(@ret); |
722
|
|
|
|
|
|
|
} |
723
|
|
|
|
|
|
|
else { |
724
|
|
|
|
|
|
|
# Return the full list |
725
|
0
|
|
|
|
|
0
|
return( @{ $self->{VLGal_Style}{size} } ); |
|
0
|
|
|
|
|
0
|
|
726
|
|
|
|
|
|
|
} |
727
|
|
|
|
|
|
|
} |
728
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
sub get_table_order_dir { |
730
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
731
|
|
|
|
|
|
|
|
732
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{table_order_dir} ); |
733
|
|
|
|
|
|
|
} |
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
sub get_table_order_image { |
736
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
737
|
|
|
|
|
|
|
|
738
|
0
|
|
|
|
|
0
|
return( $self->{VLGal_Style}{table_order_image} ); |
739
|
|
|
|
|
|
|
} |
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
sub instance { |
742
|
|
|
|
|
|
|
# Allow calls like: |
743
|
|
|
|
|
|
|
# - VLGal::Style::instance() |
744
|
|
|
|
|
|
|
# - VLGal::Style->instance() |
745
|
|
|
|
|
|
|
# - $variable->instance() |
746
|
1
|
50
|
33
|
1
|
1
|
18
|
if ( ref($_[0]) && &UNIVERSAL::isa( $_[0], 'VLGal::Style' ) ) { |
|
|
50
|
33
|
|
|
|
|
747
|
0
|
|
|
|
|
0
|
shift; |
748
|
|
|
|
|
|
|
} |
749
|
|
|
|
|
|
|
elsif ( ! ref($_[0]) && $_[0] eq 'VLGal::Style' ) { |
750
|
1
|
|
|
|
|
2
|
shift; |
751
|
|
|
|
|
|
|
} |
752
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
# If $SINGLETON is defined return it |
754
|
1
|
50
|
|
|
|
3
|
defined($SINGLETON) && return($SINGLETON); |
755
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
# Create the object and set $SINGLETON |
757
|
1
|
|
|
|
|
4
|
$SINGLETON = VLGal::Style->new(@_); |
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
# Return $SINGLETON |
760
|
1
|
|
|
|
|
4
|
return($SINGLETON); |
761
|
|
|
|
|
|
|
} |
762
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
sub is_verbose { |
764
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
765
|
|
|
|
|
|
|
|
766
|
0
|
0
|
|
|
|
0
|
if ( $self->{VLGal_Style}{verbose} ) { |
767
|
0
|
|
|
|
|
0
|
return(1); |
768
|
|
|
|
|
|
|
} |
769
|
|
|
|
|
|
|
else { |
770
|
0
|
|
|
|
|
0
|
return(0); |
771
|
|
|
|
|
|
|
} |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
sub pop_size { |
775
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
# Pop an element from the list |
778
|
0
|
|
|
|
|
0
|
return( pop( @{ $self->{VLGal_Style}{size} } ) ); |
|
0
|
|
|
|
|
0
|
|
779
|
|
|
|
|
|
|
} |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
sub push_size { |
782
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
# Check if isas/refs/rxs/values are allowed |
785
|
0
|
0
|
|
|
|
0
|
&_value_is_allowed( 'size', @_ ) || throw Error::Simple("ERROR: VLGal::Style::push_size, one or more specified value(s) '@_' is/are not allowed."); |
786
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
# Push the list |
788
|
0
|
|
|
|
|
0
|
push( @{ $self->{VLGal_Style}{size} }, @_ ); |
|
0
|
|
|
|
|
0
|
|
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
|
791
|
|
|
|
|
|
|
sub set_css_definition_file { |
792
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
793
|
1
|
|
|
|
|
2
|
my $val = shift; |
794
|
|
|
|
|
|
|
|
795
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
796
|
1
|
50
|
|
|
|
3
|
&_value_is_allowed( 'css_definition_file', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_css_definition_file, the specified value '$val' is not allowed."); |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
# Assignment |
799
|
1
|
|
|
|
|
7
|
$self->{VLGal_Style}{css_definition_file} = $val; |
800
|
|
|
|
|
|
|
} |
801
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
sub set_idx_size { |
803
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
804
|
0
|
|
|
|
|
0
|
my $idx = shift; |
805
|
0
|
|
|
|
|
0
|
my $val = shift; |
806
|
|
|
|
|
|
|
|
807
|
|
|
|
|
|
|
# Check if index is a positive integer or zero |
808
|
0
|
0
|
|
|
|
0
|
( $idx == int($idx) ) || throw Error::Simple("ERROR: VLGal::Style::set_idx_size, the specified index '$idx' is not an integer."); |
809
|
0
|
0
|
|
|
|
0
|
( $idx >= 0 ) || throw Error::Simple("ERROR: VLGal::Style::set_idx_size, the specified index '$idx' is not a positive integer or zero."); |
810
|
|
|
|
|
|
|
|
811
|
|
|
|
|
|
|
# Check if isas/refs/rxs/values are allowed |
812
|
0
|
0
|
|
|
|
0
|
&_value_is_allowed( 'size', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_idx_size, one or more specified value(s) '@_' is/are not allowed."); |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
# Set the value in the list |
815
|
0
|
|
|
|
|
0
|
$self->{VLGal_Style}{size}[$idx] = $val; |
816
|
|
|
|
|
|
|
} |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
sub set_image_icon_folder { |
819
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
820
|
1
|
|
|
|
|
2
|
my $val = shift; |
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
823
|
1
|
50
|
|
|
|
2
|
&_value_is_allowed( 'image_icon_folder', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_image_icon_folder, the specified value '$val' is not allowed."); |
824
|
|
|
|
|
|
|
|
825
|
|
|
|
|
|
|
# Assignment |
826
|
1
|
|
|
|
|
3
|
$self->{VLGal_Style}{image_icon_folder} = $val; |
827
|
|
|
|
|
|
|
} |
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
sub set_image_icon_next_peer { |
830
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
831
|
1
|
|
|
|
|
2
|
my $val = shift; |
832
|
|
|
|
|
|
|
|
833
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
834
|
1
|
50
|
|
|
|
2
|
&_value_is_allowed( 'image_icon_next_peer', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_image_icon_next_peer, the specified value '$val' is not allowed."); |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
# Assignment |
837
|
1
|
|
|
|
|
8
|
$self->{VLGal_Style}{image_icon_next_peer} = $val; |
838
|
|
|
|
|
|
|
} |
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
sub set_image_icon_next_seq { |
841
|
1
|
|
|
1
|
1
|
45
|
my $self = shift; |
842
|
1
|
|
|
|
|
2
|
my $val = shift; |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
845
|
1
|
50
|
|
|
|
3
|
&_value_is_allowed( 'image_icon_next_seq', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_image_icon_next_seq, the specified value '$val' is not allowed."); |
846
|
|
|
|
|
|
|
|
847
|
|
|
|
|
|
|
# Assignment |
848
|
1
|
|
|
|
|
2
|
$self->{VLGal_Style}{image_icon_next_seq} = $val; |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
|
851
|
|
|
|
|
|
|
sub set_image_icon_previous_peer { |
852
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
853
|
1
|
|
|
|
|
2
|
my $val = shift; |
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
856
|
1
|
50
|
|
|
|
2
|
&_value_is_allowed( 'image_icon_previous_peer', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_image_icon_previous_peer, the specified value '$val' is not allowed."); |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
# Assignment |
859
|
1
|
|
|
|
|
7
|
$self->{VLGal_Style}{image_icon_previous_peer} = $val; |
860
|
|
|
|
|
|
|
} |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
sub set_image_icon_previous_seq { |
863
|
1
|
|
|
1
|
1
|
8
|
my $self = shift; |
864
|
1
|
|
|
|
|
1
|
my $val = shift; |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
867
|
1
|
50
|
|
|
|
3
|
&_value_is_allowed( 'image_icon_previous_seq', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_image_icon_previous_seq, the specified value '$val' is not allowed."); |
868
|
|
|
|
|
|
|
|
869
|
|
|
|
|
|
|
# Assignment |
870
|
1
|
|
|
|
|
2
|
$self->{VLGal_Style}{image_icon_previous_seq} = $val; |
871
|
|
|
|
|
|
|
} |
872
|
|
|
|
|
|
|
|
873
|
|
|
|
|
|
|
sub set_max_columns_dir { |
874
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
875
|
1
|
|
|
|
|
3
|
my $val = shift; |
876
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
878
|
1
|
50
|
|
|
|
2
|
&_value_is_allowed( 'max_columns_dir', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_max_columns_dir, the specified value '$val' is not allowed."); |
879
|
|
|
|
|
|
|
|
880
|
|
|
|
|
|
|
# Assignment |
881
|
1
|
|
|
|
|
2
|
$self->{VLGal_Style}{max_columns_dir} = $val; |
882
|
|
|
|
|
|
|
} |
883
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
sub set_max_columns_image { |
885
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
886
|
1
|
|
|
|
|
2
|
my $val = shift; |
887
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
889
|
1
|
50
|
|
|
|
2
|
&_value_is_allowed( 'max_columns_image', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_max_columns_image, the specified value '$val' is not allowed."); |
890
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
# Assignment |
892
|
1
|
|
|
|
|
4
|
$self->{VLGal_Style}{max_columns_image} = $val; |
893
|
|
|
|
|
|
|
} |
894
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
sub set_num_size { |
896
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
897
|
0
|
|
|
|
|
0
|
my $num = shift; |
898
|
|
|
|
|
|
|
|
899
|
|
|
|
|
|
|
# Check if index is an integer |
900
|
0
|
0
|
|
|
|
0
|
( $num == int($num) ) || throw Error::Simple("ERROR: VLGal::Style::set_num_size, the specified number '$num' is not an integer."); |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
# Call set_idx_size |
903
|
0
|
|
|
|
|
0
|
$self->set_idx_size( $num - 1, @_ ); |
904
|
|
|
|
|
|
|
} |
905
|
|
|
|
|
|
|
|
906
|
|
|
|
|
|
|
sub set_size { |
907
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
# Check if isas/refs/rxs/values are allowed |
910
|
2
|
50
|
|
|
|
4
|
&_value_is_allowed( 'size', @_ ) || throw Error::Simple("ERROR: VLGal::Style::set_size, one or more specified value(s) '@_' is/are not allowed."); |
911
|
|
|
|
|
|
|
|
912
|
|
|
|
|
|
|
# Set the list |
913
|
2
|
|
|
|
|
3
|
@{ $self->{VLGal_Style}{size} } = @_; |
|
2
|
|
|
|
|
7
|
|
914
|
|
|
|
|
|
|
} |
915
|
|
|
|
|
|
|
|
916
|
|
|
|
|
|
|
sub set_table_order_dir { |
917
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
918
|
1
|
|
|
|
|
2
|
my $val = shift; |
919
|
|
|
|
|
|
|
|
920
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
921
|
1
|
50
|
|
|
|
2
|
&_value_is_allowed( 'table_order_dir', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_table_order_dir, the specified value '$val' is not allowed."); |
922
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
# Assignment |
924
|
1
|
|
|
|
|
2
|
$self->{VLGal_Style}{table_order_dir} = $val; |
925
|
|
|
|
|
|
|
} |
926
|
|
|
|
|
|
|
|
927
|
|
|
|
|
|
|
sub set_table_order_image { |
928
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
929
|
1
|
|
|
|
|
2
|
my $val = shift; |
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
# Check if isa/ref/rx/value is allowed |
932
|
1
|
50
|
|
|
|
3
|
&_value_is_allowed( 'table_order_image', $val ) || throw Error::Simple("ERROR: VLGal::Style::set_table_order_image, the specified value '$val' is not allowed."); |
933
|
|
|
|
|
|
|
|
934
|
|
|
|
|
|
|
# Assignment |
935
|
1
|
|
|
|
|
4
|
$self->{VLGal_Style}{table_order_image} = $val; |
936
|
|
|
|
|
|
|
} |
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
sub set_verbose { |
939
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
940
|
|
|
|
|
|
|
|
941
|
0
|
0
|
|
|
|
|
if (shift) { |
942
|
0
|
|
|
|
|
|
$self->{VLGal_Style}{verbose} = 1; |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
else { |
945
|
0
|
|
|
|
|
|
$self->{VLGal_Style}{verbose} = 0; |
946
|
|
|
|
|
|
|
} |
947
|
|
|
|
|
|
|
} |
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
sub shift_size { |
950
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
951
|
|
|
|
|
|
|
|
952
|
|
|
|
|
|
|
# Shift an element from the list |
953
|
0
|
|
|
|
|
|
return( shift( @{ $self->{VLGal_Style}{size} } ) ); |
|
0
|
|
|
|
|
|
|
954
|
|
|
|
|
|
|
} |
955
|
|
|
|
|
|
|
|
956
|
|
|
|
|
|
|
sub unshift_size { |
957
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
958
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
# Check if isas/refs/rxs/values are allowed |
960
|
0
|
0
|
|
|
|
|
&_value_is_allowed( 'size', @_ ) || throw Error::Simple("ERROR: VLGal::Style::unshift_size, one or more specified value(s) '@_' is/are not allowed."); |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
# Unshift the list |
963
|
0
|
|
|
|
|
|
unshift( @{ $self->{VLGal_Style}{size} }, @_ ); |
|
0
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
} |
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
1; |