37
5 tips and 4 and ½ tricks for porting GNOME applications to Maemo platform Eduardo Lima (Etrunko) 8 th GUADEC, Birmingham, UK

5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Embed Size (px)

DESCRIPTION

Presention at 8th GUADEC, held in Birmingham, UK in 2007

Citation preview

Page 1: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

5 tips and 4 and ½ tricks for porting GNOME applications

to Maemo platform

Eduardo Lima (Etrunko)8th GUADEC, Birmingham, UK

Page 2: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

About INdT

● Instituto Nokia de Tecnologia● Founded by Nokia do Brasil● R&D for mobile devices● About 200 employees● Partnership with universities● Three main sites:

– Manaus– Brasilia– Recife

Page 3: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

About INdT – Recife Site

● About 40 employees● Focused on OSS for mobile devices

– Nokia Internet Tablets (770 and N800)– S60 smartphones

● Some projects– Canola– Python for Maemo– Tapioca– Maemo Games– Maemo SDK VMWare/Qemu Appliances

– Carman– Mamona– Gmyth– Evas optimization

Page 4: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Why Porting Applications?

● GNOME is mobile as well

Page 5: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other Reasons

● Bring new experiences to Maemo devices● Replacement of built-in applications● All advantages of FOSS

– New features implemented– Bug fixes and improvements– Community of users testing and reporting

bugs

● Yet another way to contribute to projects● “Don't reinvent the wheel!”

Page 6: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Some Restrictions

● Small screen (Good resolution)– Reduced usable area

● Processor power– 220 MHz (770)– 320 MHz (N800)

● RAM– 64 MB (770)– 128 MB (N800)– No swap (can be activated)

● DSP

Page 7: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Some (more) Restrictions

● Limited storage (JFFS2 helps)– 128 MB (770)– 256 MB (N800)

● No FPU in 770● Power consumption● Maemo patched libraries

– Old versions– Can't just be upgraded

● Scratchbox environment

Page 8: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

First Steps

● Install scratchbox environment● Install Maemo SDK (i386 and armel)

– Bora for N800– Gregale for 770

● Find yourself a device (if possible)● Pick an application

– Study the code– Find the libraries it depends on

Page 9: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Feasibility Of The Port

● Check the dependencies– libbonobo/libbonoboui– libgnomeprint/libgnomeprintui– libgnome/libgnomeui– libgnomecanvas– gnomekeyring

● Processor power required● Storage required● Memory consumption

Page 10: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Getting Rid Of GNOME Stuff

● Some things can just be replaced– Help– Icon lookup

● Other things must go within #ifdef blocks– GnomeProgram– Session management– Synchronize accelerators

● Add configure checks for specific bits

Page 11: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Example: Gnumeric

Page 12: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

It Works!

Page 13: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Brief Analysis Of The Screen

Page 14: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Great Resolution

Page 15: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Reduced Usable Area

Page 16: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Using The Virtual Keyboard

Page 17: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Using The Virtual Keyboard

Page 18: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Toolbar

Page 19: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Toolbar

Page 20: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Virtual Keyboard + Toolbar

Page 21: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Virtual Keyboard + Toolbar

Page 22: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

And so on...

Page 23: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

And so on...

Page 24: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Summary

● Use hildon stuff– Program/Window– Menu– Toolbars– Tap and hold– Dialogs (Open, Save, Fonts, Colors, etc)

● Hide anything else– Status bars– Other widgets

● Focus on the purpose of the application

Page 25: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Hildonization

● Replace the toplevel GtkWindow by a HildonWindow

● Get a HildonProgram instance● Add the HildonWindow to HildonProgram● Change GtkMenuBar to a regular

GtkMenu● Add GtkMenu to HildonWindow● Add GtkToolbar objects to HildonWindow● Add configure checks for Hildon libraries

Page 26: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

How does it look like?

Page 27: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other tips

● Set application name– g_set_application_name()

● Unset HildonWindow settings properties– gtk-button-images and gtk-menu-images

● Register the application with libosso– osso_initialize() and osso_deinitialize()– D-Bus service file (/usr/share/dbus-1/services)

● .desktop files go to another location– /usr/share/applications/hildon

Page 28: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Almost finished

● Build packages for everything– Both i386 and armel targets

● Test the packages in the device– Scratchbox armel emulation does not work

● Publish the packages, preferably by apt● Submit patches!

Page 29: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Challenges

● Dialogs usually are not developed taking small screens into account

● Reduce installation size– Documentation– Translations

● Debian packaging is boring● Acceptable performance

Page 30: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other ports (Abiword)

Page 31: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other ports (Evince)

Page 32: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other ports (Gconf Editor)

Page 33: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other ports (Rhythmbox)

Page 34: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other ports (Leafpad)

Page 35: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Other ports (Xournal)

Page 36: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform
Page 37: 5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Thank [email protected]

http://etrunko.blogspot.com