gob now supports BonoboXObject directly, celebrate in the streets!



Since I really want to get flamed by syntactical purists and other gob
haters, I made gob support BonoboXObject directly.  This makes implementing
new bonobo classes incredibly simple.  What you do is use the "BonoboX"
class flag with the name of the idl interface, and then prepend "BonoboX"
keyword before implementation methods in the gob file.  BTW, you need
the newest 1.0.9 of gob for this.

Here's an example, imagine this idl file (for example named
GNOME_Foo_SomeInterface.idl):

  #include <Bonobo.idl>

  module GNOME {
  module Foo {

  interface SomeInterface {
	void fooBar (in string foo);
  };

  };
  };

Then to implement this you would write a gob file (name it
foo-some-interface.gob for instance):

  requires 1.0.9

  %{
  #include <gnome.h>
  #include <bonobo.h>

  #include "GNOME_Foo_SomeInterface.h"

  #include "foo-some-interface.h"
  #include "foo-some-interface-private.h"
  %}

  class Foo:Some:Interface from Bonobo:X:Object
	  (BonoboX GNOME_Foo_SomeInterface)
  {
	  BonoboX
	  private void
	  fooBar (PortableServer_Servant servant,
	          const CORBA_char *string,
	          CORBA_Environment *ev)
	  {
		  Self *self = SELF (bonobo_object_from_servant (servant));

		  /* your code here */
	  }
  }

Simple eh?  So for those that like gob, happy Bonoboing, for those
that hate it, happy flaming.

George

-- 
George <jirka 5z com>
   History teaches us that men and nations behave wisely
   once they have exhausted all other alternatives.
                       -- Abba Eban, 1970




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