Gimp/plug-ins/perl/examples/example-oo.pl

38 lines
876 B
Perl
Raw Normal View History

1998-10-23 06:34:08 -07:00
#!/usr/bin/perl
# this extension shows some oo-like calls
# it's really easy
use Gimp;
# the extension that's called.
sub plug_in_example_oo {
my $img=new Image(300,200,RGB);
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
my $bg=new Layer($img,300,200,RGB_IMAGE,"Background",100,NORMAL_MODE);
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
Palette->set_background([200,200,100]);
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
$bg->fill(BG_IMAGE_FILL);
# Palette->set_background([200,100,200]);
# gimp_drawable_fill ($bg,BG_IMAGE_FILL);
$img->add_layer($bg,1);
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
new Display($img);
}
1999-12-01 20:55:44 -08:00
Gimp::on_run {
1998-10-23 06:34:08 -07:00
plug_in_example_oo;
1999-12-01 20:55:44 -08:00
};
1998-10-23 06:34:08 -07:00
1999-12-01 20:55:44 -08:00
Gimp::on_query {
1998-10-23 06:34:08 -07:00
gimp_install_procedure("plug_in_example_oo", "a test plug-in in perl",
"try it out", "Marc Lehmann", "Marc Lehmann", "1998-04-27",
1999-11-29 13:46:18 -08:00
N_"<Toolbox>/Xtns/Perl Example Plug-in", "*", PROC_EXTENSION,
1998-10-23 06:34:08 -07:00
[[PARAM_INT32, "run_mode", "Interactive, [non-interactive]"]], []);
1999-12-01 20:55:44 -08:00
};
1998-10-23 06:34:08 -07:00
1999-02-22 13:51:18 -08:00
exit main;
1998-10-23 06:34:08 -07:00