~ubuntu-branches/ubuntu/saucy/padre/saucy-proposed

« back to all changes in this revision

Viewing changes to lib/Padre/Wx/App.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
use 5.008;
31
31
use strict;
32
32
use warnings;
33
 
use threads;
34
 
use threads::shared;
35
 
use Wx                     ();
36
 
use Padre::Wx::Frame::Null ();
37
 
 
38
 
# use Padre::Logger;
39
 
 
40
 
our $VERSION = '0.90';
 
33
use Padre::Wx ();
 
34
 
 
35
our $VERSION = '0.92';
41
36
our @ISA     = 'Wx::App';
42
37
 
43
38
 
44
39
 
45
40
 
46
41
 
47
 
######################################################################
48
 
# Singleton Support
49
 
 
50
 
my $SINGLETON = undef;
51
 
 
52
 
sub new {
53
 
        unless ($SINGLETON) {
54
 
                $SINGLETON = shift->SUPER::new;
55
 
                $SINGLETON->{conduit} = Padre::Wx::Frame::Null->new;
56
 
                $SINGLETON->{conduit}->conduit_init;
57
 
        }
58
 
        return $SINGLETON;
59
 
}
60
 
 
61
 
 
62
 
 
63
 
 
64
 
 
65
42
#####################################################################
66
43
# Constructor and Accessors
67
44
 
68
45
sub create {
69
 
        my $self = shift->new;
70
 
 
71
 
        # Save a link back to the parent ide
 
46
        my $class = shift;
 
47
        my $self  = $class->new;
 
48
 
 
49
        # Check we only set up the application once
 
50
        if ( $self->{ide} ) {
 
51
                die "Cannot instantiate $class multiple times";
 
52
        }
 
53
 
 
54
        # Save a link back to the IDE object
72
55
        $self->{ide} = shift;
73
56
 
74
 
        # Immediately populate the main window
 
57
        # Immediately build the main window
75
58
        require Padre::Wx::Main;
76
59
        $self->{main} = Padre::Wx::Main->new( $self->{ide} );
77
60
 
82
65
        return $self;
83
66
}
84
67
 
 
68
# Compulsory Wx methods
 
69
sub OnInit {
 
70
        my $self = shift;
 
71
 
 
72
        # Bootstrap some Wx internals
 
73
        Wx::Log::SetActiveTarget( Wx::LogStderr->new );
 
74
 
 
75
        # Create the PlThreadEvent receiver
 
76
        require Padre::Wx::Frame::Null;
 
77
        $self->{conduit} = Padre::Wx::Frame::Null->new;
 
78
        $self->{conduit}->conduit_init;
 
79
 
 
80
        # Return true to continue
 
81
        return 1;
 
82
}
 
83
 
 
84
# Clean up in reverse order
 
85
sub OnExit {
 
86
        my $self = shift;
 
87
 
 
88
        # Action queue
 
89
        if ( defined $self->{queue} ) {
 
90
                delete $self->{queue};
 
91
        }
 
92
 
 
93
        # Main window
 
94
        if ( defined $self->{main} ) {
 
95
                delete $self->{main};
 
96
        }
 
97
 
 
98
        # PlThreadEvent conduit
 
99
        if ( defined $self->{conduit} ) {
 
100
                $self->{conduit}->Destroy;
 
101
                delete $self->{conduit};
 
102
        }
 
103
 
 
104
        # IDE object
 
105
        if ( defined $self->{ide} ) {
 
106
                delete $self->{ide};
 
107
        }
 
108
 
 
109
        return 1;
 
110
}
 
111
 
85
112
=pod
86
113
 
87
114
=head2 C<ide>
144
171
        $_[0]->{conduit};
145
172
}
146
173
 
147
 
 
148
 
 
149
 
 
150
 
 
151
 
######################################################################
152
 
# Compulsory Wx Methods
153
 
 
154
 
sub OnInit {
155
 
        return 1;
156
 
}
157
 
 
158
174
1;
159
175
 
160
176
=pod