Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

My first Maemo desktop widget

3,029 views

Published on

Presentation given at the Maemo Barcelona Long Weekend on how to develop desktop widgets.

Published in: Technology
  • Be the first to comment

My first Maemo desktop widget

  1. 1. Marc Ordinas i Llopis marcoil My first desktop widget
  2. 2. Desktop Widgets <ul><li>Normal windows with special type: </li></ul><ul><ul><li>_NET_WM_WINDOW_TYPE: _HILDON_WM_WINDOW_TYPE_HOME_APPLET </li></ul></ul><ul><li>Composited by the desktop on home </li></ul>
  3. 3. libhildondesktop <ul><li>Lifetime management and positioning </li></ul><ul><li>Utility class HDHomePluginItem </li></ul><ul><li>Visibility and settings </li></ul><ul><li>Code at http://maemo.gitorious.org/fremantle-hildon-desktop/libhildondesktop </li></ul>
  4. 4. Lifetime management <ul><li>Desktop file describes the widget </li></ul><ul><li>Library loaded by hildon-home </li></ul><ul><li>Position kept in GConf </li></ul><ul><li>Please see the example at </li></ul><ul><li>https://garage.maemo.org/svn/maemoexamples/trunk/example_desktop_widget/ </li></ul>
  5. 5. HDHomePluginItem <ul><li>Base class for desktop widgets </li></ul><ul><li>Derived from GtkWindow </li></ul><ul><ul><li>Use as a container. </li></ul></ul><ul><ul><li>Or, draw directly using cairo. </li></ul></ul>
  6. 6. Energy saving <ul><li>is-on-current-desktop property </li></ul><ul><li>Listen to notification changes </li></ul><ul><ul><li>notify::is-on-current-desktop </li></ul></ul><ul><li>If not visible </li></ul><ul><ul><li>Don't draw </li></ul></ul><ul><ul><li>Use as few resources as possible </li></ul></ul>
  7. 7. Settings <ul><li>Set property </li></ul><ul><ul><li>HDHomePluginItem::settings </li></ul></ul><ul><li>Listen to signal </li></ul><ul><ul><li>HDHomePluginItem::show-settings </li></ul></ul>
  8. 8. Transparency <ul><li>In the realize method </li></ul><ul><ul><li>Set colormap to RGBA. </li></ul></ul><ul><ul><li>Set app paintable to true. </li></ul></ul><ul><li>In the expose_event method </li></ul><ul><ul><li>Draw directly (using cairo, for example). </li></ul></ul>
  9. 9. Questions? Examples at https://garage.maemo.org/projects/maemoexamples/

×