[sugar] GComprisXO progress

Bert Freudenberg bert
Mon Jul 2 18:34:33 EDT 2007

On Jul 2, 2007, at 18:25 , Bruno Coudoin wrote:

> Le lundi 02 juillet 2007 ? 17:05 +0200, Bert Freudenberg a ?crit :
>> On Jul 2, 2007, at 16:41 , Marco Pesenti Gritti wrote:
>>> I'd suggest to have a look at sugar-native-factory.c in sugar  
>>> git. You
>>> can either add something like that to the binary or use it as is to
>>> launch the binary.
>> For an example of its use, see the Etoys activity in git. If anything
>> is unclear, feel free to ask.
> Yes, this is unclear. I checked twice and could not even found  
> where the
> dbus code for the registering and the event management is. Could you
> please tell me which files I have to look at and a mini description of
> what it does.

Start by looking into Etoys "activity.info". It contains this exec spec:

exec = etoys-factory org.vpri.EtoysActivity etoys-instance

This calls the "etoys-factory" which just sets up a few env vars and  
opens the log file, the executes sugar-native-factory passing all its  
parameters. Thus "sugar-native-factory" is called with the service  
name as argument plus another script ("etoys-instance") to be  
executed for each activity instance. That is, each time you click the  
activity icon, the shell sends a create() message to the factory  
which forks a new process and executes the "etoys-instance" script  
with all the parameters as key/value pairs given to create(). The  
instance script just checks these parameters and the executes the  
actual binary.

An example invocation of the etoys-instance script could look like this:

etoys-instance bundle_id org.vpri.Etoys  \
	activity_id 6f7f3acacca87886332f50bdd522d805f0abbf1f \
	object_id 456def123abc789aaa

Each activity instance then can be single threaded and does not need  
to manage multiple invocations. It still needs to create a dbus  
service providing the activity instance protocol as described in


So the sugar-native-factory program only handles the Activity Factory  
protocol, perhaps a similarly generic program could be written to  
handle the Activity Instance protocol.

- Bert -

More information about the Sugar-devel mailing list