| 1 | package Padre::Plugin::ShellScript; | ||
| 2 | 1 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | $Padre::Plugin::ShellScript::VERSION = '0.03'; | |
| 4 | } | ||
| 5 | |||
| 6 | # ABSTRACT: Shell script support for Padre | ||
| 7 | |||
| 8 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | ▶ | use base 'Padre::Plugin'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 0 | ▶ | use Wx (); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 14 | use File::Spec::Functions qw{ catfile }; | ||
| 15 | |||
| 16 | # The plugin name to show in the Plugin Manager and menus | ||
| 17 | sub plugin_name { | ||
| 18 | Wx::gettext('Shell Script'); | ||
| 19 | } | ||
| 20 | |||
| 21 | # Declare the Padre interfaces this plugin uses | ||
| 22 | sub padre_interfaces { | ||
| 23 | 'Padre::Plugin' => 0.89, 'Padre::Document' => 0.89, 'Padre::Wx::Main' => 0.89; | ||
| 24 | } | ||
| 25 | |||
| 26 | sub registered_documents { | ||
| 27 | 'application/x-shellscript' => 'Padre::Document::ShellScript'; | ||
| 28 | } | ||
| 29 | |||
| 30 | sub plugin_icon { | ||
| 31 | my $self = shift; | ||
| 32 | |||
| 33 | # find resource path | ||
| 34 | my $iconpath = catfile( $self->plugin_directory_share, 'icons', 'gnome-mime-text-x-sh.png' ); | ||
| 35 | |||
| 36 | # create and return icon | ||
| 37 | return Wx::Bitmap->new( $iconpath, Wx::wxBITMAP_TYPE_PNG ); | ||
| 38 | } | ||
| 39 | |||
| 40 | # The command structure to show in the Plugins menu | ||
| 41 | sub menu_plugins_simple { | ||
| 42 | my $self = shift; | ||
| 43 | 'Shell Script' => [ Information => sub { $self->info() } ]; | ||
| 44 | } | ||
| 45 | |||
| 46 | sub info { | ||
| 47 | my $self = shift; | ||
| 48 | |||
| 49 | # Generate the About dialog | ||
| 50 | my $about = Wx::AboutDialogInfo->new; | ||
| 51 | $about->SetName( Wx::gettext('Shell Script Plugin') ); | ||
| 52 | $about->SetDescription('Use the Run menu to run and debug shell scripts.'); | ||
| 53 | |||
| 54 | # Show the About dialog | ||
| 55 | Wx::AboutBox($about); | ||
| 56 | |||
| 57 | return; | ||
| 58 | } | ||
| 59 | 1; | ||
| 60 | |||
| 61 | |||
| 62 | =pod | ||
| 63 | |||
| 64 | =head1 NAME | ||
| 65 | |||
| 66 | Padre::Plugin::ShellScript - Shell script support for Padre | ||
| 67 | |||
| 68 | =head1 VERSION | ||
| 69 | |||
| 70 | version 0.03 | ||
| 71 | |||
| 72 | =head1 NAME | ||
| 73 | |||
| 74 | Padre::Plugin::ShellScript - L<Padre> and ShellScript | ||
| 75 | |||
| 76 | =head1 AUTHOR | ||
| 77 | |||
| 78 | Claudio Ramirez C<< <padre.claudio@apt-get.be> >> | ||
| 79 | |||
| 80 | =head1 COPYRIGHT & LICENSE | ||
| 81 | |||
| 82 | Copyright 2009-2010 Claudio Ramirez all rights reserved. | ||
| 83 | |||
| 84 | This program is free software; you can redistribute it and/or modify it | ||
| 85 | under the same terms as Perl itself. | ||
| 86 | |||
| 87 | =head1 AUTHORS | ||
| 88 | |||
| 89 | =over 4 | ||
| 90 | |||
| 91 | =item * | ||
| 92 | |||
| 93 | Claudio Ramirez <padre.claudio@apt-get.be> | ||
| 94 | |||
| 95 | =item * | ||
| 96 | |||
| 97 | Zeno Gantner <zenog@cpan.org> | ||
| 98 | |||
| 99 | =back | ||
| 100 | |||
| 101 | =head1 COPYRIGHT AND LICENSE | ||
| 102 | |||
| 103 | This software is copyright (c) 2011 by Claudio Ramirez, Zeno Gantner. | ||
| 104 | |||
| 105 | This is free software; you can redistribute it and/or modify it under | ||
| 106 | the same terms as the Perl 5 programming language system itself. | ||
| 107 | |||
| 108 | =cut | ||
| 109 | |||
| 110 | |||
| 111 | __END__ | ||