Alfie wrote:
> I notice that the Getting Started applet is a full screen 
> Flash application.

yep

> Does anyone know how this is achieved, specifically:
> -          How to add to start menu
> -          How to add to desktop

This is basically a distinct application/applet.

> -          How to launch the swf

It creates a browser eal instance and then asks the eal to load a url,
which happens to be flash.
As it happens, the application doesn't depend on flash, and it doesn't
ensure that flash is available.

If you're going to implement something like this, please ensure the
following:

1. your application has a depends: adobe-flashplayer |
macromedia-flashplayer
2. you have your own profile directory with a plugins directory
containing a symlink to the flash player library
3. provide a desktop file that claims to handle .swf and the mime type

Here's a fairly short overview of what it does (written in C++ coding
style so I can declare variables as I need them; note that proper
release of modules and similar is not implemented in this quick
description):

/* XXX there is *no* function which lets you get the user's prefered
browser,
 *     and in fact there's virtually no way to figure out which ones are
available.
 *     we hard code microb-eal.
 */
#define EAL_BROWSER "microb-eal"

 GModule* module = g_module_open("/usr/lib/lib" EAL_BROWSER ".so.0",
G_MODULE_BIND_LAZY);
 if (g_module_error())
   return 0;
 setenv("MOZ_COMP_PATH_OVERRIDE", ".swfplayer", 1);
 setenv("MOZ_PROFILE_OVERRIDE", "FlashPlayer", 1);
 if (!g_module_symbol(module, "g_web_set_env", (gpointer *)
&web_set_env))
   return 0; 
 if (!g_module_symbol(module, "g_web_new", (gpointer*) &web_get_new))
   return 0; 
 web_set_env();
 GWeb* web = web_get_new();
 if (!web)
   return 0;
 /* this code is a copy of code copied from code copied from svn which
you can read at
  *
http://timeless.justdave.net/mxr-test/garage/source/browser/browser-ui/t
runk/eal-test/src/main.c
  * however, do note the / between the VendorName and the Version.
  * This is required by the UserAgent specification,
  * which is unfortunately not followed by the example above, nor by the
people who copied it.
  */
 g_web_set_ua_string(web, "SWFPlayer/0.1");
 GWebEngine* engine = g_web_new_web_engine_window_with_context(web,
NULL, FALSE, FALSE);
 if (!engine)
   return 0;
 GObject* widget = g_web_engine_get_engine_widget(engine);
 gtk_fixed_put(GTK_FIXED(container), GTK_WIDGET(widget), 0, 0);
 gtk_widget_set_size_request(GTK_WIDGET(widget), 0, 0);
 gtk_widget_show(GTK_WIDGET(widget));
 GObject* notify = g_web_engine_get_engine_notifier(engine);
 g_signal_connect(notify, G_WEBWIDGET_SIGNAL_FINISHED_LOADING,
G_CALLBACK(finished_loading), NULL);
 g_web_engine_load_url(web, "file:///tmp/foo.swf");

Note: none of the code to do shutdown is included here. The plugin
directory should be /home/user/.swfplayer/plugins

> -          Does it have to be full screen?

No, the player happens to hard code this.

> I'm interested in how one might write applications for OS2008 
> using Flash alone, in order to make development easier for 
> the new breed of Flex developers!

There's actually a browser bug that's catching people unhappy. And given
the existence of the tutorial, I'm going to see if I can solve it.
However if you get a working standalone player sooner, all the better.

Note: it'd be great if you could use rewrite the browser .desktop file
in a postinst.
For an example, see
http://timeless.justdave.net/maemo/microb-pageupdown-0.1/DEBIAN/postinst
http://timeless.justdave.net/maemo/microb-pageupdown-0.1/DEBIAN/postrm

It should be something like this:
PREFFILE=/usr/share/applications/hildon/browser.desktop
PREFBACK="$PREFFILE.flash-mimetype"
OLDPREF='(MimeType.*)application\/x-shockwave-flash;'
OLDPREFG='MimeType.*application\/x-shockwave-flash;'
NEWPREF='\1application\/x-shockwave-flash-in-browser;'

(not tested)

> Does anyone think it would be possible to develop Flash apps 
> that make use of the Hildon menus, etc? This would presumably 
> need native calls from Flash and I'm not sure this is 
> currently possible.

That's a question for people who probably can't comment. Good luck.

> In the medium/long term it would be great to see Adobe AIR 
> fully supported on OS2008. See http://www.adobe.com/devnet/air.

That seems unlikely.
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to