1 |
use strict; |
2 |
package SuikaWiki::Plugin::Registry; |
3 |
|
4 |
|
5 |
our %Info; |
6 |
$Info{q#Image#}->{Name} = q#Image#; |
7 |
$Info{q#Image#}->{q#Version#} = q#2004.1205.0529#; |
8 |
$Info{q#Image#}->{q#InterfaceVersion#} = q#2.9.1#; |
9 |
$Info{q#Image#}->{q#mkpluginVersion#} = q#2.1.21#; |
10 |
$Info{q#Image#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::Image1041105052955rKge#; |
11 |
$Info{q#Image#}->{q#Date.RCS#} = q#$Date: 2004/02/08 08:44:13 $#; |
12 |
$Info{q#Image#}->{Description} = [[q#Image support#, q#en#, q##]]; |
13 |
$Info{q#Image#}->{License} = [[q#%%GPL%%#, q##, q##]]; |
14 |
$Info{q#Image#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]]; |
15 |
|
16 |
push @SuikaWiki::View::Implementation::CommonViewDefs, { |
17 |
condition => {q#mode#, q#image_png#, q#http_method#, [q#GET#, q#HEAD#]}, |
18 |
object_class => q#SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_png1041105052955T1dG#, |
19 |
}; |
20 |
package SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_png1041105052955T1dG; |
21 |
|
22 |
|
23 |
our @ISA = q#SuikaWiki::View::template#; |
24 |
|
25 |
sub main ($$$) { |
26 |
my ($self, $opt, $opt2) = @_; |
27 |
require SuikaWiki::Output::HTTP; |
28 |
$opt2->{output} = SuikaWiki::Output::HTTP->new |
29 |
(wiki => $self->{view}->{wiki}, |
30 |
view => $self->{view}, viewobj => $self); |
31 |
for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}}, |
32 |
'Accept-Language') { |
33 |
$opt2->{output}->add_negotiate_header_field ($_); |
34 |
} |
35 |
|
36 |
$opt2->{template} = q#%read (Type => {image/png}, return-type => ToOctetStream, |
37 |
when-no-converter => 406);#; |
38 |
$opt2->{o} = bless { |
39 |
## SuikaWiki 3 WikiPlugin interface |
40 |
wiki => $self->{view}->{wiki}, |
41 |
plugin => $self->{view}->{wiki}->{plugin}, |
42 |
var => {}, |
43 |
}, 'SuikaWiki::Plugin'; |
44 |
$opt2->{output}->{status_code} = 200; |
45 |
|
46 |
$opt2->{output}->{entity}->{media_type} = q#image/png#; |
47 |
|
48 |
|
49 |
$opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#image#}}); |
50 |
$opt2->{output}->{entity}->{body_is_octet_stream} = 1; |
51 |
|
52 |
$self->{view}->{wiki}->init_db; |
53 |
$self->main_pre ($opt, $opt2); |
54 |
|
55 |
|
56 |
use Message::Util::Error; |
57 |
try { |
58 |
$opt2->{output}->{entity}->{body} |
59 |
= |
60 |
(SuikaWiki::Plugin->formatter ('view') |
61 |
->replace ($opt2->{template}, param => $opt2->{o})); |
62 |
} $self->{view}->{wiki}->{config}->{catch}->{ formatter_view }; |
63 |
$opt2->{output}->output (output => 'http-cgi'); |
64 |
|
65 |
$self->main_post ($opt, $opt2); |
66 |
} |
67 |
|
68 |
push @SuikaWiki::View::Implementation::CommonViewDefs, { |
69 |
condition => {q#mode#, q#image_jpeg#, q#http_method#, [q#GET#, q#HEAD#]}, |
70 |
object_class => q#SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_jpeg10411050529556qot#, |
71 |
}; |
72 |
package SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_jpeg10411050529556qot; |
73 |
|
74 |
|
75 |
our @ISA = q#SuikaWiki::View::template#; |
76 |
|
77 |
sub main ($$$) { |
78 |
my ($self, $opt, $opt2) = @_; |
79 |
require SuikaWiki::Output::HTTP; |
80 |
$opt2->{output} = SuikaWiki::Output::HTTP->new |
81 |
(wiki => $self->{view}->{wiki}, |
82 |
view => $self->{view}, viewobj => $self); |
83 |
for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}}, |
84 |
'Accept-Language') { |
85 |
$opt2->{output}->add_negotiate_header_field ($_); |
86 |
} |
87 |
|
88 |
$opt2->{template} = q#%read (Type => {image/jpeg}, return-type => ToOctetStream, |
89 |
when-no-converter => 406);#; |
90 |
$opt2->{o} = bless { |
91 |
## SuikaWiki 3 WikiPlugin interface |
92 |
wiki => $self->{view}->{wiki}, |
93 |
plugin => $self->{view}->{wiki}->{plugin}, |
94 |
var => {}, |
95 |
}, 'SuikaWiki::Plugin'; |
96 |
$opt2->{output}->{status_code} = 200; |
97 |
|
98 |
$opt2->{output}->{entity}->{media_type} = q#image/jpeg#; |
99 |
|
100 |
|
101 |
$opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#image#}}); |
102 |
$opt2->{output}->{entity}->{body_is_octet_stream} = 1; |
103 |
|
104 |
$self->{view}->{wiki}->init_db; |
105 |
$self->main_pre ($opt, $opt2); |
106 |
|
107 |
|
108 |
use Message::Util::Error; |
109 |
try { |
110 |
$opt2->{output}->{entity}->{body} |
111 |
= |
112 |
(SuikaWiki::Plugin->formatter ('view') |
113 |
->replace ($opt2->{template}, param => $opt2->{o})); |
114 |
} $self->{view}->{wiki}->{config}->{catch}->{ formatter_view }; |
115 |
$opt2->{output}->output (output => 'http-cgi'); |
116 |
|
117 |
$self->main_post ($opt, $opt2); |
118 |
} |
119 |
|
120 |
push @SuikaWiki::View::Implementation::CommonViewDefs, { |
121 |
condition => {q#mode#, q#image_x_icon#, q#http_method#, [q#GET#, q#HEAD#]}, |
122 |
object_class => q#SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_x_icon1041105052955p_i1#, |
123 |
}; |
124 |
package SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_x_icon1041105052955p_i1; |
125 |
|
126 |
|
127 |
our @ISA = q#SuikaWiki::View::template#; |
128 |
|
129 |
sub main ($$$) { |
130 |
my ($self, $opt, $opt2) = @_; |
131 |
require SuikaWiki::Output::HTTP; |
132 |
$opt2->{output} = SuikaWiki::Output::HTTP->new |
133 |
(wiki => $self->{view}->{wiki}, |
134 |
view => $self->{view}, viewobj => $self); |
135 |
for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}}, |
136 |
'Accept-Language') { |
137 |
$opt2->{output}->add_negotiate_header_field ($_); |
138 |
} |
139 |
|
140 |
$opt2->{template} = q#%read (Type => {image/vnd.microsoft.icon}, return-type => ToOctetStream, |
141 |
when-no-converter => 406);#; |
142 |
$opt2->{o} = bless { |
143 |
## SuikaWiki 3 WikiPlugin interface |
144 |
wiki => $self->{view}->{wiki}, |
145 |
plugin => $self->{view}->{wiki}->{plugin}, |
146 |
var => {}, |
147 |
}, 'SuikaWiki::Plugin'; |
148 |
$opt2->{output}->{status_code} = 200; |
149 |
|
150 |
$opt2->{output}->{entity}->{media_type} = q#image/vnd.microsoft.icon#; |
151 |
|
152 |
|
153 |
$opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#image#}}); |
154 |
$opt2->{output}->{entity}->{body_is_octet_stream} = 1; |
155 |
|
156 |
$self->{view}->{wiki}->init_db; |
157 |
$self->main_pre ($opt, $opt2); |
158 |
|
159 |
|
160 |
use Message::Util::Error; |
161 |
try { |
162 |
$opt2->{output}->{entity}->{body} |
163 |
= |
164 |
(SuikaWiki::Plugin->formatter ('view') |
165 |
->replace ($opt2->{template}, param => $opt2->{o})); |
166 |
} $self->{view}->{wiki}->{config}->{catch}->{ formatter_view }; |
167 |
$opt2->{output}->output (output => 'http-cgi'); |
168 |
|
169 |
$self->main_post ($opt, $opt2); |
170 |
} |
171 |
|
172 |
package SuikaWiki::Plugin::Resource; |
173 |
|
174 |
our $BaseResource; |
175 |
$BaseResource->{q#en#}->{q##}->{q#Mode:image_x_icon#} = q#Windows Icon#; |
176 |
$BaseResource->{q#und#}->{q##}->{q#Mode#} = q#image_jpeg#; |
177 |
$BaseResource->{q#und#}->{q##}->{q#lang#} = q#en#; |
178 |
$BaseResource->{q#en#}->{q##}->{q#Mode:image_png#} = q#PNG image#; |
179 |
package SuikaWiki::Plugin::Registry; |
180 |
|
181 |
$Info{q#Image#}->{provide} = {q#viewdef#, [{q#Description#, [q#Portable Network Graphics (PNG) format image#, q#en#, q##], q#Name#, q#image_png#}, {q#Description#, [q#JPEG (JFIF) format image#, q#en#, q##], q#Name#, q#image_jpeg#}, {q#Description#, [q#Windows icon format image#, q#en#, q##], q#Name#, q#image_x_icon#}]}; |
182 |
|
183 |
1; |