The vast majority of Bonobo objects are created by the
BonoboGenericFactory implementation. This provides a
very simple C sugar wrapper of the GNOME::ObjectFactory
IDL interface, used by OAF to instantiate new objects.
Most applications when they start up will register their
Bonobo object factory with OAF, this can be done like this:
This registers the factory with OAF, associated with your
factory's OAFIID ( as specified in the installed .oaf file ).
The running_context_auto_exit_unref function is used to ensure
that the program exits the gtk main loop when all of the factory's
( or any derived ) objects are destroyed.
When an object that is created by your factory is demanded from
OAF the my_factory_function will be called:
This will return the newly constructed object via OAF to
the Object requestor.
The generic factory works in two modes, multi and plain,
it is recommended that the multi mode be used. Also, there
is a macro that can be used for simple components to remove
the burden of writing the main function and getting the
initialization correct, see BONOBO_OAF_FACTORY_MULTI.
This is a helper routine that simplifies the creation of factory
objects for GNOME objects. The factory function will be
invoked by the CORBA server when a request arrives to create a new
instance of an object supporting the Bonobo::Generic interface.
The factory callback routine is passed the data pointer to provide
the creation function with some state information.
oaf_iid :
The GOAD id that this factory implements
factory :
user_data :
Returns :
A BonoboGenericFactory object that has an activated
Bonobo::GenericFactory object that has registered with the GNOME
name server.