Hacking Sugar

From OLPC
Revision as of 16:26, 19 September 2007 by Edsiper (talk | contribs) (→‎Sugar)
Jump to navigation Jump to search

Introduction

Hacking Sugar is a public resource for developers that want to get involved in the Sugar Shell development. Here you can find useful information about how to hack/write new sugar components or write external activities and how to integrate them in Sugar.

Sugar is a big opportunity for developers, you can get involved and get the chance to create and improve this wonderful graphical Shell

Motivation

In the latest two years, OLPC has developed and improved a lot of components for the XO platform, including Hardware, Firmwares, Linux Devices Drivers and a graphical shell for kids called Sugar. Start to work in a open source project, sometimes can be a little difficult if you don't have an updated documentation about "how this piece of software work?", and you have to spent some time reading the source code.

The OLPC project, specially Sugar is changing every day, new API, new components, new ideas, etc. The main idea of "Hacking Sugar" is to write a collaborative document where you can find the exactly information about your needs and a lot of tips from experienced developers.

Is this document for me ?

Every time that we read some document, we ask our self if the document is what that we want, so let's do some questions before to spent some hours reading this:

  • do I have a developer skill, if don't, do I would like to have one?
  • do I want to learn a lot of Python, GTK, and Sugar Internals ?
  • do I want to contribute to put a better laptop in the hands of every child ?

well, if you are reading this line I'm happy that we got a new contributor.

Sugar

Sugar is the core of the OLPC Human Interface. Its goal is to turn the Laptop into a fun, easy to use, social experience that promotes sharing and learning. Our first steps, is learn how sugar works, in order to do that, is necessary to have some basic Python knowledge , if you don't know about python, you can learn about it in http://www.diveintopython.org , please read the book, do so examples and come back here :) .

Sugar is not a Desktop as Gnome, KDE or XFCE, it's a Graphical Shell for Kids and this shell has been written from scratch following the HIG (Human Interface Guidelines). So every change, feature or new component in the core of sugar must be approved by the designer team.

This great UI (user interface), needs external components to work in a better way (similar to normal Desktops), as base, we need a Linux OS (no restricted distribution) and aditional software as:

  • D-Bus
  • HAL
  • Hippo-Canvas
  • GTK+
  • Avahi
  • Matchox Window Manager
  • Network Manager
  • Others...

How Sugar takes the control?

Talking about code, Sugar is a GTK+ program that require a Windows Manager and a X Server. A main python script called sugar-shell execute the matchbox-window-manager and this last one connect to the X server, and then the script stay in the gtk main loop. Now we have a main window as an UI and have the control. Please take a look to:

http://dev.laptop.org/git?p=sugar;a=blob_plain;f=shell/sugar-shell;hb=HEAD