[Catalyst-commits] r6423 - trunk/Catalyst-Engine-Wx/lib/Catalyst/Engine

eriam at dev.catalyst.perl.org eriam at dev.catalyst.perl.org
Wed May 23 19:52:00 GMT 2007


Author: eriam
Date: 2007-05-23 19:51:59 +0100 (Wed, 23 May 2007)
New Revision: 6423

Modified:
   trunk/Catalyst-Engine-Wx/lib/Catalyst/Engine/Wx.pm
Log:
Change session name and add the option to specifiy with which controller the application is bootstrapped.

Modified: trunk/Catalyst-Engine-Wx/lib/Catalyst/Engine/Wx.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/lib/Catalyst/Engine/Wx.pm	2007-05-23 18:48:50 UTC (rev 6422)
+++ trunk/Catalyst-Engine-Wx/lib/Catalyst/Engine/Wx.pm	2007-05-23 18:51:59 UTC (rev 6423)
@@ -23,29 +23,32 @@
    my ( $self, $class, $options ) = @_;
    
    $options ||= {};
+   $self->{bootstrap}  = delete $options->{bootstrap} || '/';
    
    POE::Session->create(
       object_states => [
          $self => [ 
             'EVENT_REQUEST',
-            '_PULSE',
+            '_PULSE'
          ],
       ],
       inline_states => {
-         _start => sub {    
+         _start      => sub {    
                my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION];
-               
-               $heap->{start_time} = time();
 
                $heap->{'class'} = $class;
                
-               $kernel->alias_set('_WAXALYST');
+               $kernel->alias_set('catalyst-wxperl');
                         
-               POE::Kernel->post('_WAXALYST', '_KEEPALIVE');
-               POE::Kernel->post('_WAXALYST', '_PULSE');
+               POE::Kernel->post('catalyst-wxperl', '_KEEPALIVE');
+               POE::Kernel->post('catalyst-wxperl', '_PULSE');
             },
-         _KEEPALIVE => sub { $_[KERNEL]->delay('_KEEPALIVE', 20); },
-         _stop => sub { $_[KERNEL]->delay('_KEEPALIVE'); }
+         _KEEPALIVE  => sub {
+               $_[KERNEL]->delay('_KEEPALIVE', 20);
+            },
+         _stop       => sub {
+               $_[KERNEL]->delay('_KEEPALIVE');
+            }
       }
    );
 
@@ -56,12 +59,15 @@
 }
 
 sub _PULSE {
-   my ($kernel, $heap, $session, $request) = @_[KERNEL, HEAP, SESSION, ARG0];
-   $heap->{'class'}->handle_request;
+   my ($self, $kernel, $heap, $session, $request) = @_[OBJECT, KERNEL, HEAP, SESSION, ARG0];
+   
+   $heap->{'class'}->handle_request({
+      controller  => $self->{bootstrap},
+   });
 }
             
 sub EVENT_REQUEST {
-   my ($kernel, $heap, $session, $request) = @_[KERNEL, HEAP, SESSION, ARG0];
+   my ($self, $kernel, $heap, $session, $request) = @_[OBJECT, KERNEL, HEAP, SESSION, ARG0];
    $heap->{'class'}->handle_request($request);
 }
 
@@ -69,7 +75,7 @@
    my ( $self, $c, $request ) = @_;
    
    my $controller = $request->{'controller'} || '/';
-
+   
    foreach (keys %{ $request }) {
       $c->request->parameters->{$_} = $request->{$_};
    }
@@ -114,8 +120,14 @@
 =head1 DESCRIPTION
 
 This is the Catalyst engine specialized for building non-blocking and
-multi-platforms desktop applications with the Catalyst framework.
+multi-platforms desktop applications with the Catalyst framework. It
+allows to tie Wx events to Catalyst controllers asychronously.
 
+It will also allow you to replace html views with Wx views from which you
+can access the stash and deals with controllers just like in any other
+Catalyst application running a web engine.
+
+
 =head1 AUTHORS
 
 Eriam Schaffter, C<eriam at cpan.org>




More information about the Catalyst-commits mailing list