olpcgames (version 1.6)
index
/home/mcfletch/olpc/code/games-misc/olpcgames-src/doc/pydoc/olpcgames/__init__.py

Wrapper/adaptation system for writing/porting Pygame games to OLPC/Sugar
 
The wrapper system attempts to substitute various pieces of the Pygame 
implementation in order to make code written without knowledge of the
OLPC/Sugar environment run "naturally" under the GTK environment of 
Sugar.  It also provides some convenience mechanisms for dealing with 
e.g. the Camera and Mesh Network system.
 
Considerations for Developers:
 
Pygame programs running under OLPCGames will generally not have
"hardware" surfaces, and will not be able to have a reduced-resolution 
full-screen view to optimise rendering.  The Pygame code will run in 
a secondary thread, with the main GTK UI running in the primary thread.
A third "mainloop" thread will occasionally be created to handle the 
GStreamer interface to the camera.
 
Attributes of Note:
 
    ACTIVITY -- if not None, then the activity instance which represents
        this activity at the Sugar shell level.
    WIDGET -- PygameCanvas instance, a GTK widget with an embedded
        socket object which is a proxy for the SDL window Pygame to which
        pygame renders.
    
    Constants: All event constants used by the package are defined at this 
        level.  Note that eventually we will need to switch to using UserEvent
        and making these values sub-types rather than top-level types.
 
 
Pygame events at the Activity Level:
 
    pygame.USEREVENT
        code == olpcgames.FILE_READ_REQUEST
            filename (unicode/string) -- filename from which to read
            metadata (dictionary-like) -- mapping from key to string values
            
            Note: due to a limitation in the Sugar API, the GTK event loop
            will be *frozen* during this operation, as a result you cannot 
            make any DBUS or GTK calls, nor can you use GUI during the 
            call to provide input.  That is, you have to process this event 
            synchronously.
            
        code == olpcgames.FILE_WRITE_REQUEST
            filename (unicode/string) -- file name to which to write
            metadata (dictionary-like) -- mapping from key: value where all 
                values must (currently) be strings
 
            Note: due to a limitation in the Sugar API, the GTK event loop
            will be *frozen* during this operation, as a result you cannot 
            make any DBUS or GTK calls, nor can you use GUI during the 
            call to provide input.  That is, you have to process this event 
            synchronously.
 
see also the mesh and camera modules for more events.
 
Deprecated:
 
        This module includes the activity.PyGameActivity class currently,
        this is a deprecated mechanism for accessing the activity class,
        and uses the deprecated spelling (case) of the name.  Use:
 
                from olpcgames import activity
 
                class MyActivity( activity.PygameActivity ):
                        ...
        
        to define your PygameActivity subclass (note the case of the 
        spelling, which now matches Pygame's own spelling).

 
Package Contents
        __init__ -- Wrapper/adaptation system for writing/porting Pygame games to OLPC/Sugar
_cairoimage -- Utility functions for cairo-specific operations
_gtkmain -- Support for GObject mainloop-requiring libraries when not inside GTK
_version -- Module defining the current version of the library
activity -- Embeds the Canvas widget into a Sugar-specific Activity environment
buildmanifest -- Stupid little script to automate generation of MANIFEST and po/POTFILES.in
camera -- Accesses OLPC Camera functionality via gstreamer
canvas -- Implements bridge connection between Sugar/GTK and Pygame
data (package) -- Design-time __init__.py for resourcepackage
dbusproxy -- Spike test for a safer networking system for DBUS-based objects
eventwrap -- Provides substitute for Pygame's "event" module using gtkEvent
gtkEvent -- gtkEvent.py: translate GTK events into Pygame events.
mesh -- Utilities for wrapping the telepathy network for Pygame
pangofont -- Implement Pygame's font interface using Pango for international support
pausescreen -- Display a "paused" version of the currently-displayed screen
svgsprite -- RSVG/Cairo-based rendering of SVG into Pygame Images
textsprite -- Simple Sprite sub-class that renders via a PangoFont
util -- Abstraction layer for working outside the Sugar environment
video -- Video widget for displaying a gstreamer pipe

 
Data
        ACTIVITY = None
CAMERA_LOAD = 25
CAMERA_LOAD_FAIL = 26
CONNECT = 27
FILE_READ_REQUEST = 65536
FILE_WRITE_REQUEST = 65537
MESSAGE_MULTI = 31
MESSAGE_UNI = 30
PARTICIPANT_ADD = 28
PARTICIPANT_REMOVE = 29
WIDGET = None
__path__ = ['/home/mcfletch/olpc/code/games-misc/olpcgames-src/doc/pydoc/olpcgames']
widget = None