Sugar Architecture/API

From OLPC
Jump to navigation Jump to search
Table of Contents
API Introduction
Third Party Packages AbiWord ATK Avahi GTK gstreamer Cairo D-Bus evince HippoCanvas
Sugar Packs Python Scripts Library Packages Shell Packages Services Package Activity APIs

Sugar is written in Python and uses a variety of open source packages. Programming in the Sugar environment requires a basic understanding of the Sugar user interface, supporting third-party packages, and built-in Sugar packages.

Traditional software packages are built against application programming interfaces. Sugar runs Activities instead of applications, but from a developer's point of view, it's the same thing.

Third Party Packages

  • Abiword - Document writer
  • ATK - GNOME Accessibility Toolkit
  • Avahi - network service discovery system
  • GTK - GNOME Toolkit
  • gstreamer - multimedia framework
  • Cairo - 2-D graphics library
  • D-BUS - message bus service
  • Evince - document viewer
  • HippoCanvas - generic user interface widget
  • Matchbox - graphical windows manager
  • Pango - GTK package for text rendering
  • X Window System - the tried-and-true ancient X11 display libraries
  • Xul - XML User Interface Language

Sugar Packs

This details the contents and structure of OLPC Build 239. Build 303 is the latest.

Sugar Python Scripts

Several Python Scripts reside in /usr/bin

Scripts:

  • sugar-activity
  • sugar-activity-factory
  • sugar-clipboard
  • sugar-console
  • sugar-data-store
  • sugar-emulator
  • sugar-emulator-shutdown
  • sugar-nm-applet - removed 303
  • sugar-install-bundle - added 303
  • sugar-presence-service
  • sugar-presence-service2 - added 303
  • sugar-setup-activity
  • sugar-shell

Sugar Library Packages

Many Sugar library packages reside in /usr/lib/python*/site-packages/sugar

Modules:

  • TracebackUtils
  • emulator
  • env
  • logger
  • profile
  • simulator
  • util

Subpackages:

Package sugar.shell

Most of the Human Interface is implemented in the sugar.shell packages located in /usr/share/sugar/shell

Modules:

Subpackages:

Package sugar.services

Various services are provided in /usr/share/sugar/services

Modules: none

Subpackages:

Sugar Activity APIs

The previous API sections detail all Sugar interfaces. Here is an abbreviated list of the APIs most relevant for activity programming:

gtk gobject hippo logging os pango pygtk

sugar.activity.activity sugar.graphics sugar.date