~ubuntu-branches/ubuntu/wily/padre/wily

« back to all changes in this revision

Viewing changes to lib/Padre/Document.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2009-05-09 18:19:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090509181953-ttew3adppp057nha
Tags: 0.35-1
* New Upstream Version

* install eg/ as examples only in padre (not also in libwx-perl-
  dialog-perl)
* mention --pristine-tar in README.source
* add disable-tcp-server.patch
  the tcp server is used for communication with running instance of padre.
  Although it only listens on 127.0.0.1, there is no measures taken to
  ensure that the user connecting to the server is the same as the user
  running padre.
* add README.debian documenting changes in the package compared to
  upstream sources

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
use Padre::Wx      ();
54
54
use Padre          ();
55
55
 
56
 
our $VERSION = '0.34';
 
56
our $VERSION = '0.35';
57
57
 
58
58
# NOTE: This is probably a bad place to store this
59
59
my $unsaved_number = 0;
63
63
 
64
64
# This is the list of binary files
65
65
# (which we don't support loading in fallback text mode)
66
 
our %EXT_BINARY = (
67
 
        aiff => 1, au   => 1, avi => 1, bmp => 1, cache => 1, dat  => 1, doc => 1, gif => 1, gz  => 1, icns => 1,
68
 
        jar  => 1, jpeg => 1, jpg => 1, m4a => 1, mov   => 1, mp3  => 1, mpg => 1, ogg => 1, pdf => 1, png  => 1,
69
 
        pnt  => 1, ppt  => 1, qt  => 1, ra  => 1, svg   => 1, svgz => 1, svn => 1, swf => 1, tar => 1, tgz  => 1,
70
 
        tif  => 1, tiff => 1, wav => 1, xls => 1, xlw   => 1, zip  => 1,
71
 
);
 
66
our %EXT_BINARY = map { $_ => 1 } qw{
 
67
        aiff  au    avi  bmp  cache  dat   doc  gif  gz   icns
 
68
        jar   jpeg  jpg  m4a  mov    mp3   mpg  ogg  pdf  png
 
69
        pnt   ppt   qt   ra   svg    svgz  svn  swf  tar  tgz
 
70
        tif   tiff  wav  xls  xlw    zip
 
71
};
72
72
 
73
73
# This is the primary file extension to mime-type mapping
74
74
our %EXT_MIME = (
166
166
);
167
167
 
168
168
# This is the mime-type to document class mapping
169
 
our %MIME_CLASS = ( 'application/x-perl' => 'Padre::Document::Perl', 'text/x-pod' => 'Padre::Document::POD', );
 
169
our %MIME_CLASS = (
 
170
        'application/x-perl' => 'Padre::Document::Perl',
 
171
        'text/x-pod'         => 'Padre::Document::POD',
 
172
);
170
173
 
171
174
sub menu_view_mimes {
172
175
        '00Plain Text'     => 'text/plain',
323
326
}
324
327
 
325
328
sub mime_type_by_extension {
326
 
        my ( $self, $ext ) = @_;
327
 
        return $EXT_MIME{$ext};
 
329
        $EXT_MIME{ $_[1] };
328
330
}
329
331
 
330
332
# For ts without a newline type
338
340
        my ($text) = @_;
339
341
        return if not $text;
340
342
        return 1 if $text =~ /^=begin\s+pod/msx;
341
 
        return   if $text =~ /^=head[12]/msx;                               # needed for eg/perl5_with_perl6_example.pod
 
343
 
 
344
        # Needed for eg/perl5_with_perl6_example.pod
 
345
        return if $text =~ /^=head[12]/msx;
 
346
 
342
347
        return 1 if $text =~ /^\s*use\s+v6;/msx;
343
348
        return 1 if $text =~ /^\s*(?:class|grammar|module|role)\s+\w/msx;
344
349
        return;
821
826
 
822
827
Returns nothing.
823
828
 
 
829
=head2 event_on_left_up
 
830
 
 
831
NOT IMPLEMENTED IN THE BASE CLASS
 
832
 
 
833
This method - if implemented - is called when a user left-clicks in an 
 
834
editor. This can be used to implement context-sensitive actions if
 
835
the user presses modifier keys while clicking.
 
836
 
 
837
Parameters retrieved are the objects for the document, the editor,
 
838
and the event.
 
839
 
 
840
Returns nothing.
 
841
 
824
842
=cut
825
843
 
826
844
#####################################################################