App-XUL
view release on metacpan or search on metacpan
lib/App/XUL.pm view on Meta::CPAN
content: <STRING>
}
<TRIGGER> := {
action: "trigger",
id: <ID>,
name: <STRING>
}
<REGISTER> := {
action: "register",
id: <ID>,
name: <STRING>,
callback: <STRING>
}
<UNREGISTER> := {
action: "unregister",
id: <ID>,
name: <STRING>
}
<SETATTR> := {
action: "setattr",
id: <ID>,
name: <STRING>,
value: <STRING>
}
<GETATTR> := {
action: "getattr",
id: <ID>,
name: <STRING>
}
Here are some examples of client requests:
{event:"click", id:"btn"}
Here are some examples of server responses:
{action:"update", id:"btn", attributes:{label:"Alrighty!"}}
{action:"remove", id:"btn"}
{action:"create", parent:"main", content:"<button .../>"}
=head3 Application bundling for Mac OS X
Mac applications are simply directories whose names end with ".app"
and have a certain structure and demand certain files to exist.
This is the structure of a XUL application wrapped inside a Mac application
as created by App::XUL (files are blue, directories are black):
=begin html
<pre>
MyApp.app/
Contents/
<span style="color:blue;font-weight:bold">Info.plist</span>
Frameworks/
XUL.framework/
<i>The XUL Mac framework</i>
MacOS
<span style="color:blue;font-weight:bold">start.pl</span> (Perl-Script)
Resources
<span style="color:blue;font-weight:bold">application.ini</span>
<span style="color:blue;font-weight:bold">MyApp.icns</span>
chrome/
<span style="color:blue;font-weight:bold">chrome.manifest</span>
content/
<span style="color:blue;font-weight:bold">AppXUL.js</span>
<span style="color:blue;font-weight:bold">myapp.xul</span>
defaults/
preferences/
<span style="color:blue;font-weight:bold">prefs.js</span>
perl/
server/
<span style="color:blue;font-weight:bold">server.pl</span>
modules/
<i>All Perl modules the server depends on</i>
extensions/
updates/
0/
</pre>
=end html
The various files have specific functions. When the MyApp.app is
clicked, the B<start.pl> program is executed which then starts the
server and the client:
=over 1
=item Info.plist
Required by Mac OS X. This is the place where certain basic information
about the application is read by Mac OS X, before anything else is done.
For example, here the start.pl program is defined as the entry point
of the application.
=item start.pl
First program to be executed. Starts server and client.
=item application.ini
Setups the XUL application. Defines which *.xul files to load,
name of application etc.
=item AppXUL.js
Defines all Javascript functions used by App::XUL to manage the
communication with the server.
=item myapp.xul
Defines the basic UI for the XUL application.
=item prefs.js
Sets some preferences for the XUL application.
=item server.pl
This starts the server.
=back
=head3 Application bundling for Windows
tbd. Use L<NSIS|http://nsis.sourceforge.net/Main_Page> or
L<InstallJammer|http://www.installjammer.com/>.
=head3 Application bundling as DEB package
tbd. See L<Link|http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html>.
=head3 Application bundling as RPM package
( run in 1.394 second using v1.01-cache-2.11-cpan-39bf76dae61 )