Re: Unique BonoboControl
"Gustavo J. A. M. Carneiro" <[email protected]> Wed, 05 Nov 2003 20:07:19 +0000
| Newsgroups | gmane.comp.gnome.components |
|---|---|
| Organization | INESC |
| Message-ID | <[email protected]> |
A Qua, 2003-11-05 Ã s 19:20, Mikoyan escreveu: > > > > I think that what you mean by "control" is actually a simple > > application that can have a single instance running. Some examples of > > other applications implementing the same thing are: rhythmbox, > > gnome-terminal, galeon. > > Well, I really meant a Control. Hmmmz, ok, I'm not sure if this is want > i really want in the end, but in the meantime I've learned :-) > > Just imagine an object that outputs its data to a simple control. If > another app has already activated such control (ie. embedded in its > own), it just uses the already running activated control. If not , it > just creates its own window with control to sends its output to. > (don't ask my why i think this is usefull :-)) OK, I understand now. > > But ... > > > This is sometimes called "Automation", because it allows a script to > > control, through CORBA, a running application, like what is sometimes > > achieved with a command-line interface (like the mailto: URI handler > > command: evolution "%s"). Of course, CORBA is much more comfortable for > > automation than CLI, especially through a scripting language like Python > > or Perl. ;) > > (Interesting ... more apps should have this. Is someone pushing python+ > corba as the scripting heaven for gnome? Btw, when is gnome-python with > this fix comming [http://bugzilla.gnome.org/show_bug.cgi?id=107658];-)) > > > The effect is achieved in gnome-terminal by (see > > gnome-terminal/src/terminal.c): > > 1. A .server file for the application is installed, indicating that the > > server implements Bonobo::EventSource; > > 2. On application startup, a BonoboEventSource is created; > > 3. then, the server object is registered using > > bonobo_activation_active_server_register; > > 4. if registration fails, it (usually) means that another application > > instance is already running: > > 4a. get reference to running server > > 4b. send argc/argv to the running server > > 4c. exit process > > 5. process argc/argv > > The code was indeed usefull. I've something now that really works as I > want it. Although, first creating a control, trying to register it, and > if it fails destroying that control and getting a ref of the already > running control is not what i call beautiful :-) But it looks cool > though :-) > > For what is bonobo_activation_active_server_register normally used? > (in the docs there is bonobo_activation_register_active_server, which > has also another signature...) Yeah, bonobo_activation_active_server_register is deprecated. It calls bonobo_activation_register_active_server with a default environment (the DISPLAY). > > > And yes, the Bonobo Unique Application (GEP 12) intends to solve this > > specific use case elegantly. > > Nice > > > Regards. > > Many thanks to both of you. > > Steven -- Gustavo J. A. M. Carneiro <[email protected]> <[email protected]>