POE::XUL::ChangeManager - Keep POE::XUL in sync with the browser DOM
Not used directly. See POE::XUL and POE::XUL::Event.
The ChangeManager is responsible for tracking and sending all changes to a POE::XUL::Node to its corresponding DOM element. It also handles any side-effects of a DOM event that was sent from the browser.
There is only one ChangeManager per application. The application never accesses the ChangeManager directly, but rather by manipulating POE::XUL::Node.
Because there may be multiple application instances within a given process, the link between POE::XUL::Node and the ChangeManager is handled by POE::XUL::Event. Changes to a node must happen within "wrap" in POE::XUL::Event. This is done for you in the initial POE event. It must be done explicitly if you chain the initial POE event to furthur POE events.
There is only one method that will be useful for application writers:
pxInstructions( @instructions ); $CM->instruction( $inst ); $CM->instruction( [ $inst, @params ] );
Send instructions to the javascript client library. Instructions are a HACK to quickly work around XUL and/or POE::XUL::Node limitations.
$inst may be simply an instruction name, or an arrayref, the first element of which is the instruction name.
$inst
Current instructions are:
Empties all pending changes, returns the arrayref of those changes.
All currently known commands are put into the output buffer. Combined with timeslice, it allows some control over the order in which commands are executed.
timeslice
Tells the javascript client library to give up a timeslice. The idea is to give the browser time to render any new XBL. Because it is impossible to find out when all XBL has finished rendering, the timeslice is handled by pausing for 5 milliseconds.
To be very useful, you should preceed this with a "flush".
pxInstruction( [ popup_window => $id, $features ] );
PLEASE USE "open" in POE::XUL::Window INSTEAD.
Tell the client library to create a new window. The new window's name will be $id. The new window will be created with the features defined in $features: width, height, location, menubar, toolbar, status, scrollbars. The following features are always yes: resizable, dependent. See http://developer.mozilla.org/en/docs/DOM:window.open for an explanation of what they mean.
$id
$features
width
height
location
menubar
toolbar
status
scrollbars
yes
resizable
dependent
Once the window is opened, it will load /popup.xul?app=$APP&SID=$SID (where $APP is the current application and $SID is the session ID of the current application instance). popup.xul will then send a connect event. See "connect" in POE::XUL.
/popup.xul?app=$APP&SID=$SID
$APP
$SID
popup.xul
connect
pxInstruction( [ close_window => $id ] );
PLEASE USE "close" in POE::XUL::Window INSTEAD.
Closes the window $id. This will provoke a disconnect event. See "disconnect" in POE::XUL.
disconnect
Philip Gwyn <gwyn-at-cpan.org>
Based on XUL::Node by Ran Eilam.
Copyright 2007-2010 by Philip Gwyn. All rights reserved;
Copyright 2003-2004 Ran Eilam. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl(1), POE::XUL, POE::XUL::Event.
To install POE::XUL::RDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::XUL::RDF
CPAN shell
perl -MCPAN -e shell install POE::XUL::RDF
For more information on module installation, please visit the detailed CPAN module installation guide.