having one bonobo control instance per process



Hello,

I'm working on a new version of gnome-vim (vim as a bonobo control), and
trying to work out a less hackish architecture than the first attempts,
which embedded vim instances running inside zvt widgets.

The drawbacks of the first approach are mostly that it's difficult to
communicate with the vim instance (other than the primitive approach of
sending it keystrokes), so the possibilities are quite limited.

I'd like to start adding bonobo support directly in the vim source, so
that it can run as a bonobo control. 

One conclusion I have made so far, after taking a look at the vim
source, is that due to all the global data structures, it would be nigh
impossible to have more than one component per process.  Thus each
instance of gnome-vim must run in its own process.  

Conceptually this seems straightforward, but I have not been able to
find an example of a different project which does this.  All bonobo
controls which I've seen have a factory component to produce the
instances, and the factory runs in the same process as all of the
instances.  

As a test, I tried modifying a sample bonobo control so that it has no
factory, but instead is instantiated directly by starting the exe.  Oaf
started the instance fine, and the control was embedded into the
container without problems.  But when I tried to start a second instance
of the container, the control disappeared from the first container.  So
oaf apparently was expecting to be able to create a second instance of
the control using the same process, instead of starting a second
process.

My problem is, how do I write a factory which spawns vim processes
returns the object references to oaf?  The only thing I can think to do
is to use a similar tack that oaf uses to bootstrap a factory component:
the factory executable is expected to return its stringified IOR through
a pipe to the oaf process.  

I could use a similar tactic. I can implement
Gnome_Vim_Factory_create_object by spawning a vim process, get its IOR
through a pipe, and pass that back to oaf.  From looking through the
bonobo source, I think that I wouldn't be able to use the
bonobo_generic_factory in this case; I'd have to roll my own.

Does this sould like I'm on the right track?  Or is there a simpler way
to achieve what I want?  

I'm still learning a lot of bonobo/corba/oaf as I go, but as no existing
tutorial or example does what I'm trying to do, it seems like I'm either
breaking new ground or heading the wrong way.  

Feedback would be appreciated. :)

peace,
Jason




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]