use strict;
package SuikaWiki::Plugin::Registry;


our %Info;
$Info{q#Image#}->{Name} = q#Image#;
$Info{q#Image#}->{q#Version#} = q#2004.1205.0529#;
$Info{q#Image#}->{q#InterfaceVersion#} = q#2.9.1#;
$Info{q#Image#}->{q#mkpluginVersion#} = q#2.1.21#;
$Info{q#Image#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::Image1041105052955rKge#;
$Info{q#Image#}->{q#Date.RCS#} = q#$Date: 2010/05/16 23:05:50 $#;
$Info{q#Image#}->{Description} = [[q#Image support#, q#en#, q##]];
$Info{q#Image#}->{License} = [[q#%%GPL%%#, q##, q##]];
$Info{q#Image#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]];

push @SuikaWiki::View::Implementation::CommonViewDefs, {
  condition => {q#mode#, q#image_png#, q#http_method#, [q#GET#, q#HEAD#]},
  object_class => q#SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_png1041105052955T1dG#,
};
package SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_png1041105052955T1dG;


our @ISA = q#SuikaWiki::View::template#;

sub main ($$$) {
  my ($self, $opt, $opt2) = @_;
  require SuikaWiki::Output::HTTP;
  $opt2->{output} = SuikaWiki::Output::HTTP->new
    (wiki => $self->{view}->{wiki},
     view => $self->{view}, viewobj => $self);
  for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}},
       'Accept-Language') {
    $opt2->{output}->add_negotiate_header_field ($_);
  }
  
  $opt2->{template} = q#%read (Type => {image/png}, return-type => ToOctetStream,
when-no-converter => 406);#;
  $opt2->{o} = bless {
                      ## SuikaWiki 3 WikiPlugin interface
                        wiki => $self->{view}->{wiki},
                        plugin => $self->{view}->{wiki}->{plugin},
                        var => {},
                      }, 'SuikaWiki::Plugin';  
  $opt2->{output}->{status_code} = 200;
  
  $opt2->{output}->{entity}->{media_type} = q#image/png#;

  
  $opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#image#}});
  $opt2->{output}->{entity}->{body_is_octet_stream} = 1;
  
  $self->{view}->{wiki}->init_db;
  $self->main_pre ($opt, $opt2);
  
  
  use Message::Util::Error;
  try {
    $opt2->{output}->{entity}->{body} 
      = 
        (SuikaWiki::Plugin->formatter ('view')
        ->replace ($opt2->{template}, param => $opt2->{o}));
  } $self->{view}->{wiki}->{config}->{catch}->{ formatter_view };
  $opt2->{output}->output (output => 'http-cgi');
  
  $self->main_post ($opt, $opt2);
}

push @SuikaWiki::View::Implementation::CommonViewDefs, {
  condition => {q#mode#, q#image_jpeg#, q#http_method#, [q#GET#, q#HEAD#]},
  object_class => q#SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_jpeg10411050529556qot#,
};
package SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_jpeg10411050529556qot;


our @ISA = q#SuikaWiki::View::template#;

sub main ($$$) {
  my ($self, $opt, $opt2) = @_;
  require SuikaWiki::Output::HTTP;
  $opt2->{output} = SuikaWiki::Output::HTTP->new
    (wiki => $self->{view}->{wiki},
     view => $self->{view}, viewobj => $self);
  for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}},
       'Accept-Language') {
    $opt2->{output}->add_negotiate_header_field ($_);
  }
  
  $opt2->{template} = q#%read (Type => {image/jpeg}, return-type => ToOctetStream,
when-no-converter => 406);#;
  $opt2->{o} = bless {
                      ## SuikaWiki 3 WikiPlugin interface
                        wiki => $self->{view}->{wiki},
                        plugin => $self->{view}->{wiki}->{plugin},
                        var => {},
                      }, 'SuikaWiki::Plugin';  
  $opt2->{output}->{status_code} = 200;
  
  $opt2->{output}->{entity}->{media_type} = q#image/jpeg#;

  
  $opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#image#}});
  $opt2->{output}->{entity}->{body_is_octet_stream} = 1;
  
  $self->{view}->{wiki}->init_db;
  $self->main_pre ($opt, $opt2);
  
  
  use Message::Util::Error;
  try {
    $opt2->{output}->{entity}->{body} 
      = 
        (SuikaWiki::Plugin->formatter ('view')
        ->replace ($opt2->{template}, param => $opt2->{o}));
  } $self->{view}->{wiki}->{config}->{catch}->{ formatter_view };
  $opt2->{output}->output (output => 'http-cgi');
  
  $self->main_post ($opt, $opt2);
}

push @SuikaWiki::View::Implementation::CommonViewDefs, {
  condition => {q#mode#, q#image_x_icon#, q#http_method#, [q#GET#, q#HEAD#]},
  object_class => q#SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_x_icon1041105052955p_i1#,
};
package SuikaWiki::Plugin::plugin::Image1041105052955rKge::image_x_icon1041105052955p_i1;


our @ISA = q#SuikaWiki::View::template#;

sub main ($$$) {
  my ($self, $opt, $opt2) = @_;
  require SuikaWiki::Output::HTTP;
  $opt2->{output} = SuikaWiki::Output::HTTP->new
    (wiki => $self->{view}->{wiki},
     view => $self->{view}, viewobj => $self);
  for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}},
       'Accept-Language') {
    $opt2->{output}->add_negotiate_header_field ($_);
  }
  
  $opt2->{template} = q#%read (Type => {image/vnd.microsoft.icon}, return-type => ToOctetStream,
when-no-converter => 406);#;
  $opt2->{o} = bless {
                      ## SuikaWiki 3 WikiPlugin interface
                        wiki => $self->{view}->{wiki},
                        plugin => $self->{view}->{wiki}->{plugin},
                        var => {},
                      }, 'SuikaWiki::Plugin';  
  $opt2->{output}->{status_code} = 200;
  
  $opt2->{output}->{entity}->{media_type} = q#image/vnd.microsoft.icon#;

  
  $opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#image#}});
  $opt2->{output}->{entity}->{body_is_octet_stream} = 1;
  
  $self->{view}->{wiki}->init_db;
  $self->main_pre ($opt, $opt2);
  
  
  use Message::Util::Error;
  try {
    $opt2->{output}->{entity}->{body} 
      = 
        (SuikaWiki::Plugin->formatter ('view')
        ->replace ($opt2->{template}, param => $opt2->{o}));
  } $self->{view}->{wiki}->{config}->{catch}->{ formatter_view };
  $opt2->{output}->output (output => 'http-cgi');
  
  $self->main_post ($opt, $opt2);
}

package SuikaWiki::Plugin::Resource;

our $BaseResource;
$BaseResource->{q#en#}->{q##}->{q#Mode:image_x_icon#} = q#Windows Icon#;
$BaseResource->{q#und#}->{q##}->{q#Mode#} = q#image_jpeg#;
$BaseResource->{q#und#}->{q##}->{q#lang#} = q#en#;
$BaseResource->{q#en#}->{q##}->{q#Mode:image_png#} = q#PNG image#;
package SuikaWiki::Plugin::Registry;

$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#}]};

1;
