A BonoboEmbeddable is a component that is an element of a compound
document. There is an implicit contract that anything implimenting
the embeddable interface will also implement the following interfaces:
An embeddable is not a Control - by this I mean that it does not control
its own sizing, rendering or layout. It is entirely a slave to the parent
with respect to this. An Embeddable should never render scroll bars into
itself ( unless, exceptionaly if it is activated, and allows the user to
pan around a larger area ). Essentialy a non-activated embeddable view
should only show things that it will print, and should render WYSIWYG
as much as possible. Embeddable's views scale linearly to obey the zoom
level they are given.
If you think your embeddable should have scroll bars, or other widgets
inside it's view, you need to implement a BonoboControl first. Many
applications will export a BonoboControl and several BonoboEmbeddable.
eg. to embed a complete gnumeric application you would use the
BonoboControl, to embed a cell range you would use a BonoboEmbeddable.
Embeddables are model / view, that is the BonoboEmbeddable should be
derived from and becomes the model, several BonoboView or
BonoboCanvasComponent views can be produced to render this information.
Here is an example of how to create a BonoboEmbeddable interface:
Note, that this example returns a GtkDrawingArea with nothing in it -
simply a white box. This is better than returning a widget - no widget
can be a correct Embeddable view, since it cannot zoom.
This routine creates a Bonobo::Embeddable CORBA server and activates it. The
factory routine will be invoked by this CORBA server when a request arrives
to get a new view of the embeddable (embeddable should be able to provide
multiple views of themselves upon demand). The data pointer is passed
to this factory routine untouched to allow the factory to get some context
on what it should create.
factory :
Factory routine that provides new views of the embeddable on demand
data :
pointer passed to the factory routine to provide context.
Returns :
a BonoboEmbeddable that contains an activated Bonobo::Embeddable
CORBA server.
This routine creates a Bonobo::Embeddable CORBA server and activates it. The
factory routine will be invoked by this CORBA server when a request arrives
to get a new view of the embeddable (embeddable should be able to provide
multiple views of themselves upon demand). The data pointer is passed
to this factory routine untouched to allow the factory to get some context
on what it should create.
item_factory :
Factory routine that provides new canvas items of the embeddable on demand
data :
pointer passed to the factory routine to provide context.
Returns :
a BonoboEmbeddable that contains an activated Bonobo::Embeddable
CORBA server.
This routine constructs a Bonobo::Embeddable CORBA server and activates it. The
factory routine will be invoked by this CORBA server when a request arrives
to get a new view of the embeddable (embeddable should be able to provide
multiple views of themselves upon demand). The data pointer is passed
to this factory routine untouched to allow the factory to get some context
on what it should create.
embeddable :
BonoboEmbeddable object to construct.
factory :
Factory routine that provides new views of the embeddable on demand
data :
pointer passed to the factory routine to provide context.
This routine defines the view factory for this embeddable component.
When a container requires a view, the routine specified in factory
will be invoked to create a new BonoboView object to satisfy this request.
embeddable :
The embeddable object to operate on.
factory :
A pointer to a function that can provide BonoboView objects on demand.